We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi to everybody! I am compiling the following code with the keil compiler version 8.18:
static portTASK_FUNCTION( prvIdleTask, pvParameters ) { (void ) pvParameters; .... }
and I get the following warning message:
warning C275: expression with possibly no effect
What means this sentence? The (void) is not a data type, why not the keil compiler give an error? only a warning? Is it possible to solve this warning?
Thanks in advance.
"What means this sentence?"
It means exactly what it says!
It means that the expression possibly does not do anything.
Please read the instructions on how to post source code
static portTASK_FUNCTION( prvIdleTask, pvParameters ) { (void) pvParameters; // This is an expression; // It clearly has no effect // ie, it does nothing.
This is a common attempt to get rid of a warning like "parameter 'pvParameters' is not used" - but this shows exactly why the attempt is flawed!
See, for example: http://www.keil.com/forum/docs/thread2356.asp
Thank you for your quick response. Greatings from Granada, Spain.