Using gcc 4.1.0 on amd64, with -Wall (64 bit target):

int g(void);
long h(void);
void f(void)
{
        0 ? h() : g();
}

foo.c:6: warning: value computed is not used

Either changing 0 to 1 or swapping g and h makes the warning go away.
This was the result of a (very reasonable) macro expansion.


-- 
           Summary: spurious warning: value computed is not used
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mattias at virtutech dot se
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26632

Reply via email to