This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/36685] New: clarify/diagnose use of weak constant
- From: "algrant at acm dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Jul 2008 10:01:14 -0000
- Subject: [Bug c++/36685] New: clarify/diagnose use of weak constant
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Consider this:
__attribute__((weak)) extern int const K = 7;
int f(void) { return K; }
int a[K];
Assuming the combination of 'weak' and 'const' is legitimate
(and it seems useful enough to allow), the compiler should avoid
the constant-promotion optimization when generating f(), and
should fault a[].
--
Summary: clarify/diagnose use of weak constant
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: algrant at acm dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36685