This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
gcc 4.1 regression for adjusted function declaration?
- From: Joern RENNECKE <joern dot rennecke at st dot com>
- To: gcc at gcc dot gnu dot org
- Date: Thu, 16 Feb 2006 17:52:46 +0000
- Subject: gcc 4.1 regression for adjusted function declaration?
The following code gives an error with gcc 4.1:
struct tag;
extern void f (struct tag a[1]);
gcc 3.2.3 compiles this code without complaint.
I'm not sure what the c99 standard is actually saying about this code.
On the one hand, in 6.7.5.2, it says about array declarators:
The element type shall not be an incomplete or function type.
On the other hand, in 6.7.5.3, function declarators, it says:
"After adjustment, the parameters in a parameter type list in a function
declarator that is
part of a definition of that function shall not have incomplete type."
and
"A declaration of a parameter as ``array of type'' shall be adjusted to
``qualified pointer to
type'',.."
You can't actually have an 'array of type' without having an array
declarator first, and I also
can't find anything about how you could construct in incomplete array
declarator using an
incomplete type, but if you can't, what would be the point of specifying
that the the test for
a part of the definition having incomplete type is to be done after
adjustment?