On 10/22/15 10:28, Bernd Schmidt wrote:
On 10/22/2015 04:24 PM, Nathan Sidwell wrote:
+      else
+    { /* Parent will skip this parallel itself.  */ }

Here too - actually no need to have an empty else at all.

I wanted somewhere clear for the comment to go. (Actually, I think this
is the one the compiler warns about -- empty dangling else).

Don't recall such a warning, but that doesn't mean it isn't there.

found it:
.../nvptx.c:3007:47: warning: suggest braces around empty body in an 'else' statement [-Wempty-body]

I did what the compiler told me!  Always obey the compiler![*]

About the
comment, it could either go just after the if, or above it, along the lines of
  /* We handle cases X, Y, Z here.  If none of them apply, then
     the parent will skip this parallel itself.  */

Again I find that confusing -- much clearer to annotate the if cascade itself. (IIRC, I originally had a comment at the top, but it was demonstrably too confusing for me as the code was wrong)

In this particular loop you could also use continue; for the empty if 
conditions.

I think that's going to be confusing too.

nathan

[*] and hypnotoad.

Reply via email to