diff options
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/cpplib.c | 5 | ||||
-rw-r--r-- | gcc/cppmacro.c | 4 | ||||
-rw-r--r-- | gcc/doc/cpp.texi | 37 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/cpp/20000625-2.c | 30 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/cpp/direct2s.c | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/cpp/poison.c | 12 |
8 files changed, 23 insertions, 84 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bb9bed7..2a492d2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2002-05-09 Neil Booth <neil@daikokuya.demon.co.uk> + + * cpplib.c (cpp_init_internal_pragmas): Remove #pragma poison. + * cppmacro.c (paste_all_tokens): Bad pastes are a hard error. +doc: + * cpp.texi: Update for removal of obsolete features. + Thu May 9 07:46:18 2002 Jan Hubicka <jh@suse.cz> Jeffrey A Law (law@redhat.com) diff --git a/gcc/cpplib.c b/gcc/cpplib.c index c90224c..2773ed9 100644 --- a/gcc/cpplib.c +++ b/gcc/cpplib.c @@ -1049,7 +1049,6 @@ _cpp_init_internal_pragmas (pfile) cpp_reader *pfile; { /* Pragmas in the global namespace. */ - cpp_register_pragma (pfile, 0, "poison", do_pragma_poison); cpp_register_pragma (pfile, 0, "once", do_pragma_once); /* New GCC-specific pragmas should be put in the GCC namespace. */ @@ -1122,8 +1121,8 @@ do_pragma_once (pfile) check_eol (pfile); } -/* Handle #pragma poison, to poison one or more identifiers so that - the lexer produces a hard error for each subsequent usage. */ +/* Handle #pragma GCC poison, to poison one or more identifiers so + that the lexer produces a hard error for each subsequent usage. */ static void do_pragma_poison (pfile) cpp_reader *pfile; diff --git a/gcc/cppmacro.c b/gcc/cppmacro.c index 876506b..b985995 100644 --- a/gcc/cppmacro.c +++ b/gcc/cppmacro.c @@ -435,9 +435,9 @@ paste_all_tokens (pfile, lhs) { _cpp_backup_tokens (pfile, 1); - /* Mandatory warning for all apart from assembler. */ + /* Mandatory error for all apart from assembler. */ if (CPP_OPTION (pfile, lang) != CLK_ASM) - cpp_error (pfile, DL_WARNING, + cpp_error (pfile, DL_ERROR, "pasting \"%s\" and \"%s\" does not give a valid preprocessing token", cpp_token_as_text (pfile, lhs), cpp_token_as_text (pfile, rhs)); diff --git a/gcc/doc/cpp.texi b/gcc/doc/cpp.texi index 1941753..a7f3cd2 100644 --- a/gcc/doc/cpp.texi +++ b/gcc/doc/cpp.texi @@ -176,7 +176,6 @@ Obsolete Features * Assertions:: * Obsolete once-only headers:: -* Miscellaneous obsolete features:: @end detailmenu @end menu @@ -3625,7 +3624,6 @@ In some cases, we plan to remove the feature in a future version of GCC@. @menu * Assertions:: * Obsolete once-only headers:: -* Miscellaneous obsolete features:: @end menu @node Assertions @@ -3748,41 +3746,6 @@ matter what. but it is not recognized by all preprocessors, so you cannot rely on it in a portable program. -@node Miscellaneous obsolete features -@subsection Miscellaneous obsolete features - -Here are a few more obsolete features. - -@itemize @bullet -@cindex invalid token paste -@item Attempting to paste two tokens which together do not form a valid -preprocessing token. - -The preprocessor currently warns about this and outputs the two tokens -adjacently, which is probably the behavior the programmer intends. It -may not work in future, though. - -Most of the time, when you get this warning, you will find that @samp{##} -is being used superstitiously, to guard against whitespace appearing -between two tokens. It is almost always safe to delete the @samp{##}. - -@cindex pragma poison -@item @code{#pragma poison} - -This is the same as @code{#pragma GCC poison}. The version without the -@code{GCC} prefix is deprecated. @xref{Pragmas}. - -@cindex multi-line string constants -@item Multi-line string constants - -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 - @node Differences from previous versions @section Differences from previous versions @cindex differences from previous versions diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5e060c4..363389a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2002-05-09 Neil Booth <neil@daikokuya.demon.co.uk> + + * gcc.dg/cpp/poison.c: Update. + * gcc.dg/cpp/20000625-2.c: Remove. + * gcc.dg/cpp/direct2s.c: Remove final test. + 2002-05-08 Tom Rix <trix@redhat.com> * gcc.c-torture/execute/20020508-1.c: New test. diff --git a/gcc/testsuite/gcc.dg/cpp/20000625-2.c b/gcc/testsuite/gcc.dg/cpp/20000625-2.c deleted file mode 100644 index 72e2604..0000000 --- a/gcc/testsuite/gcc.dg/cpp/20000625-2.c +++ /dev/null @@ -1,30 +0,0 @@ -/* More paste corner cases from glibc. */ -/* { dg-do run } */ - -#include <stdlib.h> -#include <string.h> - -#define symbol_version(name, version) name##@##version -#define str(x) xstr(x) -#define xstr(x) #x - -/* This testcase is bogus, as it testing undefined behaviour. We can - get the behaviour GLIBC desires by removing the space before - GCLIB_2.0 in this line. */ -const char a[] = str(symbol_version(getrlimit,GLIBC_2.0)); -/* { dg-warning "valid preprocessing token" "" { target *-*-* } 14 } */ -const char b[] = str(getrlimit@GLIBC_2.0); -const char c[] = "getrlimit@GLIBC_2.0"; - -int -main(void) -{ - if(strcmp(a, b)) - abort(); - if(strcmp(b, c)) - abort(); - if(strcmp(c, a)) - abort(); - - return 0; -} diff --git a/gcc/testsuite/gcc.dg/cpp/direct2s.c b/gcc/testsuite/gcc.dg/cpp/direct2s.c index 6c98ecc..4d970a6 100644 --- a/gcc/testsuite/gcc.dg/cpp/direct2s.c +++ b/gcc/testsuite/gcc.dg/cpp/direct2s.c @@ -31,9 +31,3 @@ void f () int i = X; /* { dg-error "undeclared|for each" "no macro X" } */ int j = Y; /* { dg-error "undeclared|for each" "no macro Y" } */ } - -#define slashstar /##* -#define starslash *##/ - -slashstar starslash /* { dg-error "parse error" "not a comment" } */ -/* { dg-warning "does not give" "paste warning(s)" { target *-*-* } 38 } */ diff --git a/gcc/testsuite/gcc.dg/cpp/poison.c b/gcc/testsuite/gcc.dg/cpp/poison.c index fd3f536..d667183 100644 --- a/gcc/testsuite/gcc.dg/cpp/poison.c +++ b/gcc/testsuite/gcc.dg/cpp/poison.c @@ -1,17 +1,17 @@ /* { dg-do preprocess } { dg-options "-fno-show-column" } */ -#pragma poison foo +#pragma GCC poison foo foo /* { dg-error "foo" "use of foo" } */ -#pragma poison foo2 foo3 +#pragma GCC poison foo2 foo3 foo2 /* { dg-error "foo2" "use of foo2" } */ foo3 /* { dg-error "foo3" "use of foo3" } */ -#pragma poison foo4 foo5 +#pragma GCC poison foo4 foo5 foo4 /* { dg-error "foo4" "use of foo4" } */ foo5 /* { dg-error "foo5" "use of foo5" } */ -#pragma poison +++ /* { dg-error "invalid" "poison non-identifier" } */ +#pragma GCC poison +++ /* { dg-error "invalid" "poison non-identifier" } */ #define foo6 123 -#pragma poison foo6 /* { dg-warning "foo6" "poison defined macro" } */ +#pragma GCC poison foo6 /* { dg-warning "foo6" "poison defined macro" } */ #define foo6 345 /* { dg-error "foo6" "def of foo6" } */ #define foo6 456 /* { dg-error "foo6" "redef of foo6" } */ #ifdef foo6 /* { dg-error "foo6" "#ifdef foo6" } */ @@ -22,4 +22,4 @@ foo5 /* { dg-error "foo5" "use of foo5" } */ #else foo6 /* { dg-error "foo6" "use of foo6" } */ #endif -#pragma poison +#pragma GCC poison |