I would like to ask you about assign specific memory adress for variable in C language. I need to setup Understand SciTool software, and I have some issues about it.
Please have a look:
#define dPU1 0xF0031
__SFR_EXTERN__ __near __no_init volatile union
{
TByte ioPU1;
TBitfieldByte ioPU1_Bits;
} @dPU1;
dPU1 is a register adress (Renesas RL78). Understand SciTool cant process it. I recived those messages:
[E] pasting formed '@dSMR02', an invalid preprocessing token;
[E] expected ';' after union
[E] expected identifier or '('
I can't find any information about "@" in C language. Any idea? Thanks!
Many compilers for embedded control accept certain extensions to place objects at absolute addresses.
Apparently your compiler allows to specify it via this notation.
In contrast, code analyzers are generic tools. They rarely know such extensions and so you receive this error message.
This is a good reason to wrap such an extension in a macro. This macro will be differently defined depending on the tool that parses the source. If your compiler reads the source, it provides the absolute address. If the analyzer reads the source, it expands to nothing.
This suggestion is untested: