public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/39582]  New: bad errors for some uses of [*] arrays
@ 2009-03-29 20:09 jsm28 at gcc dot gnu dot org
  2009-03-30  1:10 ` [Bug c/39582] " 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:09 UTC (permalink / raw)
  To: gcc-bugs

With -std=c99 -pedantic-errors, the code

void foo11d(int x[sizeof(int *[*])]);

receives the diagnostics:

t.c:1: warning: '[*]' not in a declaration
t.c:1: error: ISO C forbids zero-size array 'x'

There certainly isn't a zero-size array (a GNU extension) here; there's
a use of [*] arrays that ended up being valid with the final resolution
of DR#341 (see <http://gcc.gnu.org/ml/gcc-patches/2009-02/msg00133.html>)
and the result of sizeof should be variable, not a constant 0, in this
case.


-- 
           Summary: bad errors for some uses of [*] arrays
           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=39582


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

* [Bug c/39582] bad errors for some uses of [*] arrays
  2009-03-29 20:09 [Bug c/39582] New: bad errors for some uses of [*] arrays jsm28 at gcc dot gnu dot org
@ 2009-03-30  1:10 ` jsm28 at gcc dot gnu dot org
  2009-04-25 21:19 ` jsm28 at gcc dot gnu dot org
  2009-04-25 21:21 ` 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:31
               date|                            |


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


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

* [Bug c/39582] bad errors for some uses of [*] arrays
  2009-03-29 20:09 [Bug c/39582] New: bad errors for some uses of [*] arrays jsm28 at gcc dot gnu dot org
  2009-03-30  1:10 ` [Bug c/39582] " jsm28 at gcc dot gnu dot org
@ 2009-04-25 21:19 ` jsm28 at gcc dot gnu dot org
  2009-04-25 21:21 ` 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-25 21:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from jsm28 at gcc dot gnu dot org  2009-04-25 21:19 -------
Subject: Bug 39582

Author: jsm28
Date: Sat Apr 25 21:19:09 2009
New Revision: 146787

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=146787
Log:
        PR c/39582
        * c-typeck.c (c_expr_sizeof_type): Create a C_MAYBE_CONST_EXPR
        with non-null C_MAYBE_CONST_EXPR_PRE if size of a variable-length
        type is an integer constant.

testsuite:
        * gcc.dg/vla-20.c: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/vla-20.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/c-typeck.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c/39582] bad errors for some uses of [*] arrays
  2009-03-29 20:09 [Bug c/39582] New: bad errors for some uses of [*] arrays jsm28 at gcc dot gnu dot org
  2009-03-30  1:10 ` [Bug c/39582] " jsm28 at gcc dot gnu dot org
  2009-04-25 21:19 ` jsm28 at gcc dot gnu dot org
@ 2009-04-25 21:21 ` 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-25 21:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jsm28 at gcc dot gnu dot org  2009-04-25 21:21 -------
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=39582


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

end of thread, other threads:[~2009-04-25 21:21 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:09 [Bug c/39582] New: bad errors for some uses of [*] arrays jsm28 at gcc dot gnu dot org
2009-03-30  1:10 ` [Bug c/39582] " jsm28 at gcc dot gnu dot org
2009-04-25 21:19 ` jsm28 at gcc dot gnu dot org
2009-04-25 21:21 ` 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).