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

Dissabling specific warnings in C51

I'm trying to disable some disturbing warnings (the generated code is fine; don't worry) but the only I find is the warninglevels (0, 1 or 2).

Is there any directive to disable a specific Warning in the C51 compiler?

Parents
  • It could be a really dangerous warning ... or not ...

    It's classified as Error/Warning. I would take that even more seriously than just a regular warning.

    It seems the compiler casts from xdata to far correctly (adding the third byte to the pointer), but in any case, it also add a warning.

    Are you using implicit or explicit casting ? If the former, does the warning go away if you cast explicitly ?

    Anyway - casting from a pointer to xdata to a pointer to code memory is a fairly odd operation (I'd really have to think hard to find any operation that requires such casts), and not at all covered by any standard C rule. A different compiler (version) might handle this type of cast entirely differently.

Reply
  • It could be a really dangerous warning ... or not ...

    It's classified as Error/Warning. I would take that even more seriously than just a regular warning.

    It seems the compiler casts from xdata to far correctly (adding the third byte to the pointer), but in any case, it also add a warning.

    Are you using implicit or explicit casting ? If the former, does the warning go away if you cast explicitly ?

    Anyway - casting from a pointer to xdata to a pointer to code memory is a fairly odd operation (I'd really have to think hard to find any operation that requires such casts), and not at all covered by any standard C rule. A different compiler (version) might handle this type of cast entirely differently.

Children
No data