English
Language : 

CC78K0S Datasheet, PDF (373/520 Pages) NEC – C Compiler Ver.1.30 or Later Language
CHAPTER 11 EXTENDED FUNCTIONS
#pragma section…
#pragma section…
CODING ERROR EXAMPLE 2
b1.h
const int i;
b2.h
const int j;
#include "b1.h"
b.c
const int k;
#pragma section @@DATA ??DATA1
#include "b2.h"
// This does not result in an error since it is not file (b.c) in which
// the main C code is followed by this #pragma directive.
// ← Results in an error
// Since an #include statement cannot be coded afterward in file
// (b.c) in which the main C code is followed by this #pragma
// directive.
CODING ERROR EXAMPLE 3
c1.h
extern int j;
#pragma section @@DATA ??DATA1
c2.h
extern int k;
#pragma section @@DATA ??DATA2
c3.h
#include “c1.h”
extern int i;
#include “c2.h”
#pragma section @@DATA ??DATA3
c.c
#include “c3.h”
#pragma section @@DATA??DATA4
int i;
// This does not result in an error since the #pragma directive is
// included and processed before the processing of c3.h.
// ← Results in an error.
// This #include statement is specified after the main C code in
// c3.h, and the #pragma directive cannot be specified afterward.
// ← Results in an error.
// This #include statement is specified after the main C code, and
// the #pragma directive cannot be specified afterward.
// ← Results in an error.
// This #include statement is specified after the main C code in
// c3.h, and the #pragma directive cannot be specified afterward.
User’s Manual U14872EJ1V0UM
373