This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] s390*: watchpoints regression [repost]


> FYI I am aware of this rule and I try to follow it but it seems
> unnatural to me.  It then requires new { brackets } and when reading
> the code I would more expect to see why the conditional happens, not
> why the return happens.

Interesting, the opposite feels completely unnatural to me: The comment
only applies if the condition is true, whereas in the case I was quoting,
it looks like it applies no matter what.

Regarding the extra curly braces, I think it's OK to leave them out,
like so:

    if ([...])
      /* This is a comment that ...  */
      return;

If we prefer keeping the comment before the condition, then I would
suggest we rewrite the comment to say so.  Something like this:

    /* If this is an old thread, or there is something else
       special to it, then it's ok to do nothing.  */
    if ([...])
      return;

-- 
Joel


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]