Warning: the declaration declares nothing

I am getting this warning all over the place in some perfectly functioning objective-c code in Xcode. My google-fu didn't help me ... others have run into this, but I couldn't find an explanation of what exactly is causing it or how to fix it.

-1


a source to share


3 answers


Found the problem and fixed it. I had this:

enum eventType { singleTouch };
enum eventType type;

      



... and changed it to:

enum eventType { singleTouch } type;

      

+3


a source


In pure C, the following code:

int;
typedef int;

      

causes the following warnings from GCC without warning options set:



x.c:1: warning: useless keyword or type name in empty declaration
x.c:1: warning: empty declaration
x.c:2: warning: useless keyword or type name in empty declaration
x.c:2: warning: empty declaration

      

Maybe you have something similar in your code?

+3


a source


I was able to reproduce this error with the following code:

#define MY_INT int;
MY_INT a;

      

It compiles the ';' in the #define line.

0


a source







All Articles