[Bug c/65430] New: false negative of -Wsequence-point
chengniansun at gmail dot com
gcc-bugzilla@gcc.gnu.org
Sun Mar 15 06:07:00 GMT 2015
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.
$:
$:
More information about the Gcc-bugs
mailing list