Skip to main content
Knowledgebase
Home
Renesas Singapore - Knowledgebase

W0523082 Message (CC-RL)

Last Updated:04/17/2017

Question:

I am using the CC-RL compiler for RL78 devices. Why does the following message appear when I set the address of a variable in a pointer: “W0523082: Pointer to the object of even alignment holds the odd address"?
 Example:
unsigned char c;
unsigned short *p;
p = (unsigned short *)&c

Answer:

The processors of RL78 family devices do not support incorrectly aligned access (2-byte access to odd addresses).
That’s why you’re getting that message.
In the example you’ve given, the alignment condition for access to variable c is a pointer to 1 byte, but pointer variable p is a pointer with an alignment condition of 2 bytes. 
In case of access to variables of different types, if all variables to be accessed are members of a union, access to the member names will always match the alignment condition for the types to be accessed.
Example:
union {
 unsigned char c;
 unsigned short s;
}u;
unsigned short *p;
p =&u.s;

Suitable Products
e² studio
CS+ (formerly CubeSuite+)
C Compiler Package for RL78 Family
  • Was this article helpful?