diff options
author | Zack Weinberg <zack@codesourcery.com> | 2002-02-27 18:48:07 +0000 |
---|---|---|
committer | Zack Weinberg <zack@gcc.gnu.org> | 2002-02-27 18:48:07 +0000 |
commit | f458d1d5d7bd85e412689858ea5d5de681608fbb (patch) | |
tree | aff434354f9eafe5065d231d996385e95f0669b4 /gcc/doc | |
parent | e0b3a8ff40c97c0b633185e6d0872468504a7a1a (diff) | |
download | gcc-f458d1d5d7bd85e412689858ea5d5de681608fbb.zip gcc-f458d1d5d7bd85e412689858ea5d5de681608fbb.tar.gz gcc-f458d1d5d7bd85e412689858ea5d5de681608fbb.tar.bz2 |
c-common.c, [...]: Delete code implementing -traditional mode.
* c-common.c, c-common.h, c-decl.c, c-lex.c, c-parse.in,
c-tree.h, c-typeck.c, cppexp.c, cpplex.c, cpplib.c, cpplib.h,
cppmacro.c, objc/lang-specs.h, objc/objc-act.c,
builtin-types.def, builtins.def, dwarf2out.c, dwarfout.c,
gcc.c, toplev.c: Delete code implementing -traditional mode.
* ada/misc.c, ch/ch-tree.h, ch/decl.c, cp/decl2.c, f/com.c,
f/lex.c, f/top.c, java/builtins.c, java/decl.c: Delete
traditional-mode-related code copied from the C front end
but not used, or used only to permit the compiler to link.
* doc/bugreport.texi, doc/cpp.texi, doc/extend.texi,
doc/invoke.texi, doc/standards.texi, doc/trouble.texi:
Document removal of -traditional mode for compilation, and
remove documentation only relevant to that mode.
* config/nextstep.h, config/ptx4.h, config/svr4.h,
config/convex/convex.h, config/d30v/d30v.h,
config/i386/dgux.h, config/i386/osf1elf.h,
config/i386/osfelf.h, config/i386/osfrose.h,
config/i386/sco5.h, config/i386/sol2.h, config/m68k/a-ux.h,
config/m68k/hp310.h, config/m88k/dgux.h,
config/m88k/dguxbcs.h, config/m88k/luna.h, config/m88k/m88k.c,
config/m88k/m88k.h, config/m88k/openbsd.h,
config/mips/abi64.h, config/mips/osfrose.h,
config/mips/svr4-5.h, config/mips/svr4-t.h,
config/sparc/sol2-sld-64.h, config/sparc/sol2.h,
config/stormy16/stormy16.h: Remove all references to
-traditional from target specs. Delete all mention of the
no-longer-necessary TRADITIONAL_RETURN_FLOAT macro. Also
delete a couple of commented-out definitions of
DOLLARS_IN_IDENTIFIERS, with (incorrect) commentary referring
to -traditional.
* system.h: Poison TRADITIONAL_RETURN_FLOAT.
* doc/tm.texi: Remove mention of TRADITIONAL_RETURN_FLOAT macro.
* testsuite/gcc.c-torture/execute/920730-1t.c,
testsuite/gcc.c-torture/execute/920730-1t.x,
testsuite/gcc.dg/ext-glob.c: Delete test cases, only relevant
to -traditional.
From-SVN: r50110
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/bugreport.texi | 10 | ||||
-rw-r--r-- | gcc/doc/cpp.texi | 8 | ||||
-rw-r--r-- | gcc/doc/extend.texi | 32 | ||||
-rw-r--r-- | gcc/doc/invoke.texi | 93 | ||||
-rw-r--r-- | gcc/doc/standards.texi | 7 | ||||
-rw-r--r-- | gcc/doc/tm.texi | 5 | ||||
-rw-r--r-- | gcc/doc/trouble.texi | 57 |
7 files changed, 44 insertions, 168 deletions
diff --git a/gcc/doc/bugreport.texi b/gcc/doc/bugreport.texi index 1ac26c5..b6e5ef1 100644 --- a/gcc/doc/bugreport.texi +++ b/gcc/doc/bugreport.texi @@ -64,13 +64,9 @@ prevent the assembler from being run. If the compiler produces valid assembly code that does not correctly execute the input source code, that is a compiler bug. -However, you must double-check to make sure, because you may have run -into an incompatibility between GNU C and traditional C -(@pxref{Incompatibilities}). These incompatibilities might be considered -bugs, but they are inescapable consequences of valuable features. - -Or you may have a program whose behavior is undefined, which happened -by chance to give the desired results with another C or C++ compiler. +However, you must double-check to make sure, because you may have a +program whose behavior is undefined, which happened by chance to give +the desired results with another C or C++ compiler. For example, in many nonoptimizing compilers, you can write @samp{x;} at the end of a function instead of @samp{return x;}, with the same diff --git a/gcc/doc/cpp.texi b/gcc/doc/cpp.texi index 9e28e92..5e11ff8 100644 --- a/gcc/doc/cpp.texi +++ b/gcc/doc/cpp.texi @@ -3343,8 +3343,8 @@ preprocessor. We do not guarantee that GCC's behavior under 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. +catastrophic bugs. As of GCC 3.2, traditional mode is not supported for +compilation, only preprocessing. 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 @@ -4351,8 +4351,8 @@ Define the macros @sc{__gnuc__}, @sc{__gnuc_minor__} and @option{-no-gcc}. @item -traditional -Try to imitate the behavior of old-fashioned C, as opposed to ISO -C@. @xref{Traditional Mode}. +Try to imitate the behavior of the old-fashioned C preprocessor, as +opposed to the behavior specified by ISO C@. @xref{Traditional Mode}. @item -trigraphs Process trigraph sequences. @xref{Initial processing}. diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index f9870e7..96db4ad 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -1453,8 +1453,8 @@ argument, these arguments are not macro expanded. @cindex escaped newlines @cindex newlines (escaped) -Recently, the non-traditional preprocessor has relaxed its treatment of -escaped newlines. Previously, the newline had to immediately follow a +Recently, the preprocessor has relaxed its treatment of escaped +newlines. Previously, the newline had to immediately follow a backslash. The current implementation allows whitespace in the form of spaces, horizontal and vertical tabs, and form feeds between the backslash and the subsequent newline. The preprocessor issues a @@ -2732,11 +2732,10 @@ extension is irrelevant. In GNU C, you may use C++ style comments, which start with @samp{//} and continue until the end of the line. Many other C implementations allow -such comments, and they are likely to be in a future C standard. -However, C++ style comments are not recognized if you specify -@w{@option{-ansi}}, a @option{-std} option specifying a version of ISO C -before C99, or @w{@option{-traditional}}, since they are incompatible -with traditional constructs like @code{dividend//*comment*/divisor}. +such comments, and they are included in the 1999 C standard. However, +C++ style comments are not recognized if you specify an @option{-std} +option specifying a version of ISO C before C99, or @option{-ansi} +(equivalent to @option{-std=c89}). @node Dollar Signs @section Dollar Signs in Identifier Names @@ -4055,25 +4054,20 @@ be deleted or moved or simplified. @cindex alternate keywords @cindex keywords, alternate -The option @option{-traditional} disables certain keywords; @option{-ansi} and the various @option{-std} options disable certain -others. This causes trouble when you want to use GNU C extensions, or -ISO C features, in a general-purpose header file that should be usable -by all programs, including ISO C programs and traditional ones. The -keywords @code{asm}, @code{typeof} and @code{inline} cannot be used -since they won't work in a program compiled with @option{-ansi} -(although @code{inline} can be used in a program compiled with -@option{-std=c99}), while the keywords @code{const}, @code{volatile}, -@code{signed}, @code{typeof} and @code{inline} won't work in a program -compiled with @option{-traditional}. The ISO C99 keyword +keywords. This causes trouble when you want to use GNU C extensions, or +a general-purpose header file that should be usable by all programs, +including ISO C programs. The keywords @code{asm}, @code{typeof} and +@code{inline} are not available in programs compiled with +@option{-ansi} or @option{-std} (although @code{inline} can be used in a +program compiled with @option{-std=c99}). The ISO C99 keyword @code{restrict} is only available when @option{-std=gnu99} (which will eventually be the default) or @option{-std=c99} (or the equivalent @option{-std=iso9899:1999}) is used. The way to solve these problems is to put @samp{__} at the beginning and end of each problematical keyword. For example, use @code{__asm__} -instead of @code{asm}, @code{__const__} instead of @code{const}, and -@code{__inline__} instead of @code{inline}. +instead of @code{asm}, and @code{__inline__} instead of @code{inline}. Other C compilers won't accept these alternative keywords; if you want to compile with another compiler, you can define the alternate keywords as diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 760c195..90df7de 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -1144,75 +1144,13 @@ options for strict ISO C conformance) implies @option{-trigraphs}. @cindex traditional C language @cindex C language, traditional @item -traditional -@opindex traditional -Attempt to support some aspects of traditional C compilers. -Specifically: - -@itemize @bullet -@item -All @code{extern} declarations take effect globally even if they -are written inside of a function definition. This includes implicit -declarations of functions. - -@item -The newer keywords @code{typeof}, @code{inline}, @code{signed}, @code{const} -and @code{volatile} are not recognized. (You can still use the -alternative keywords such as @code{__typeof__}, @code{__inline__}, and -so on.) - -@item -Comparisons between pointers and integers are always allowed. - -@item -Integer types @code{unsigned short} and @code{unsigned char} promote -to @code{unsigned int}. - -@item -Out-of-range floating point literals are not an error. - -@item -Certain constructs which ISO regards as a single invalid preprocessing -number, such as @samp{0xe-0xd}, are treated as expressions instead. - -@item -String ``constants'' are not necessarily constant; they are stored in -writable space, and identical looking constants are allocated -separately. (This is the same as the effect of -@option{-fwritable-strings}.) - -@cindex @code{longjmp} and automatic variables -@item -All automatic variables not declared @code{register} are preserved by -@code{longjmp}. Ordinarily, GNU C follows ISO C: automatic variables -not declared @code{volatile} may be clobbered. - -@item -@cindex @samp{\x} -@cindex @samp{\a} -@cindex escape sequences, traditional -The character escape sequences @samp{\x} and @samp{\a} evaluate as the -literal characters @samp{x} and @samp{a} respectively. Without -@w{@option{-traditional}}, @samp{\x} is a prefix for the hexadecimal -representation of a character, and @samp{\a} produces a bell. -@end itemize - -This option is deprecated and may be removed. - -You may wish to use @option{-fno-builtin} as well as @option{-traditional} -if your program uses names that are normally GNU C built-in functions for -other purposes of its own. - -You cannot use @option{-traditional} if you include any header files that -rely on ISO C features. Some vendors are starting to ship systems with -ISO C header files and you cannot use @option{-traditional} on such -systems to compile files that include any system headers. - -The @option{-traditional} option also enables @option{-traditional-cpp}. - -@item -traditional-cpp +@itemx -traditional-cpp @opindex traditional-cpp -Attempt to support some aspects of traditional C preprocessors. -See the GNU CPP manual for details. +@opindex traditional +Formerly, these options caused GCC to attempt to emulate a pre-standard +C compiler. They are now only supported with the @option{-E} switch. +The preprocessor continues to support a pre-standard mode. See the GNU +CPP manual for details. @item -fcond-mismatch @opindex fcond-mismatch @@ -1260,32 +1198,15 @@ declaration does not use either @code{signed} or @code{unsigned}. By default, such a bit-field is signed, because this is consistent: the basic integer types such as @code{int} are signed types. -However, when @option{-traditional} is used, bit-fields are all unsigned -no matter what. - @item -fwritable-strings @opindex fwritable-strings Store string constants in the writable data segment and don't uniquize them. This is for compatibility with old programs which assume they can -write into string constants. The option @option{-traditional} also has -this effect. +write into string constants. Writing into string constants is a very bad idea; ``constants'' should be constant. -@item -fallow-single-precision -@opindex fallow-single-precision -Do not promote single precision math operations to double precision, -even when compiling with @option{-traditional}. - -Traditional K&R C promotes all floating point operations to double -precision, regardless of the sizes of the operands. On the -architecture for which you are compiling, single precision may be faster -than double precision. If you must use @option{-traditional}, but want -to use single precision operations when the operands are single -precision, use this option. This option has no effect when compiling -with ISO or GNU C conventions (the default). - @item -fshort-wchar @opindex fshort-wchar Override the underlying type for @samp{wchar_t} to be @samp{short diff --git a/gcc/doc/standards.texi b/gcc/doc/standards.texi index eead5c2..4e9720c 100644 --- a/gcc/doc/standards.texi +++ b/gcc/doc/standards.texi @@ -89,13 +89,6 @@ Errors in the 1999 ISO C standard were corrected in a Technical Corrigendum published in 2001. GCC does not support the uncorrected version. -@opindex traditional -GCC also has some limited support for traditional (pre-ISO) C with the -@option{-traditional} option. This support may be of use for compiling -some very old programs that have not been updated to ISO C, but should -not be used for new programs. It will not work with some modern C -libraries such as the GNU C library. - By default, GCC provides some extensions to the C language that on rare occasions conflict with the C standard. @xref{C Extensions,,Extensions to the C Language Family}. Use of the diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index edee7e3..0a9e842 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -3560,11 +3560,6 @@ This section discusses the macros that control returning scalars as values---values that can fit in registers. @table @code -@findex TRADITIONAL_RETURN_FLOAT -@item TRADITIONAL_RETURN_FLOAT -Define this macro if @option{-traditional} should not cause functions -declared to return @code{float} to convert the value to @code{double}. - @findex FUNCTION_VALUE @item FUNCTION_VALUE (@var{valtype}, @var{func}) A C expression to create an RTX representing the place where a diff --git a/gcc/doc/trouble.texi b/gcc/doc/trouble.texi index 09026fe5..7cc7e8a 100644 --- a/gcc/doc/trouble.texi +++ b/gcc/doc/trouble.texi @@ -443,8 +443,7 @@ Parse errors may occur compiling X11 on a Decstation running Ultrix 4.2 because of problems in DEC's versions of the X11 header files @file{X11/Xlib.h} and @file{X11/Xutil.h}. People recommend adding @option{-I/usr/include/mit} to use the MIT versions of the header files, -using the @option{-traditional} switch to turn off ISO C, or fixing the -header files by adding this: +or fixing the header files by adding this: @example #ifdef __STDC__ @@ -484,9 +483,7 @@ MALLOC=gmalloc.o @opindex traditional There are several noteworthy incompatibilities between GNU C and K&R -(non-ISO) versions of C@. The @option{-traditional} option -eliminates many of these incompatibilities, @emph{but not all}, by -telling GCC to behave like a K&R C compiler. +(non-ISO) versions of C@. @itemize @bullet @cindex string constants @@ -516,7 +513,6 @@ The best solution to these problems is to change the program to use purposes instead of string constants. But if this is not possible, you can use the @option{-fwritable-strings} flag, which directs GCC to handle string constants the same way most C compilers do. -@option{-traditional} also has this effect, among others. @item @code{-2147483648} is positive. @@ -536,9 +532,6 @@ string constants. For example, the following macro in GCC @noindent will produce output @code{"a"} regardless of what the argument @var{a} is. -The @option{-traditional} option directs GCC to handle such cases -(among others) in the old-fashioned (non-ISO) fashion. - @cindex @code{setjmp} incompatibilities @cindex @code{longjmp} incompatibilities @item @@ -573,11 +566,6 @@ in it. If you use the @option{-W} option with the @option{-O} option, you will get a warning when GCC thinks such a problem might be possible. -The @option{-traditional} option directs GCC to put variables in -the stack by default, rather than in registers, in functions that -call @code{setjmp}. This results in the behavior found in -traditional C compilers. - @item Programs that use preprocessing directives in the middle of macro arguments do not work with GCC@. For example, a program like this @@ -591,9 +579,7 @@ foobar ( @end group @end example -ISO C does not permit such a construct. It would make sense to support -it when @option{-traditional} is used, but it is too much work to -implement. +ISO C does not permit such a construct. @item K&R compilers allow comments to cross over an inclusion boundary @@ -611,9 +597,6 @@ have the same scope as any other declaration in the same place. In some other C compilers, a @code{extern} declaration affects all the rest of the file even if it happens within a block. -The @option{-traditional} option directs GCC to treat all @code{extern} -declarations as global, like traditional compilers. - @item In traditional C, you can combine @code{long}, etc., with a typedef name, as shown here: @@ -624,18 +607,15 @@ typedef long foo bar; @end example In ISO C, this is not allowed: @code{long} and other type modifiers -require an explicit @code{int}. Because this criterion is expressed -by Bison grammar rules rather than C code, the @option{-traditional} -flag cannot alter it. +require an explicit @code{int}. @cindex typedef names as function parameters @item -PCC allows typedef names to be used as function parameters. The -difficulty described immediately above applies here too. +PCC allows typedef names to be used as function parameters. @item -When in @option{-traditional} mode, GCC allows the following erroneous -pair of declarations to appear together in a given scope: +Traditional C allows the following erroneous pair of declarations to +appear together in a given scope: @example typedef int foo; @@ -643,19 +623,18 @@ typedef foo foo; @end example @item -GCC treats all characters of identifiers as significant, even when in -@option{-traditional} mode. According to K&R-1 (2.2), ``No more than the -first eight characters are significant, although more may be used.''. -Also according to K&R-1 (2.2), ``An identifier is a sequence of letters -and digits; the first character must be a letter. The underscore _ -counts as a letter.'', but GCC also allows dollar signs in identifiers. +GCC treats all characters of identifiers as significant. According to +K&R-1 (2.2), ``No more than the first eight characters are significant, +although more may be used.''. Also according to K&R-1 (2.2), ``An +identifier is a sequence of letters and digits; the first character must +be a letter. The underscore _ counts as a letter.'', but GCC also +allows dollar signs in identifiers. @cindex whitespace @item PCC allows whitespace in the middle of compound assignment operators such as @samp{+=}. GCC, following the ISO standard, does not -allow this. The difficulty described immediately above applies here -too. +allow this. @cindex apostrophes @cindex ' @@ -673,8 +652,7 @@ You can't expect this to work. @end example The best solution to such a problem is to put the text into an actual -C comment delimited by @samp{/*@dots{}*/}. However, -@option{-traditional} suppresses these error messages. +C comment delimited by @samp{/*@dots{}*/}. @item Many user programs contain the declaration @samp{long time ();}. In the @@ -1296,12 +1274,11 @@ they write programs which have the same meaning in both C dialects.) @item @opindex ansi -@opindex traditional @opindex std Undefining @code{__STDC__} when @option{-ansi} is not used. -Currently, GCC defines @code{__STDC__} as long as you don't use -@option{-traditional}. This provides good results in practice. +Currently, GCC defines @code{__STDC__} unconditionally. This provides +good results in practice. Programmers normally use conditionals on @code{__STDC__} to ask whether it is safe to use certain features of ISO C, such as function |