diff options
author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-05-13 14:50:27 +0000 |
---|---|---|
committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-05-13 14:50:27 +0000 |
commit | fb9753dc87d0cfd04956c96feda63436523d48ab (patch) | |
tree | 44ca24a87d3904ae6d7e037e670b57a496ed974c /libcpp/expr.c | |
parent | c9156fc0d74d5e3dcb77abaca38dc067dc39de2c (diff) |
libcpp
PR preprocessor/22168:
* include/cpplib.h (struct cpp_options) <objc>: Update
documentation.
* expr.c (eval_token): Warn for use of assertions.
* directives.c (directive_diagnostics): Warn about extensions.
(DEPRECATED): New define.
(DIRECTIVE_TABLE): Use it.
gcc
PR preprocessor/22168:
* doc/cpp.texi (Top): Update menu.
(Alternatives to Wrapper #ifndef): New node.
(Other Directives): Document deprecation.
(Obsolete Features): Remove menu.
(Assertions): Merge node into Obsolete Features.
(Obsolete once-only headers): Move earlier; rename to Alternatives
to Wrapper #ifndef.
* doc/cppopts.texi: Update.
* c.opt (Wdeprecated): Enable for C and ObjC.
* doc/invoke.texi (Option Summary): Move -Wno-deprecated.
(C++ Dialect Options): Move -Wno-deprecated from here to...
(Warning Options): ... here.
gcc/testsuite
PR preprocessor/22168:
* gcc.dg/pch/import-2.hs: Add -Wno-deprecated.
* gcc.dg/pch/import-1.hs: Add -Wno-deprecated.
* gcc.dg/pch/import-2.c: Add -Wno-deprecated.
* gcc.dg/pch/import-1.c: Add -Wno-deprecated.
* gcc.dg/cpp/import2.c: Add -Wno-deprecated.
* gcc.dg/cpp/import1.c: Add -Wno-deprecated.
* gcc.dg/cpp/trad/assert3.c: Add -Wno-deprecated.
* gcc.dg/cpp/trad/assert2.c: Add -Wno-deprecated.
* gcc.dg/cpp/trad/assert1.c: Add -Wno-deprecated.
* gcc.dg/cpp/ident.c: Add -Wno-deprecated.
* gcc.dg/cpp/ident-1.c: Add -Wno-deprecated.
* gcc.dg/cpp/extratokens.c: Add -Wno-deprecated.
* gcc.dg/cpp/assert3.c: Add -Wno-deprecated.
* gcc.dg/cpp/assert2.c: Add -Wno-deprecated.
* gcc.dg/cpp/assert1.c: Add -Wno-deprecated.
* gcc.dg/cpp/assert4.c: Compile with -ansi and not -pedantic. Add
-Wno-deprecated.
* gcc.dg/cpp/pr22168.c: New file.
* gcc.dg/cpp/pr22168-2.c: New file.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@135264 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libcpp/expr.c')
-rw-r--r-- | libcpp/expr.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/libcpp/expr.c b/libcpp/expr.c index af0e2590ee49..2e52617a6568 100644 --- a/libcpp/expr.c +++ b/libcpp/expr.c @@ -745,10 +745,25 @@ eval_token (cpp_reader *pfile, const cpp_token *token) } break; - default: /* CPP_HASH */ + case CPP_HASH: + if (!pfile->state.skipping) + { + /* A pedantic warning takes precedence over a deprecated + warning here. */ + if (CPP_PEDANTIC (pfile)) + cpp_error (pfile, CPP_DL_PEDWARN, + "assertions are a GCC extension"); + else if (CPP_OPTION (pfile, warn_deprecated)) + cpp_error (pfile, CPP_DL_WARNING, + "assertions are a deprecated extension"); + } _cpp_test_assertion (pfile, &temp); result.high = 0; result.low = temp; + break; + + default: + abort (); } result.unsignedp = !!unsignedp; |