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

Disable Keil warning

Hello,

I've been trying to remove a compiling warning (C182) without success.

Can anyone point me in the right direction? Is there a directive available to disable a specific warning ?

Thank you.

8051 architecture, c51 compiler

Parents
  • Disabling such a warning is crazy.

    It will appear e. g. if you do the following:

    int* pi;
    char* pc;
    

    Then you might like to write

    pi= pc;
    


    of course this is extremely dangerous, therefore you get this warning.

    But to tell the compiler, that you are really sure what is going on there, you should cast:

    pi= (int*)pc;
    

    Then the compiler will assume that you take the risk yourself and will not warn you further ...

Reply
  • Disabling such a warning is crazy.

    It will appear e. g. if you do the following:

    int* pi;
    char* pc;
    

    Then you might like to write

    pi= pc;
    


    of course this is extremely dangerous, therefore you get this warning.

    But to tell the compiler, that you are really sure what is going on there, you should cast:

    pi= (int*)pc;
    

    Then the compiler will assume that you take the risk yourself and will not warn you further ...

Children
No data