This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: [PING C++] Move empty-if warning to the front-end


Paolo Bonzini wrote:

> Because the testcase says
> 
>   if (x)
>     ; /* By design we don't warn in this case.  */
>   else
>     (void)0;
> 
>   if (x)
>     (void)0;
>   else
>     ; /* { dg-warning "suggest braces around empty body in an" } */
> 
> and this causes all the differences you spotted.

All right.  I'm not sure that's how I would design the warning, but
that's an orthogonal issue.  Go ahead with the patch.

Thanks,

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


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