This is the mail archive of the gcc-help@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: [PATCH] TRACING: Fix a copmile warning


Steven Rostedt <rostedt@goodmis.org> writes:

>> It seems gcc transforms the conditional from:
>> 
>> if (a != NULL && b != NULL) ...
>> 
>> to
>> 
>> if (b != NULL && a != NULL) ...
>> 
>> In which case the warning is fully valid. I'm not sure what's the C
>> standard guarantee in term of conditional test order. gcc 4.7.0 has
>> the same behavior.
>
> Yes it seems to be doing this :-/
>
> This is a real bug!

To be clear, gcc is not doing that, and this is not a code generation
bug.  It is a warning generation bug; the generated code is correct.

Ian


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