public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/39581] New: VLA types at file scope wrongly rejected
@ 2009-03-29 20:01 jsm28 at gcc dot gnu dot org
2009-03-30 1:10 ` [Bug c/39581] " jsm28 at gcc dot gnu dot org
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2009-03-29 20:01 UTC (permalink / raw)
To: gcc-bugs
GCC gives an error "variable-size type declared outside of any function"
for code such as:
int a;
int b = sizeof (int (*)[a]);
As far as I can tell there is no basis for this in C99; the sizeof expression
certainly has result an integer constant in this case and its operand
is not evaluated. It's declarations of ordinary identifiers with variably
modified type that aren't allowed outside functions.
Similarly, casts to variably modified types should be permitted at file
scope under similar circumstances to those accepted in static initializers
in gcc.dg/c99-const-expr-11.c (and gnu99-const-expr-3.c).
--
Summary: VLA types at file scope wrongly rejected
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Keywords: rejects-valid
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jsm28 at gcc dot gnu dot org
OtherBugsDependingO 16989
nThis:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39581
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c/39581] VLA types at file scope wrongly rejected
2009-03-29 20:01 [Bug c/39581] New: VLA types at file scope wrongly rejected jsm28 at gcc dot gnu dot org
@ 2009-03-30 1:10 ` jsm28 at gcc dot gnu dot org
2009-04-26 17:01 ` jsm28 at gcc dot gnu dot org
2009-04-26 17:01 ` jsm28 at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2009-03-30 1:10 UTC (permalink / raw)
To: gcc-bugs
--
jsm28 at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2009-03-30 01:10:24
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39581
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c/39581] VLA types at file scope wrongly rejected
2009-03-29 20:01 [Bug c/39581] New: VLA types at file scope wrongly rejected jsm28 at gcc dot gnu dot org
2009-03-30 1:10 ` [Bug c/39581] " jsm28 at gcc dot gnu dot org
@ 2009-04-26 17:01 ` jsm28 at gcc dot gnu dot org
2009-04-26 17:01 ` jsm28 at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2009-04-26 17:01 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from jsm28 at gcc dot gnu dot org 2009-04-26 17:01 -------
Fixed for 4.5.
--
jsm28 at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Known to work| |4.5.0
Resolution| |FIXED
Target Milestone|--- |4.5.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39581
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c/39581] VLA types at file scope wrongly rejected
2009-03-29 20:01 [Bug c/39581] New: VLA types at file scope wrongly rejected jsm28 at gcc dot gnu dot org
2009-03-30 1:10 ` [Bug c/39581] " jsm28 at gcc dot gnu dot org
2009-04-26 17:01 ` jsm28 at gcc dot gnu dot org
@ 2009-04-26 17:01 ` jsm28 at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2009-04-26 17:01 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from jsm28 at gcc dot gnu dot org 2009-04-26 17:00 -------
Subject: Bug 39581
Author: jsm28
Date: Sun Apr 26 17:00:04 2009
New Revision: 146806
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=146806
Log:
PR c/39581
* c-decl.c (global_bindings_p): Return negative value.
(c_variable_size): New. Based on variable_size from
stor-layout.c.
(grokdeclarator): Call c_variable_size not variable_size.
testsuite:
* gcc.dg/c99-const-expr-14.c, gcc.dg/gnu99-const-expr-4.c,
gcc.dg/vla-21.c: New tests.
Added:
trunk/gcc/testsuite/gcc.dg/c99-const-expr-14.c
trunk/gcc/testsuite/gcc.dg/gnu99-const-expr-4.c
trunk/gcc/testsuite/gcc.dg/vla-21.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/c-decl.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39581
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-04-26 17:01 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-29 20:01 [Bug c/39581] New: VLA types at file scope wrongly rejected jsm28 at gcc dot gnu dot org
2009-03-30 1:10 ` [Bug c/39581] " jsm28 at gcc dot gnu dot org
2009-04-26 17:01 ` jsm28 at gcc dot gnu dot org
2009-04-26 17:01 ` jsm28 at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).