Checking Pragma Settings. NXP CodeWarrior Development Studio
বিজ্ঞাপন
বিজ্ঞাপন
Chapter 27
Using Pragmas
The #pragma preprocessor directive specifies option settings to the compiler to control the compiler and linker's code generation.
•
•
Saving and Restoring Pragma Settings
•
Determining Which Settings Are Saved and Restored
•
•
27.1 Checking Pragma Settings
The preprocessor function
__option()
returns the state of pragma settings at compile-time.
The syntax is
__option(
setting-name ) where setting-name is the name of a pragma that accepts the on
, off
, and reset arguments.
If setting-name is on
,
__option(
setting-name
)
returns 1. If setting-name is off
,
__option(
setting-name
)
returns 0. If setting-name is not the name of a pragma,
__option(
setting-name
)
returns false. If setting-name is the name of a pragma that does not accept the on
, off
, and reset
arguments, the compiler issues a warning message.
shows an example.
Listing 27-1. Using the __option() preprocessor function
#if __option(ANSI_strict)
#include "portable.h" /* Use the portable declarations. */
#else
CodeWarrior Development Studio for Advanced Packet Processing Build Tools Reference Manual, Rev.
10.2, 01/2016
Freescale Semiconductor, Inc.
433
ডাউনলোড
বিজ্ঞাপন