This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/39564] New: variably modified function return types not always diagnosed


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]