Microchip Technology SW006021-2 사용자 설명서
MPLAB
®
XC8 C Compiler User’s Guide
DS52053A-page 24
2012 Microchip Technology Inc.
2.4.15.1
EXAMPLE
The following shows a structure containing bit-fields being defined.
struct {
unsigned lo : 1;
unsigned mid :6;
unsigned hi : 1;
} foo;
The bit-field lo will be assigned the least significant bit of the storage unit assigned to
the structure foo. The bit-field mid will be assigned the next 6 least significant bits, and
hi
the structure foo. The bit-field mid will be assigned the next 6 least significant bits, and
hi
, the most significant bit of that same storage unit byte.
2.4.15.2
DIFFERENCES
This is identical with the previous operation of all compilers.
2.4.15.3
MIGRATION TO THE CCI
No action required.
2.4.16
The NULL macro
The NULL macro is defined in <stddef.h>; however, its definition is implementa-
tion-defined behavior. Under the CCI, the definition of NULL is the expression (0).
tion-defined behavior. Under the CCI, the definition of NULL is the expression (0).
2.4.16.1
EXAMPLE
The following shows a pointer being assigned a null pointer constant via the NULL
macro.
macro.
int * ip = NULL;
The value of NULL, (0), is implicitly cast to the destination type.
2.4.16.2
DIFFERENCES
The 32-bit compilers previously assigned NULL the expression ((void *)0).
2.4.16.3
MIGRATION TO THE CCI
No action required.
2.4.17
Floating-point sizes
Under the CCI, floating-point types must not be smaller than 32 bits in size.
2.4.17.1
EXAMPLE
The following shows the definition for outY, which will be at least 32-bit in size.
float outY;
2.4.17.2
DIFFERENCES
The 8-bit compilers have allowed the use of 24-bit float and double types.
2.4.17.3
MIGRATION TO THE CCI
When using 8-bit compilers, the float and double type will automatically be made
32 bits in size once the CCI mode is enabled. Review any source code that may have
assumed a float or double type and may have been 24 bits in size.
32 bits in size once the CCI mode is enabled. Review any source code that may have
assumed a float or double type and may have been 24 bits in size.
No migration is required for other compilers.