Traditional Mode - 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

Traditional (pre-standard) C preprocessing is rather different from the preprocessing specified by the
standard. When GCC is given the
cessor. We do not guarantee that GCC's behavior under
preprocessor exactly.
Traditional mode exists only for backward compatibility. We have no plans to augment it in any way
nor will we change it except to fix catastrophic bugs. You should be aware that modern C libraries
often have header files which are incompatible with traditional mode.
This is a list of the differences. It may not be complete, and may not correspond exactly to the behavior
of either GCC or a true traditional preprocessor.
Traditional macro expansion pays no attention to single-quote or double-quote characters; macro
argument symbols are replaced by the argument values even when they appear within apparent
string or character constants.
Traditionally, it is permissible for a macro expansion to end in the middle of a string or character
constant. The constant continues into the text surrounding the macro call.
However, the end of the line terminates a string or character constant, with no error. (This is a kluge.
Traditional mode is commonly used to preprocess things which are not C, and have a different
comment syntax. Single apostrophes often appear in comments. This kluge prevents the traditional
preprocessor from issuing errors on such comments.)
Preprocessing directives are recognized in traditional C only when their leading
first column. There can be no whitespace between the beginning of the line and the
In traditional C, a comment is equivalent to no text at all. (In ISO C, a comment counts as whites-
pace.) It can be used sort of the same way that
together.
Traditional C does not have the concept of a preprocessing number.
A macro is not suppressed within its own definition, in traditional C. Thus, any macro that is used
recursively inevitably causes an error.
The
and
operators are not available in traditional C.
#
##
In traditional C, the text at the end of a macro expansion can run together with the text after the
macro call, to produce a single token. This is impossible in ISO C.
None of the GNU extensions to the preprocessor are available in traditional mode, with the excep-
tion of a partial implementation of assertions, and those may be removed in the future.
A true traditional C preprocessor does not recognize
and
#elif
#error
Traditional mode is text-based, not token-based, and comments are stripped after macro expansion.
Therefore,
can be used to paste tokens together provided that there is no whitespace between
/**/
it and the tokens to be pasted.
Traditional mode preserves the amount and form of whitespace provided by the user. Hard tabs
remain hard tabs. This can be useful, e.g. if you are preprocessing a Makefile (which we do not
encourage).
You can request warnings about features that did not exist, or worked differently, in traditional C with
the
-Wtraditional
-traditional
even in traditional mode, but not
option. This works only if you do not specify

Traditional Mode

option, it attempts to emulate a traditional prepro-
-traditional
is used in ISO C, to paste macro arguments
##
,
#elif
#error
.
#pragma
-traditional
Chapter 10.
matches any pre-standard
appears in the
#
.
#
, or
. GCC supports
#pragma
. GCC does not

Advertisement

Table of Contents
loading

This manual is also suitable for:

Enterprise linux 3

Table of Contents