On Mon, May 07, 2012 at 02:37:21PM +0200, Smets, Jan (Jan) wrote:
> I noticed that CIL removes some parentheses and GCC's -Wall produces a 
> warning.
> if (! var & 1)
> GCC's warning message: suggest parentheses around operand of '!' or change 
> '&' to '&&' or '!' to '~' [-Werror=parentheses]


> I know the output is valid C code and we can argue if GCC should warn or not,
> but I don't like to disable this new warning.  Is it possible to modify this
> behaviour? 

CIL parses your input into an AST, and then outputs a serialization of this AST.
We could modify the pretty printer so that it outputs parentheses around operand
of '!', but this means that it would also output explicit parentheses when they
do not appear in the input file: this would hide useful warnings from gcc.  I
don't see how to retain the information from input to output.

In any case, you could use your own pretty printer to cover that case.  I could
show you an example, but need more information on this warning.  Could you take
the time to describe exactly the cases where you would expect CIL to add
parentheses?

Best regards,
-- 
Gabriel

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
CIL-users mailing list
CIL-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cil-users

Reply via email to