kidoher
kidoher

Reputation: 2357

How to clear "warning: declaration does not declare anything [-fpermissive]"

When I compile a program with GCC, it will show that "warning: declaration does not declare anything [-fpermissive]".

The code in question is the following:

typedef int BOOL;

How can I clear the warning?

Upvotes: 0

Views: 1228

Answers (1)

jww
jww

Reputation: 102235

You might try the following. Similar worked for me with a union that was catching a warning.

typedef int BOOL;
...

BOOL unused;
(void)unused;

The (void)unused; avoids the subsequent unused variable warning. Its portable across all compilers.

Upvotes: 2

Related Questions