Skip to main content
Knowledgebase
Home
Renesas Electronics Europe - Knowledgebase

Variable length argument and message W0523082 (CC-RL)

Last Updated:04/17/2017

Question:

I am using the CC-RL compiler for RL78 devices. This message appears when I compile a file that includes a function which has a variable length argument. What is the solution?
W0523082: Pointer to the object of even alignment holds the odd address.

Answer:

va_list and va_arg are defined in stdarg.h as follows.
typedef char __near *va_list;
#define va_arg(ap,type) (*(type *)((ap+=((sizeof(type) + 1) & ~1))-((sizeof(type) + 1) & ~1)))
When a type with 2-byte alignment such as char* is written as the argument type, the message W0523082 appears since char* will be cast to int* and so on in accord with the contents of va_arg.
ap is placed on the stack, and is calculated to make the address an even number, and a type with 2-byte alignment will not be placed at an odd address due to va_arg.
The warning is output because this is a specification of CC-RL. Just ignore it.
Suitable Products
e² studio
CS+ (formerly CubeSuite+)
C Compiler Package for RL78 Family
  • Was this article helpful?