Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"useless type qualifier" error

Tags:

c

struct

I get the following error with the following code. I tried to figure out where the problem is over Google, but I didn't find anything helpful.

Compiling /home/tectu/projects/resources/chibios/ext/lcd/touchpad.c
In file included from /home/tectu/projects/resources/chibios/ext/lcd/touchpad.c:1:0:
/home/tectu/projects/resources/chibios/ext/lcd/touchpad.h:17:1: warning: useless type qualifier in empty declaration [enabled by default]

Here's the the code from line 12 to line 17 from touchpad.h:

volatile struct cal {
    float xm; 
    float ym; 
    float xn; 
    float yn; 
};

And here's how I use this struct inside touchpad.c:

static struct cal cal = { 
    1, 1, 0, 0  
};

Can anyone show me the light? :D

like image 666
Joel Bodenmann Avatar asked Jun 11 '12 10:06

Joel Bodenmann


1 Answers

volatile as a qualifier can be applied to a particular instance of structure.
You are applying it to a type which is useless and the compiler correctly points it out.

like image 164
Alok Save Avatar answered Oct 13 '22 13:10

Alok Save