public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/39564]  New: variably modified function return types not always diagnosed
@ 2009-03-26 17:41 jsm28 at gcc dot gnu dot org
  2009-03-30  1:10 ` [Bug c/39564] " 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-26 17:41 UTC (permalink / raw)
  To: gcc-bugs

Block-scope ordinary identifiers with variably modified type are required
to have no linkage.  Block-scope function declarations implicitly have
external linkage.  However, GCC diagnoses such declarations with variably
modified type only with an explicit "extern".

The code

int a;
void
f (void)
{
  typedef int T[a];
  extern T *g (void);
}

is correctly diagnosed with -std=c99 -pedantic-errors, although the error
message "object with variably modified type must have no linkage" is
bad (it's a function, not an object).  The equivalent code

int a;
void
f (void)
{
  typedef int T[a];
  T *g (void);
}

should be diagnosed, but is not.


-- 
           Summary: variably modified function return types not always
                    diagnosed
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          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=39564


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

* [Bug c/39564] variably modified function return types not always diagnosed
  2009-03-26 17:41 [Bug c/39564] New: variably modified function return types not always diagnosed jsm28 at gcc dot gnu dot org
@ 2009-03-30  1:10 ` jsm28 at gcc dot gnu dot org
  2009-04-25 18:56 ` jsm28 at gcc dot gnu dot org
  2009-04-25 18:57 ` 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:16
               date|                            |


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


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

* [Bug c/39564] variably modified function return types not always diagnosed
  2009-03-26 17:41 [Bug c/39564] New: variably modified function return types not always diagnosed jsm28 at gcc dot gnu dot org
  2009-03-30  1:10 ` [Bug c/39564] " jsm28 at gcc dot gnu dot org
@ 2009-04-25 18:56 ` jsm28 at gcc dot gnu dot org
  2009-04-25 18:57 ` 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 18:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from jsm28 at gcc dot gnu dot org  2009-04-25 18:56 -------
Subject: Bug 39564

Author: jsm28
Date: Sat Apr 25 18:55:50 2009
New Revision: 146778

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=146778
Log:
        PR c/39564
        * c-decl.c (grokdeclarator): Diagnose declarations of functions
        with variably modified return type and no storage class
        specifiers, except for the case of nested functions.  Distinguish
        extern declarations of functions with variably modified return
        types from those of objects with variably modified types.

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

Added:
    trunk/gcc/testsuite/gcc.dg/vla-19.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/c-decl.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c/39564] variably modified function return types not always diagnosed
  2009-03-26 17:41 [Bug c/39564] New: variably modified function return types not always diagnosed jsm28 at gcc dot gnu dot org
  2009-03-30  1:10 ` [Bug c/39564] " jsm28 at gcc dot gnu dot org
  2009-04-25 18:56 ` jsm28 at gcc dot gnu dot org
@ 2009-04-25 18:57 ` 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 18:57 UTC (permalink / raw)
  To: gcc-bugs



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


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

end of thread, other threads:[~2009-04-25 18:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-26 17:41 [Bug c/39564] New: variably modified function return types not always diagnosed jsm28 at gcc dot gnu dot org
2009-03-30  1:10 ` [Bug c/39564] " jsm28 at gcc dot gnu dot org
2009-04-25 18:56 ` jsm28 at gcc dot gnu dot org
2009-04-25 18:57 ` 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).