unknown bound: array error.

Ingo Krabbe ikrabbe@earthling.net
Mon Jul 9 16:28:00 GMT 2001


On Mon, 9 Jul 2001, Mark J. Turick wrote:

>
> I have a large amount of legacy code for a project that we support
> on
> various unix platforms. Some of the internal structures are defined
> as:
>
> typedef struct {
>  int xpos;
>  int ypos;
> } XYCoordStruct, (*XYCoordPtr)[];
>
	Ok it seems to be another standart problem. While Solaris 8 and
GCC Compilers try to behave as standart compilers many others try to
compile code that programmers thought of nice looking code. Its a kind of
philosophy. I'm not involved in the devlopment of GCC, but I think it goes
in the right direction, thinking about the future.
	By the way. I don't get this error with gcc 3.1 (which comes from
a cvs checkout).
	typedef struct
	{
		int xpos;
		int ypos;
	} XYCoordStruct, *(XYCoordPtr)[];

	int libdReturnVCoords (
		int id_index, int time, int npts,
		XYCoordPtr rpts, int *nearest );

	int main( argc, argv )
		int argc;
		char** argv;
	{
		int x;
		XYCoordStruct* a;
		libdReturnVCoords( 10, 5, x, &a, &x );
		return 0;
	}

compiles fine, though complaining about missing libdReturnVCoords at the
linker stage of course. But I cannot declare a Variable to be of type
XYCoordPtr of course!
	XYCoordPtr b;
gives a "array size missing in `b'" error.




More information about the Gcc-help mailing list