This is the mail archive of the
egcs-bugs@egcs.cygnus.com
mailing list for the EGCS project.
Re: Too many warnings.
- To: egcs-bugs@egcs.cygnus.com, uddeborg@carmen.se
- Subject: Re: Too many warnings.
- From: Phil Edwards <pedwards@jaj.com>
- Date: Fri, 2 Jul 1999 10:35:59 -0400
> int i, j;
> void f()
> {
> i++ && (j=84);
> }
[snip]
> #.c:4: warning: value computed is not used
> In this case it seems to me it would be reasonable
> for the compiler to deduce everything is indeed needed.
The compiler is doing the correct thing here. It's not the i++ nor
the (j=84) that's causing the complaint. It's the result of the
&& expression, that is,
(truth value) && (truth value)
yields another truth value, and /that/ isn't being used. If you
declare another int, say 'q', and assign to it,
q = i++ && (j=84);
the warning goes away.
(If you reply to the list, please don't cc another copy to me. Thanks!)
Phil