Feb 9, 2012

warning: useless storage class specifier in empty declaration


Warning: useless storage class specifier in empty declaration

Solution:

Cause of such warning is declaration of data type without any variable when we explicitly writing the storage class.For example:

static struct Testa
     
      int a;
}; 

To solve this problem you have choices:

1.   

static struct Test{
     
      int a;
}x; 

2. 

struct Test{
     
      int a;
}; 
  
Another example:

extern enum Test{
     A,B,C
}; 

Solution:

1.

extern enum Test{
     A,B,C
}pqr;

2.

enum Test{
     A,B,C
}; 

No comments:

Post a Comment