Miscellaneous Obsolete Features; Differences From Previous Versions - 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

54
is not a well designed feature. It requires the users of a header file to know that it should
#import
only be included once. It is much better for the header file's implementor to write the file so that users
don't need to know this. Using a wrapper
In the present implementation, a single use of
again, by either
#import
to refer to the same header file.
#include
Another way to prevent a header file from being included more than once is with the
directive. If
#pragma once
matter what.
does not have the problems that
#pragma once
processors, so you cannot rely on it in a portable program.

11.3.3. Miscellaneous obsolete features

Here are a few more obsolete features.
Attempting to paste two tokens which together do not form a valid preprocessing token.
The preprocessor currently warns about this, and the resulting preprocessed output is undefined.
The tokens remain distinct if the preprocessor is being used directly by the compiler front end.
Most of the time, when you get this warning, you will find that
guard against whitespace appearing between two tokens. It is almost always safe to delete the
#pragma poison
This is the same as
Refer to Chapter 7 Pragmas.
Multi-line string constants
GCC currently allows a string constant to extend across multiple logical lines of the source file.
This extension is deprecated and will be removed in a future version of GCC. Such string constants
are already rejected in all directives apart from
Instead, make use of ISO C concatenation of adjacent string literals, or use
backslash-newline.

11.4. Differences from previous versions

This section details behavior which has changed from previous versions of GNU CPP. We do not plan
to change it again in the near future, but we do not promise not to, either.
The "previous versions" discussed here are 2.95 and before. The behavior of GCC 3.0 is mostly
the same as the behavior of the widely used 2.96 and 2.97 development snapshots. Where there are
differences, they generally represent bugs in the snapshots.
Order of evaluation of
The standard does not specify the order of evaluation of a chain of
evaluated before, after, or at the same time as
depends on any specific ordering. It is possible to guarantee an ordering, if you need one, by suitable
use of nested macros.
An example of where this might matter is pasting the arguments
for left-to-right pasting, but right-to-left pasting would produce an invalid token
#ifndef
or
. You should not rely on this; do not use both
#include
is seen when scanning a header file, that file will never be read again, no
#pragma GCC poison
and
operators
#
##
Chapter 11. Implementation Details
accomplishes this goal.
will prevent the file from ever being read
#import
does, but it is not recognized by all pre-
#import
##
. The version without the
.
#define
. You should therefore not write any code which
##
#import
#pragma once
is being used superstitiously, to
prefix is deprecated.
GCC
followed by a
\n
operators, nor whether
##
,
and
. This would be fine
1
e
-2
.
e-2
and
.
##
is
#

Advertisement

Table of Contents
loading

This manual is also suitable for:

Enterprise linux 3

Table of Contents