public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/22192] New: Rejection of valid array declaration.
@ 2005-06-26 15:10 neil at gcc dot gnu dot org
  2005-06-26 15:11 ` [Bug c/22192] " neil at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: neil at gcc dot gnu dot org @ 2005-06-26 15:10 UTC (permalink / raw)
  To: gcc-bugs

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];
}

-- 
           Summary: Rejection of valid array declaration.
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: neil at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22192


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c/22192] Rejection of valid array declaration.
  2005-06-26 15:10 [Bug c/22192] New: Rejection of valid array declaration neil at gcc dot gnu dot org
@ 2005-06-26 15:11 ` neil at gcc dot gnu dot org
  2005-06-26 15:55 ` jsm28 at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: neil at gcc dot gnu dot org @ 2005-06-26 15:11 UTC (permalink / raw)
  To: gcc-bugs


------- 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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c/22192] Rejection of valid array declaration.
  2005-06-26 15:10 [Bug c/22192] New: Rejection of valid array declaration neil at gcc dot gnu dot org
  2005-06-26 15:11 ` [Bug c/22192] " neil at gcc dot gnu dot org
@ 2005-06-26 15:55 ` jsm28 at gcc dot gnu dot org
  2005-06-27 13:49 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2005-06-26 15:55 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
OtherBugsDependingO|                            |16989
              nThis|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22192


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c/22192] Rejection of valid array declaration.
  2005-06-26 15:10 [Bug c/22192] New: Rejection of valid array declaration neil at gcc dot gnu dot org
  2005-06-26 15:11 ` [Bug c/22192] " neil at gcc dot gnu dot org
  2005-06-26 15:55 ` jsm28 at gcc dot gnu dot org
@ 2005-06-27 13:49 ` pinskia at gcc dot gnu dot org
  2005-07-29  2:47 ` cvs-commit at gcc dot gnu dot org
  2005-07-29  5:39 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-06-27 13:49 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-06-27 13:49 -------
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |rejects-valid
   Last reconfirmed|0000-00-00 00:00:00         |2005-06-27 13:49:19
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22192


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c/22192] Rejection of valid array declaration.
  2005-06-26 15:10 [Bug c/22192] New: Rejection of valid array declaration neil at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2005-06-27 13:49 ` pinskia at gcc dot gnu dot org
@ 2005-07-29  2:47 ` cvs-commit at gcc dot gnu dot org
  2005-07-29  5:39 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-07-29  2:47 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-07-29 02:42 -------
Subject: Bug 22192

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	jsm28@gcc.gnu.org	2005-07-29 02:42:20

Modified files:
	gcc            : ChangeLog c-typeck.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gcc.dg: c99-vla-2.c 

Log message:
	PR c/22192
	* c-typeck.c (composite_type): Prefer constant size arrays to
	VLAs.
	
	testsuite:
	* gcc.dg/c99-vla-2.c: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.9594&r2=2.9595
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-typeck.c.diff?cvsroot=gcc&r1=1.470&r2=1.471
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5848&r2=1.5849
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/c99-vla-2.c.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22192


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c/22192] Rejection of valid array declaration.
  2005-06-26 15:10 [Bug c/22192] New: Rejection of valid array declaration neil at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2005-07-29  2:47 ` cvs-commit at gcc dot gnu dot org
@ 2005-07-29  5:39 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-29  5:39 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-07-29 05:39 -------
Fixed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.1.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22192


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-07-29  5:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-26 15:10 [Bug c/22192] New: Rejection of valid array declaration neil at gcc dot gnu dot org
2005-06-26 15:11 ` [Bug c/22192] " neil at gcc dot gnu dot org
2005-06-26 15:55 ` jsm28 at gcc dot gnu dot org
2005-06-27 13:49 ` pinskia at gcc dot gnu dot org
2005-07-29  2:47 ` cvs-commit at gcc dot gnu dot org
2005-07-29  5:39 ` pinskia 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).