aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2003-01-28 14:30:00 -0500
committerJason Merrill <jason@gcc.gnu.org>2003-01-28 14:30:00 -0500
commit9fbd3e416654b42041026f9d51d1115a42dd5d34 (patch)
treee935857a003fa751109e2bb1c411f1ff70dd7772
parentfe352c2900b2bfc9af52a1f761063a6bb974acdb (diff)
downloadgcc-9fbd3e416654b42041026f9d51d1115a42dd5d34.zip
gcc-9fbd3e416654b42041026f9d51d1115a42dd5d34.tar.gz
gcc-9fbd3e416654b42041026f9d51d1115a42dd5d34.tar.bz2
cpplib.h (struct cpp_options): Add warn_deprecated field.
* 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
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/c-opts.c1
-rw-r--r--gcc/cppinit.c1
-rw-r--r--gcc/cpplib.c3
-rw-r--r--gcc/cpplib.h3
5 files changed, 16 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 405ea85..51fed17 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/c-opts.c b/gcc/c-opts.c
index bb07461..4043447 100644
--- a/gcc/c-opts.c
+++ b/gcc/c-opts.c
@@ -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:
diff --git a/gcc/cppinit.c b/gcc/cppinit.c
index 324cb77..591b4bf 100644
--- a/gcc/cppinit.c
+++ b/gcc/cppinit.c
@@ -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) =
diff --git a/gcc/cpplib.c b/gcc/cpplib.c
index 1019a2a..a40fe122 100644
--- a/gcc/cpplib.c
+++ b/gcc/cpplib.c
@@ -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");
diff --git a/gcc/cpplib.h b/gcc/cpplib.h
index 556c783..d16bf12 100644
--- a/gcc/cpplib.h
+++ b/gcc/cpplib.h
@@ -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;