This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Error warning C275

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.

Parents
  • "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

Reply
  • "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

Children