diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-02-06 20:40:18 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-02-06 20:40:18 +0000 |
commit | af8579421c955f1d7a2c5e0fcc9c2cfd2d250c16 (patch) | |
tree | 9c61da9c4a64edc8cbc210d2755ecb06d031534b /gcc/testsuite/gcc.dg/deprecated.c | |
parent | 0e62d8da8abc63fed2972043163030fd5b27df22 (diff) | |
download | gcc-af8579421c955f1d7a2c5e0fcc9c2cfd2d250c16.tar.gz |
* c-decl.c (finish_function): Warn about a non-void function with
no return statement and no abnormal exit.
(current_function_returns_abnormally): New variable.
(start_function): Clear it.
(struct c_language_function): Add returns_abnormally.
(push_c_function_context): Save it.
(pop_c_function_context): Restore it.
(builtin_function): Set TREE_THIS_VOLATILE on return fns.
(grokdeclarator): Set C_FUNCTION_IMPLICIT_INT on functions without
an explicit return type.
* c-tree.h: Declare current_function_returns_abnormally.
(C_FUNCTION_IMPLICIT_INT): New macro.
* c-typeck.c (build_function_call): Set it.
(c_expand_return): Set current_function_returns_value even if the
value is erroneous.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49551 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/deprecated.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/deprecated.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/testsuite/gcc.dg/deprecated.c b/gcc/testsuite/gcc.dg/deprecated.c index bc82c6d6200..83557475c44 100644 --- a/gcc/testsuite/gcc.dg/deprecated.c +++ b/gcc/testsuite/gcc.dg/deprecated.c @@ -13,10 +13,10 @@ INT1 should_be_unavailable; /* { dg-warning "`INT1' is deprecated" "" } */ INT1a should_not_be_deprecated; INT1 f1(void) __attribute__ ((deprecated)); -INT1 f2(void) {} /* { dg-warning "`INT1' is deprecated" "" } */ +INT1 f2(void) { return 0; } /* { dg-warning "`INT1' is deprecated" "" } */ INT2 f3(void) __attribute__ ((__deprecated__)); -INT2 f4(void) {} /* { dg-warning "`INT2' is deprecated" "" } */ +INT2 f4(void) { return 0; } /* { dg-warning "`INT2' is deprecated" "" } */ int f5(INT2 x); /* { dg-warning "`INT2' is deprecated" "" } */ int f6(INT2 x) __attribute__ ((__deprecated__)); /* { dg-warning "`INT2' is deprecated" "" } */ |