Commit 9fbd3e41 by Jason Merrill Committed by Jason Merrill

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
parent fe352c29
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.
......
......@@ -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:
......
......@@ -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) =
......
......@@ -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");
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment