This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/13101] New: incorrect warning on initialized extern const function pointer
- From: "jbeulich at novell dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Nov 2003 10:45:20 -0000
- Subject: [Bug c++/13101] New: incorrect warning on initialized extern const function pointer
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
While for most other types the warning does, as expected, not occur, the
following construct causes it. Since the warning cannot be suppressed this
especially causes problems in -Werror contexts. Note additionally that despite
the warning that object is placed into .rodata (which indicates that the
compiler did not lose the 'const' qualifier, as could be assumed by inspecting
the check made in grokdeclarator(), which obviously suggests the qualifier is
missing). Not also that omitting the extern specifier and turning on
optimization leads to the symbol being eliminated if otherwise unreferenced (as
expected, but considered another proof of the const qualifier being honored in
every other respect).
extern void(*const ptr)() = 0;
--
Summary: incorrect warning on initialized extern const function
pointer
Product: gcc
Version: 3.3.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jbeulich at novell dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-gnu-linux
GCC host triplet: i686-pc-gnu-linux
GCC target triplet: i686-pc-gnu-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13101