Incomplete array element type as function argument (C mode)

Florian Weimer fw@deneb.enyo.de
Mon Feb 24 13:09:20 GMT 2025


* Beni Falk via Gcc-help:

> void f1(My_struct *a, unsigned n)
> void f2(My_struct a[], unsigned n)

> Why doesn't f2 compile? I was under the impression that there is no
> difference between f1 and f2.

Element types of arrays must be object types.  Incomplete types are
not object types.  This is just another way how array types and
pointer types differ.


More information about the Gcc-help mailing list