Pragmas - Red Hat ENTERPRISE LINUX 3 - USING CPP Using Instructions

Using cpp, the c preprocessor
Hide thumbs Also See for ENTERPRISE LINUX 3 - USING CPP:
Table of Contents

Advertisement

The
directive is the method specified by the C standard for providing additional information
#pragma
to the compiler, beyond what is conveyed in the language itself. Three forms of this directive (com-
monly known as pragmas) are specified by the 1999 C standard. A C compiler is free to attach any
meaning it likes to other pragmas.
GCC has historically preferred to use extensions to the syntax of the language, such as
, for this purpose. However, GCC does define a few pragmas of its own. These
__attribute__
mostly have effects on the entire translation unit or source file.
In GCC version 3, all GNU-defined, supported pragmas have been given a
with the
prefix on all pragmas defined by C99. For backward compatibility, pragmas which
STDC
were recognized by previous versions are still recognized without the
deprecated. Some older pragmas are deprecated in their entirety. They are not recognized with the
prefix. Refer to Section 11.3 Obsolete Features.
GCC
C99 introduces the
_Pragma
a directive, it cannot be produced as the result of macro expansion.
or
sizeof
defined
Its syntax is
_Pragma (
character string literal. It is destringized, by replacing all
The result is then processed as if it had appeared as the right hand side of a
example,
_Pragma ("GCC dependency \"parse.y\"")
has the same effect as
using macros, for example
#define DO_PRAGMA(x) _Pragma (#x)
DO_PRAGMA (GCC dependency "parse.y")
The standard is unclear on where a
it within a preprocessing conditional directive like
out of directives other than
This manual documents the pragmas which are meaningful to the preprocessor itself. Other pragmas
are meaningful to the C or C++ compilers. They are documented in the GCC manual.
#pragma GCC dependency
#pragma GCC dependency
file. If the other file is more recent than the current file, a warning is issued. This is useful if the
current file is derived from the other file, and should be regenerated. The other file is searched for
using the normal include search path. Optional trailing text can be used to give more information
in the warning message.
#pragma GCC dependency "parse.y"
#pragma GCC dependency "/usr/include/time.h" rerun fixincludes
operator. This feature addresses a major problem with
, and can be embedded in a macro.
)
string-literal
#pragma GCC dependency "parse.y"
_Pragma
, and putting it on a line of its own.
#define
allows you to check the relative dates of the current file and another
, where
string-literal
\\
operator can appear. The preprocessor does not accept
. To be safe, you are probably best keeping it
#if
Chapter 7.

Pragmas

prefix. This is in line
GCC
prefix, but that usage is
GCC
is an operator, much like
_Pragma
can be either a normal or wide-
with a single
and all
\
#pragma
. The same effect could be achieved
: being
#pragma
with a
.
\"
"
directive. For

Advertisement

Table of Contents
loading

This manual is also suitable for:

Enterprise linux 3

Table of Contents