cpplib.h (struct cpp_options): Add warn_deprecated field.
authorJason Merrill <jason@redhat.com>
Tue, 28 Jan 2003 19:30:00 +0000 (14:30 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 28 Jan 2003 19:30:00 +0000 (14:30 -0500)
        * cpplib.h (struct cpp_options): Add warn_deprecated field.
        * cppinit.c (cpp_create_reader): Turn it on by default.
        * c-opts.c (c_common_decode_option): Set it.
        * cpplib.c (do_pragma_once): Only complain about #pragma once
        if warn_deprecated is set.

From-SVN: r62005

gcc/ChangeLog
gcc/c-opts.c
gcc/cppinit.c
gcc/cpplib.c
gcc/cpplib.h

index 405ea857ad6d71694ff650fbbdbf540e21221744..51fed17af87f8eed35546f372ba45d69ae025364 100644 (file)
@@ -1,4 +1,13 @@
+2003-01-28  Jason Merrill  <jason@redhat.com>
+
+       * cpplib.h (struct cpp_options): Add warn_deprecated field.
+       * cppinit.c (cpp_create_reader): Turn it on by default.
+       * c-opts.c (c_common_decode_option): Set it.
+       * cpplib.c (do_pragma_once): Only complain about #pragma once
+       if warn_deprecated is set.
+
 2003-01-28  Dale Johannesen  <dalej@apple.com>
+
         * emit-rtl.c (const_double_htab_hash):  Use mode in the hash.
         * loop.c (scan_loop):  Move movables on -Os rich-register targets.
         * config/rs6000/rs6000.md (sibcall*):  Use match_operand for LR.
index bb074615e2a9bbc0088299d50d5600c9d17ebf2b..4043447fdf2a9342185bb3de80176d3a622ed74a 100644 (file)
@@ -767,6 +767,7 @@ c_common_decode_option (argc, argv)
 
     case OPT_Wdeprecated:
       warn_deprecated = on;
+      cpp_opts->warn_deprecated = on;
       break;
 
     case OPT_Wdiv_by_zero:
index 324cb7784ebdcbbb5b6ce5b4906076615cd9ac8d..591b4bfd76aaf8ef9b0286eede780ee6742f8e58 100644 (file)
@@ -527,6 +527,7 @@ cpp_create_reader (lang)
   CPP_OPTION (pfile, tabstop) = 8;
   CPP_OPTION (pfile, operator_names) = 1;
   CPP_OPTION (pfile, warn_endif_labels) = 1;
+  CPP_OPTION (pfile, warn_deprecated) = 1;
   CPP_OPTION (pfile, warn_long_long) = !CPP_OPTION (pfile, c99);
 
   CPP_OPTION (pfile, pending) =
index 1019a2a9713c1eb2e8e5ce8b0d373deb256fba6b..a40fe1229ff4e5f5f111ce36dbc983484112b0d6 100644 (file)
@@ -1223,7 +1223,8 @@ static void
 do_pragma_once (pfile)
      cpp_reader *pfile;
 {
-  cpp_error (pfile, DL_WARNING, "#pragma once is obsolete");
+  if (CPP_OPTION (pfile, warn_deprecated))
+    cpp_error (pfile, DL_WARNING, "#pragma once is obsolete");
 
   if (pfile->buffer->prev == NULL)
     cpp_error (pfile, DL_WARNING, "#pragma once in main file");
index 556c78381f399b0eeb617298d8d88358f8b8246c..d16bf121db6c2034b32267084afd832ec923e2a8 100644 (file)
@@ -278,6 +278,9 @@ struct cpp_options
   /* Nonzero means don't print warning messages.  */
   unsigned char inhibit_warnings;
 
+  /* Nonzero means complain about deprecated features.  */
+  unsigned char warn_deprecated;
+
   /* Nonzero means don't suppress warnings from system headers.  */
   unsigned char warn_system_headers;