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.
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?
What warning(s) are you actually talking about ?
Hi Christoph, thanks for your interest.
Warning C259: pointer different mspace.
It could be a really dangerous warning ... or not ...
The device is a 80x51 using the Dallas 390 Linear Addressing. 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.
In the other direction, it simply uses the offset (lower 2 bytes) and ignores the high byte, what it is a really dangerous cast (the cast should not be done automatically, and this should be an error and not a warning!!)
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.