This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
-traditional deprecation patch
- From: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- To: <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 18 Nov 2001 17:17:35 +0000 (GMT)
- Subject: -traditional deprecation patch
This patch implements the deprecation of -traditional. Bootstrapped
with no regressions on i686-pc-linux-gnu. Applied to mainline.
2001-11-18 Joseph S. Myers <jsm28@cam.ac.uk>
* c-decl.c (c_decode_option): Give deprecation warning for
-traditional.
* doc/invoke.texi (-traditional): Note that this option is
deprecated.
testsuite:
2001-11-18 Joseph S. Myers <jsm28@cam.ac.uk>
* gcc.dg/cpp/assert_trad1.c, gcc.dg/cpp/tr-paste.c,
gcc.dg/cpp/tr-str.c: Use -traditional-cpp instead of -traditional.
* gcc.dg/ext-glob.c: Expect -traditional deprecation warning.
diff -rupN gcc.orig/c-decl.c gcc/c-decl.c
--- gcc.orig/c-decl.c Thu Nov 15 20:47:21 2001
+++ gcc/c-decl.c Sat Nov 17 19:28:26 2001
@@ -457,6 +457,7 @@ c_decode_option (argc, argv)
if (!strcmp (p, "-ftraditional") || !strcmp (p, "-traditional"))
{
+ warning ("-traditional is deprecated and may be removed");
flag_traditional = 1;
flag_writable_strings = 1;
}
diff -rupN gcc.orig/doc/invoke.texi gcc/doc/invoke.texi
--- gcc.orig/doc/invoke.texi Wed Nov 14 00:35:30 2001
+++ gcc/doc/invoke.texi Sat Nov 17 19:29:20 2001
@@ -1132,6 +1132,8 @@ literal characters @samp{x} and @samp{a}
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.
diff -rupN gcc.orig/testsuite/gcc.dg/cpp/assert_trad1.c gcc/testsuite/gcc.dg/cpp/assert_trad1.c
--- gcc.orig/testsuite/gcc.dg/cpp/assert_trad1.c Mon Dec 4 22:06:41 2000
+++ gcc/testsuite/gcc.dg/cpp/assert_trad1.c Sat Nov 17 19:29:30 2001
@@ -1,6 +1,6 @@
/* Basic tests of the #assert preprocessor extension. */
/* { dg-do compile } */
-/* { dg-options "-traditional" } */
+/* { dg-options "-traditional-cpp" } */
/* #define def unused expansion */ /* tradcpp can't handle macros in answers. */
#define fail int failit
diff -rupN gcc.orig/testsuite/gcc.dg/cpp/tr-paste.c gcc/testsuite/gcc.dg/cpp/tr-paste.c
--- gcc.orig/testsuite/gcc.dg/cpp/tr-paste.c Tue Jun 27 22:26:11 2000
+++ gcc/testsuite/gcc.dg/cpp/tr-paste.c Sat Nov 17 19:29:39 2001
@@ -3,7 +3,7 @@
Test case by Jason R. Thorpe <thorpej@zembu.com>. */
/* { dg-do compile } */
-/* { dg-options "-traditional" } */
+/* { dg-options "-traditional-cpp" } */
#define A(name) X/**/name
diff -rupN gcc.orig/testsuite/gcc.dg/cpp/tr-str.c gcc/testsuite/gcc.dg/cpp/tr-str.c
--- gcc.orig/testsuite/gcc.dg/cpp/tr-str.c Sat Sep 23 13:52:26 2000
+++ gcc/testsuite/gcc.dg/cpp/tr-str.c Sat Nov 17 19:29:49 2001
@@ -1,6 +1,6 @@
/* Test whether traditional stringify works. */
/* { dg-do run } */
-/* { dg-options "-traditional" } */
+/* { dg-options "-traditional-cpp" } */
#define foo(a, b) c="a"; d="b";
extern void abort ();
diff -rupN gcc.orig/testsuite/gcc.dg/ext-glob.c gcc/testsuite/gcc.dg/ext-glob.c
--- gcc.orig/testsuite/gcc.dg/ext-glob.c Tue May 23 17:28:23 2000
+++ gcc/testsuite/gcc.dg/ext-glob.c Sat Nov 17 19:31:55 2001
@@ -5,6 +5,7 @@
/* { dg-do compile } */
/* { dg-options -traditional } */
+/* { dg-warning "-traditional is deprecated" "deprecation warning" { target *-*-* } 0 } */
int
main ()
--
Joseph S. Myers
jsm28@cam.ac.uk