What does this error message means?

Martin von Loewis martin@mira.isdn.cs.tu-berlin.de
Sun Oct 18 11:04:00 GMT 1998


> I've been trying to get an old C++ program to compile and one of the error
> messages I've seen is the one as below:
> 
> ../dagCL/AssocArray.h:48: warning: ANSI C++ forbids declaration `dagAssocArray' with no type
> 
> What does this means, and is there an option to pass to the compiler to
> tell it to pretend it's an old C++ compiler to get around this message? 

It means that the input is not valid standard C++. Unfortunately, you
did not share line 48 of AssocArray.h with us, so we can't really tell
what the problem is. The shortest program that produces this message is

dagAssocArray;

In this case, this would be valid C and a define a global variable of
type `int'. In C++, this construct is no longer valid. Perhaps the
intention of the C++ code in AssocArray.h is different, so you'd need
to understand the code and fix it.

Regards,
Martin



More information about the Gcc mailing list