aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;