diff options
author | Neil Booth <neil@daikokuya.demon.co.uk> | 2002-03-22 22:29:07 +0000 |
---|---|---|
committer | Neil Booth <neil@gcc.gnu.org> | 2002-03-22 22:29:07 +0000 |
commit | d4e6133f20c4395d16bf1ed7887f5223bd3c249b (patch) | |
tree | b7200ed8ce94b6f6fbb96d7a9bf0bea3ec37efdd /gcc/doc | |
parent | 65e6c00573077208af5011dd1bebe287ae1f2ade (diff) | |
download | gcc-d4e6133f20c4395d16bf1ed7887f5223bd3c249b.zip gcc-d4e6133f20c4395d16bf1ed7887f5223bd3c249b.tar.gz gcc-d4e6133f20c4395d16bf1ed7887f5223bd3c249b.tar.bz2 |
cpphash.h (struct cpp_reader): Remove mls_line and mls_col.
* cpphash.h (struct cpp_reader): Remove mls_line and mls_col.
* cpplex.c (unterminated): Delete.
(parse_string): No string literal may extend over multiple
lines. Suppress the error when preprocessing assembly.
* cppmain.c (scan_translation_unit): Strings are single-line.
* doc/cpp.texi: Update to match.
* testsuite/gcc.dg/cpp/multiline.c: Update to match.
From-SVN: r51195
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/cpp.texi | 51 |
1 files changed, 15 insertions, 36 deletions
diff --git a/gcc/doc/cpp.texi b/gcc/doc/cpp.texi index 3087e35..77745e7 100644 --- a/gcc/doc/cpp.texi +++ b/gcc/doc/cpp.texi @@ -402,26 +402,8 @@ extremely confusing and should not be used in code intended to be readable. There is no way to prevent a backslash at the end of a line from being -interpreted as a backslash-newline. - -@example -"foo\\ -bar" -@end example - -@noindent -is equivalent to @code{"foo\bar"}, not to @code{"foo\\bar"}. To avoid -having to worry about this, do not use the deprecated GNU extension -which permits multi-line strings. Instead, use string literal -concatenation: - -@example - "foo\\" - "bar" -@end example - -@noindent -Your program will be more portable this way, too. +interpreted as a backslash-newline. This cannot affect any correct +program, however. @node Tokenization @section Tokenization @@ -536,11 +518,10 @@ closing quote or angle bracket. The preprocessor looks for the header file in different places depending on which form you use. @xref{Include Operation}. -In standard C, no string literal may extend past the end of a line. GNU -CPP accepts multi-line string constants, but not multi-line character -constants or header file names. This extension is deprecated and will -be removed in GCC 3.1. You may use continued lines instead, or string -constant concatenation. @xref{Differences from previous versions}. +No string literal may extend past the end of a line. Older versions +of GCC accepted multi-line string constants. You may use continued +lines instead, or string constant concatenation. @xref{Differences +from previous versions}. @cindex punctuators @cindex digraphs @@ -796,10 +777,10 @@ those are merely the typical uses. Any fragment of a C program can be included from another file. The include file could even contain the beginning of a statement that is concluded in the containing file, or the end of a statement that was started in the including file. However, -a comment or a string or character constant may not start in the -included file and finish in the including file. An unterminated -comment, string constant or character constant in an included file is -considered to end (with an error message) at the end of the file. +an included file must consist of complete tokens. Comments and string +literals which have not been closed by the end of an included file are +invalid. For error recovery, they are considered to end at the end of +the file. To avoid confusion, it is best if header files contain only complete syntactic units---function declarations or definitions, type @@ -3785,13 +3766,11 @@ This is the same as @code{#pragma GCC poison}. The version without the @cindex multi-line string constants @item 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 @samp{#define}. - -Instead, make use of ISO C concatenation of adjacent string literals, or -use @samp{\n} followed by a backslash-newline. +Older versions of GCC allowed string constants to extend across +multiple logical lines of the source file. This ill-considered +extension has now been removed. Instead, make use of ISO C +concatenation of adjacent string literals, or use @samp{\n} followed +by a backslash-newline. @end itemize |