char drawstrings[DRAW_MAX][] = { " .. give error
Ian Lance Taylor
iant@google.com
Mon Oct 19 17:47:00 GMT 2009
Bernd Roesch <nospamname@gmx.de> writes:
> I compile an old code which use this and i think its compile with Gcc 2.95
> and the
> PPC GCC 1998 or 1999
> it fail to compile with newer compiler.
>
> #define DRAW_MAX 4
> char drawstrings[DRAW_MAX][] = {
> "Number of points drawn using 3D hardware:",
> "Number of lines drawn using 3D hardware:",
> "Number of triangles drawn using 3D hardware:",
> "Number of quads drawn using 3D hardware:"};
>
> give error on GCC3.4.0
>
> 98 E:\amiga\AmiDevCpp\bernd\StormMesaNew\src\AMIGA\src\ADisp_HW.h elements
> of array `drawstrings' have incomplete type
>
> gcc4.5.0 report this.
>
> 6 E:\amiga\AmiDevCpp\bernd\StormMesaNew\src\AMIGA\src\ADisp_HW.h:98 array
> type has incomplete element type
>
> Is this a GGC Bug, or is that syntax no longer support ?.
>
> I change code to this, thats more easy and it compile ok but must check if
> its same.
>
> const char * drawstrings[] = {
> "Number of points drawn using 3D hardware:",
> "Number of lines drawn using 3D hardware:",
> "Number of triangles drawn using 3D hardware:",
> "Number of quads drawn using 3D hardware:"
> };
This question is not appropriate for the gcc@gcc.gnu.org mailing
list. It would be appropriate for gcc-help@gcc.gnu.org. Please take
any followups to gcc-help. Thanks.
Your program is not valid C, and I don't see how it could ever have
been compiled by any C compiler. Changing it to something like
char drawstrings[DRAW_MAX][80]
would work.
Ian
More information about the Gcc
mailing list