>GCC gems

>Everybody using GCC on a daily basis must have run into one of its hidden gems. Error messages that could be poetry, in a foreign language, written backwards. The message tells you pretty much – nothing. When you have found the problem and fixed you still wonder what GCC really meant and why it could not tell you something in English…

One of my personal favourites was when I was using C and wrote:

typedef struct { ... } Foo;

void function()
{
struct Foo foo;

...
}

Did you spot the mistake? GCC did – and told me this:

storage size of 'foo' isn't known

After much work I found that Foo wasn’t a struct, but a typedefed struct. Just skipping the word struct in the declaration of foo solved it.

What are your favorites? Comment!