This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/61449] New: Statement expressions disallow storage specifiers
- From: "cube2killfield at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 08 Jun 2014 20:41:23 +0000
- Subject: [Bug c/61449] New: Statement expressions disallow storage specifiers
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61449
Bug ID: 61449
Summary: Statement expressions disallow storage specifiers
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: cube2killfield at gmail dot com
Essentially we have a tool which preprocesses C code and produces these inline
statement expressions with prototypes like ({ void foo(void); &foo; }) and then
later implements the function. This is fine for global scope functions, but
ideally we want static storage on these functions as they're not suppose to
leak the file scope or be subject to automatic library import. The problem is
one cannot do the following with statement expressions.
({ static void foo(void); &foo; })
static void foo() { }
This is fairly inconsistent behavior in respect to what constitutes a valid
declaration. I'm surprised this issue hasn't been run into before. Storage
specifiers should be valid in statement expressions.