This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

cpplib: Remove obsolete stuff


This stuff has been documented obsolete for at least two
major revisions, which seems to be the minimum acceptable
for removal of features.

Is this OK with you, Zack?

Neil.

	* 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.
testsuite:
	* gcc.dg/cpp/poison.c: Update.

============================================================
Index: gcc/cpplib.c
--- gcc/cpplib.c	4 May 2002 07:26:44 -0000	1.301
+++ gcc/cpplib.c	8 May 2002 21:59:21 -0000
@@ -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: gcc/cppmacro.c
--- gcc/cppmacro.c	22 Apr 2002 17:48:02 -0000	1.101
+++ gcc/cppmacro.c	8 May 2002 21:59:27 -0000
@@ -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: gcc/doc/cpp.texi
--- gcc/doc/cpp.texi	8 May 2002 21:02:30 -0000	1.34
+++ gcc/doc/cpp.texi	8 May 2002 21:59:41 -0000
@@ -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 fea
 @menu
 * Assertions::
 * Obsolete once-only headers::
-* Miscellaneous obsolete features::
 @end menu
 
 @node Assertions
@@ -3747,41 +3745,6 @@ matter what.
 @samp{#pragma once} does not have the problems that @samp{#import} does,
 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
============================================================
Index: gcc/testsuite/gcc.dg/cpp/poison.c
--- gcc/testsuite/gcc.dg/cpp/poison.c	9 Dec 2000 12:07:56 -0000	1.3
+++ gcc/testsuite/gcc.dg/cpp/poison.c	8 May 2002 21:59:41 -0000
@@ -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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]