https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65430

            Bug ID: 65430
           Summary: false negative of -Wsequence-point
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: chengniansun at gmail dot com

There is no warning on the expression on line 3, which has a sequence-point
issue. Either "a=3" or "a=0" could be executed first.

Moreover, it is odd that gcc does not warn that the value of the expression is
not used. 


$: cat s.c 
int a;
int fn1() { 
  (a = 3, 8) * (a = 0); 
  return a;
}
$: gcc-trunk -c -Wsequence-point s.c 
$: clang-trunk -c -Wsequence-point -Wno-unused-value s.c
s.c:3:6: warning: multiple unsequenced modifications to 'a' [-Wunsequenced]
  (a = 3, 8) * (a = 0); 
     ^            ~
1 warning generated.
$: 
$:

Reply via email to