## Pragma Syntax

Most pragmas have this syntax:

#pragma setting-name on | off | reset

##### Parameters

off

> Enables the pragma for any functions that follow.

on

> Disables the pragma for any functions that follow.

reset

> Restores the pragma to its original setting.

An exampe of this is shown below:

#pragma profile off

// If the Generate Profiler Calls setting is on, turns it off for these functions.

#include <smallfuncs.h>

#pragma profile reset

// If the Generate Profiler Calls setting was originally on, turns it back on.
// Otherwise, the setting remains off

Suppose that you use #pragma profile on instead of #pragma profile reset. If you later disable Generate Profiler Calls from the Preference dialog box, that pragma turns it on. Using reset ensures that you do not inadvertently change the settings in the Project Settings dialog box.

TIP To catch pragmas that the Carbide x86 compiler does not recognize, use the pragma warn_illpragma. See also Illegal Pragmas.

NOTE The default setting of a pragma is based on the command-line default setting. These default settings used in project stationery may differ across target devices when creating a specific project. For example, a pragma for an x86 target may default to off while the same setting for an ARM target may default to on.