This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/22192] Rejection of valid array declaration.
- From: "neil at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Jun 2005 15:11:37 -0000
- Subject: [Bug c/22192] Rejection of valid array declaration.
- References: <20050626151049.22192.neil@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From neil at gcc dot gnu dot org 2005-06-26 15:11 -------
(In reply to comment #0)
> With -fsyntax-only GCC erroneously rejects the following array 'x' as having
> non-constant size. Its size should evaluate to 1.
>
> int
> bar (int v)
> {
> int (*p)[v];
> int (*q)[2];
>
> static int x[sizeof(*(v ? p : q)) == 2 * sizeof (int)];
>
> return x[0];
> }
I should add that switching p and q causes GCC to accept it.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22192