[Bug c/11377] New: fault or warn modifiable static in extern inline definition
algrant at myrealbox dot com
gcc-bugzilla@gcc.gnu.org
Mon Jun 30 10:25:00 GMT 2003
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11377
Summary: fault or warn modifiable static in extern inline
definition
Product: gcc
Version: 3.3
Status: UNCONFIRMED
Severity: enhancement
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: algrant at myrealbox dot com
CC: gcc-bugs at gcc dot gnu dot org
C prohibits this (6.7.4#3):
extern inline int f(void) { static int n; return ++n; }
Even with 'gnu89' extern-inline semantics, gcc does not treat this
predictably, as a given call site may use one of two possible
instances of 'n', so a warning to that effect would be useful.
More information about the Gcc-bugs
mailing list