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? 😀
You don’t get an error, just a warning.
And that applies to how you declare your
struct cal: it is not volatile by itself; the volatile only applies to a concrete variable definition.So in
static struct cal cal, your variablecalis juststatic, but notvolatile.In that sense, the
volatiledeclaration is, as the warning says, useless.