This is the mail archive of the gcc@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]

Re: gcc 4.1 regression for adjusted function declaration?


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.


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