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: [RFC] Fix false ARI messages


On Fri, Feb 13, 2009 at 05:06:56PM +0100, Pierre Muller wrote:
>   I also found out that many
> "if assignment" warnings were due to 
> macros containing complete if () then {} else {}
> code.
> 
> #define YY_INPUT(BUF, RESULT, MAX_SIZE) \
>     if ( *lexptr == '\000' ) \
>       (RESULT) = YY_NULL; \
>     else \
>       { \
>         *(BUF) = *lexptr; \
>         (RESULT) = 1; \
>         lexptr += 1; \
>       }
> The proposed change might miss some
> real errors like
> 
> if (((test == NULL)|| (test1 == NULL)) && (test2 = NULL)) {

How many are due to this sort of construct?  I picked a few others,
and they looked like either real bugs or else deliberate usage
(with the double parentheses that GCC mandates to avoid a warning).

If it's mostly in .l files, then we can use fix() instead.

-- 
Daniel Jacobowitz
CodeSourcery


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