gcc 4.1 regression for adjusted function declaration?

Joern RENNECKE joern.rennecke@st.com
Thu Feb 16 20:33:00 GMT 2006


Andrew Pinski wrote:

>> and was said to involve undefined behavior.  "However, there is 
>> nothing to
>> suggest that a not-strictly-conforming array type can magically be
>> transformed into a strictly conforming pointer parameter via this rule."
>
Ok, I get it. The 'incomplete type' phrase refers to arrays without a 
size expression.
However, these seem not to be covered by the first paragraph of 6.7.5.2 .
I.e. in:

struct tag;
extern void f (struct tag a[]);

the [ and ] don't delimit an expression or * ; the size is not present.
Hence 'a' has incomplete type before adjustment, and is a reference type
(pointer to struct tag) after adjustment.

This, too is rejected by gcc 4.1 .  I think the standard says this code 
is legal.



More information about the Gcc mailing list