diff options
author | Joseph Myers <joseph@codesourcery.com> | 2011-08-19 14:25:51 +0100 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2011-08-19 14:25:51 +0100 |
commit | c4b3a0a0b9566dcd63e4a35ddcafa4b93055aa96 (patch) | |
tree | c6c54b66903cafd5d960e932fa497941dd2ad58a /gcc/c-decl.c | |
parent | c26dffff5c573aa7f3935dddc8300a2c8fd660a1 (diff) | |
download | gcc-c4b3a0a0b9566dcd63e4a35ddcafa4b93055aa96.zip gcc-c4b3a0a0b9566dcd63e4a35ddcafa4b93055aa96.tar.gz gcc-c4b3a0a0b9566dcd63e4a35ddcafa4b93055aa96.tar.bz2 |
c-decl.c (grokdeclarator): Diagnose _Noreturn for non-C1X if pedantic.
* c-decl.c (grokdeclarator): Diagnose _Noreturn for non-C1X if
pedantic.
* c-parser.c (c_parser_declspecs): Include _Noreturn in syntax
comment.
* ginclude/stdnoreturn.h (noreturn): Don't define for C++.
testsuite:
* gcc.dg/c90-noreturn-1.c, gcc.dg/c99-noreturn-1.c: New tests.
From-SVN: r177899
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index d824e12..d683d4e 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -5986,7 +5986,18 @@ grokdeclarator (const struct c_declarator *declarator, /* Record that the function is declared `inline'. */ DECL_DECLARED_INLINE_P (decl) = 1; if (declspecs->noreturn_p) - TREE_THIS_VOLATILE (decl) = 1; + { + if (!flag_isoc1x) + { + if (flag_isoc99) + pedwarn (loc, OPT_pedantic, + "ISO C99 does not support %<_Noreturn%>"); + else + pedwarn (loc, OPT_pedantic, + "ISO C90 does not support %<_Noreturn%>"); + } + TREE_THIS_VOLATILE (decl) = 1; + } } } else |