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