public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: jonathan.ashley@praxis-cs.co.uk To: gcc-gnats@gcc.gnu.org Subject: c/7243: cannot declare an array at file level with constant expression for size Date: Tue, 09 Jul 2002 06:56:00 -0000 [thread overview] Message-ID: <20020709135153.8976.qmail@sources.redhat.com> (raw) >Number: 7243 >Category: c >Synopsis: cannot declare an array at file level with constant expression for size >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: rejects-legal >Submitter-Id: net >Arrival-Date: Tue Jul 09 06:56:00 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Jon Ashley >Release: 3.1.1 20020706 (prerelease) >Organization: >Environment: Cygwin on Windows 2000. (Also reproduced on version 2.8.1 on Solaris.) >Description: If an array is declared at file level with a size given by a named constant (declared as 'const int x = 5' for example), the compiler incorrectly rejects it with the message "variable-size type declared outside of any function". This conflicts with A8.6.2 from K&R2. >How-To-Repeat: const int x = 1; int y[x]; gcc -c demo.c >Fix: Don't do this. >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: text/plain; name="demo.c" Content-Disposition: inline; filename="demo.c" const int x = 1; int y[x];
next reply other threads:[~2002-07-09 13:56 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2002-07-09 6:56 jonathan.ashley [this message] 2002-07-09 8:28 nathan
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20020709135153.8976.qmail@sources.redhat.com \ --to=jonathan.ashley@praxis-cs.co.uk \ --cc=gcc-gnats@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).