Skip to main content
Knowledgebase
Home
Renesas India - Knowledgebase

Bitwise access and the error code E0520018, E0520065 (CC-RL)

Last Updated:04/17/2017

Question:

I am using the CC-RL compiler for RL78 devices. The error codes E0520018 and E0520065 appear when I add “.<numeral>” to the name of a variable for access to a bit of the variable. 
E0520018: Expected a “)”.
E0520065: Expected a “;”.

Answer:

CC-RL does not have a facility for the output of code which controls the value of a specific bit by adding “_.<numeral>” to the name of a variable.
Define the variable so that its value can be handled as either a union of bytes or bits.

(Example)
typedef union {
 unsigned char ByteMem;
 struct
 {
     unsigned char no0:1;
     unsigned char no1:1;
     unsigned char no2:1;
     unsigned char no3:1;
     unsigned char no4:1;
     unsigned char no5:1;
     unsigned char no6:1;
     unsigned char no7:1;
 } BitfMem;
}Byte_Bitf_Member;
volatile Byte_Bitf_Member data;
void func(void)
{
 data.ByteMem = 1; // Operation to assign the value 1 to the byte
 data.BitfMem.no7 = 1; // Operation to assign the value 1 to a bit
}
 

Suitable Products
e² studio
CS+ (formerly CubeSuite+)
C Compiler Package for RL78 Family