This is the mail archive of the gcc-bugs@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]

Too many warnings.


Version information
===================
inus> gcc --version
egcs-2.91.66
inus> uname -a
Linux inus 2.2.9 #2 Sat May 29 14:35:34 MEST 1999 i686 unknown

Description
===========
This code:

    int i, j;
    void f()
    {
      i++ && (j=84);
    }

when compiled with this command:

    inus> gcc -Wunused -c #.c

gives this error message.

    #.c: In function `f':
    #.c:4: warning: value computed is not used

Obviously I did ask for extra warnings, and sometimes valid
constructions cause warnings because the compiler can't conclude the
complete logic.  In this case it seems to me it would be reasonable
for the compiler to deduce everything is indeed needed.  The value of
pure assignment expressions are usually ignored too, but the compiler
understands that.

Of course it could be that there are technical reasons it is too much
trouble to check for this slightly obscure construct.  (The original
source was a more complex macro, as you might have guessed.)  But I
decided that was for you to judge; I submit this report in case you
wish to do something about it.


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