strictheaderchecking. NXP CodeWarrior Development Studio
Reklamë
Reklamë
strictheaderchecking
35.19 pack
Stores data to reduce data size instead of improving execution performance.
Syntax
#pragma pack()
#pragma pack(0 |
n | push | pop) n
One of these integer values: 1, 2, 4, 8, or 16.
Remarks
Use this pragma to align data to use less storage even if the alignment might affect program performance or does not conform to the target platform's application binary interface (ABI).
If this pragma's argument is a power of 2 from 1 to 16, the compiler will store subsequent data structures to this byte alignment.
The push
argument saves this pragma's setting on a stack at compile time. The pop argument restores the previously saved setting and removes it from the stack. Using this pragma with no argument or with 0 as an argument specifies that the compiler will use
ABI-conformant alignment.
Not all processors support misaligned accesses, which could cause a crash or incorrect results. Even on processors which allow misaligned access, your program's performance might be reduced. Your program may have better performance if it treats the packed structure as a byte stream, then packs and unpacks each byte from the stream.
NOTE
Pragma pack
is implemented somewhat differently by most compiler vendors, especially when used with bitfields. If you need portability, you are probably better off using explicit shift and mask operations in your program instead of bitfields.
35.20 strictheaderchecking
Controls how strict the compiler checks headers for standard C library functions.
CodeWarrior Development Studio for Power Architecture Processors Build Tools Reference Manual, Rev.
10.6, 02/2014
522 Freescale Semiconductor, Inc.
Chapter 35 Pragmas for Optimization
Syntax
#pragma strictheaderchecking on | off | reset
Remarks
The 3.2 version compiler recognizes standard C library functions. If the correct prototype is used, and, in C++, if the function appears in the " std
" or root namespace, the compiler recognizes the function, and is able to optimize calls to it based on its documented effects.
When this #pragma is on (default), in addition to having the correct prototype, the declaration must also appear in the proper standard header file (and not in a user header or source file).
This pragma does not correspond to any panel setting. By default, this pragma is on.
CodeWarrior Development Studio for Power Architecture Processors Build Tools Reference Manual, Rev.
10.6, 02/2014
Freescale Semiconductor, Inc.
523
strictheaderchecking
CodeWarrior Development Studio for Power Architecture Processors Build Tools Reference Manual, Rev.
10.6, 02/2014
524 Freescale Semiconductor, Inc.
Shkarko
Reklamë