English
Language : 

CC78K0S Datasheet, PDF (185/520 Pages) NEC – C Compiler Ver.1.30 or Later Language
CHAPTER 10 LIBRARY FUNCTIONS
(13) assert.h (normal model only)
Table 10-11. Contents of assert.h
Existence of -ZI, or -ZL
Normal Model
Specification None
ZI
ZL
ZI
Function Name
ZL
_ _assertfail
√
√
√
√
√: Supported
assert.h defines the following objects.
#ifdef NDEBUG
#define assert(p) ((void)0)
#else
extern int _ _assertfail(char*_ _msg, char*_ _cond, char*_ _file, int_ _line);
#define assert(p) ((p) ? (void)0 : (void)_ _assertfail( \
"Assertion failed: %s, file %s, line %d\n", #p, _ _FILE_ _, _ _LINE_ _))
#endif /* NDEBUG */
However, if the assert.h header file references another macro, NDEBUG, which is not defined by the assert.h
header file, and if NDEBUG is defined as a macro when the assert.h is captured to the source file, the assert.h
header file simply declares the assert macro as:
#define assert(p) ((void)0)
and does not define _ _ assertfail.
10.3 Re-entrantability (Normal Model Only)
Re-entrant is a state where a function called from a program can be consecutively called from another program.
The standard library of this compiler does not use static area allowing re-entrantability. Therefore, data in the
storage area used by functions will not be destroyed by a call from another program.
However, the functions shown in (1) to (3) are not re-entrant.
(1) Functions that cannot be re-entranced
setjmp, longjmp, atexit, exit
(2) Functions that use the area secured in the startup routine
div, ldiv, brk, sbrk, rand, srand, strtok
(3) Functions that deal with floating-point numbers
sprintf, sscanf, printf, scanf, vprintf, vsprintfNote, atof, strtod, all the mathematical functions
Note Among sprintf, sscanf, printf, scanf, vprintf, and vsprintf, functions that do not support floating-point
numbers are re-entrant.
User’s Manual U14872EJ1V0UM
185