]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* cpplib.c (cpp_init_internal_pragmas): Remove #pragma poison.
authorneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 9 May 2002 17:14:22 +0000 (17:14 +0000)
committerneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 9 May 2002 17:14:22 +0000 (17:14 +0000)
* cppmacro.c (paste_all_tokens): Bad pastes are a hard error.
doc:
* cpp.texi: Update for removal of obsolete features.
testsuite:
* gcc.dg/cpp/poison.c: Update.
* gcc.dg/cpp/20000625-2.c: Remove.
* gcc.dg/cpp/direct2s.c: Remove final test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@53333 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/cpplib.c
gcc/cppmacro.c
gcc/doc/cpp.texi
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/cpp/20000625-2.c [deleted file]
gcc/testsuite/gcc.dg/cpp/direct2s.c
gcc/testsuite/gcc.dg/cpp/poison.c

index bb9bed7f689d881760acfb555dc3e2353f2621ca..2a492d2d1bf2d15dfd99c4627a0d855bcb4ca146 100644 (file)
@@ -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)
 
index c90224c0b0a8f626bb3ade236a0d001128ae9b5e..2773ed93e4ea82b8474b5edf5c8173cbfaee5c42 100644 (file)
@@ -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;
index 876506bbaad37cf290a3461c991ac5685dd4d8f0..b9859954656505f366851112800cfd5077769dbc 100644 (file)
@@ -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));
index 194175362a810ccbb9a34b03784a829a7e084a0f..a7f3cd2e8dbd9a621f6fc63469c0df501d3068e1 100644 (file)
@@ -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
index 5e060c43db8d00b69737331d72b409c9ec3ad2d4..363389a8a604bdecb03e02a8808d6299667d21c6 100644 (file)
@@ -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 (file)
index 72e2604..0000000
+++ /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;
-}
index 6c98ecc9a127174577d70f96db30c1f6c1fac7fe..4d970a63722b17479d59195eae9d86573dcf232e 100644 (file)
@@ -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 } */
index fd3f5368eb438d513e670812027eef2b9bb5bd8f..d667183de316f443096123acaa23f5b456edccfb 100644 (file)
@@ -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