aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2011-08-19 14:25:51 +0100
committerJoseph Myers <jsm28@gcc.gnu.org>2011-08-19 14:25:51 +0100
commitc4b3a0a0b9566dcd63e4a35ddcafa4b93055aa96 (patch)
treec6c54b66903cafd5d960e932fa497941dd2ad58a /gcc/c-decl.c
parentc26dffff5c573aa7f3935dddc8300a2c8fd660a1 (diff)
downloadgcc-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.c13
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