Skip to main content
Knowledgebase
Home
Renesas Electronics Europe - Knowledgebase

How do I eliminate error when I use #pragma section?

Latest Updated:11/21/2014

Question:

I am using the CA78K0R compiler for RL78 and 78K0R products. When I use #pragma section to change a variable section, I get the following warning message, an object file is not created, and an error occurs at the time of linkage. How do I eliminate this error?
W0837 Output assembler source file, not object file

(Description in the program)
#pragma section @@DATA DATA1
int b;
#pragma section @@DATA @@DATA

Answer:

When the #pragma section directive is executed after the body of the C-source file, an assembly-source file is created instead of an object module file.
The warning message W0837 indicates that an assembly source (*.ASM) file will be output instead of an object file (*.REL), even if the -o option has been set to specify the creation of an object-module file.
Therefore, since an object module file for linking does not exist, building will fail.
When setting compiler options, specify the assembly-source file creation specification option, -SA or -A.
For CubeSuite+, specify a setting other than [No] for [Output assemble file] on the [Compile Options] tabbed page in the [Property] panel of the build tool.
Suitable Products
CS+ (formerly CubeSuite+)
C Compiler Package for RL78 and 78K Families
Compiler for RL78 Family and 78K0R [CA78K0R]