]> git.ipfire.org Git - thirdparty/gcc.git/commit
c-common.c (handle_warn_unused_result_attribute): New function.
authorJason Merrill <jason@redhat.com>
Tue, 16 Sep 2003 07:58:27 +0000 (03:58 -0400)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 16 Sep 2003 07:58:27 +0000 (09:58 +0200)
commit72954a4f4456cbdc8e1ff01e27f488d304ba32ad
treea6e02ea18c49961a7fc38f54f53192e537f6e3af
parentc9fbef12bee8504ff48a45e3c67099af6772857d
c-common.c (handle_warn_unused_result_attribute): New function.

* c-common.c (handle_warn_unused_result_attribute): New function.
(c_common_attribute_table): Add warn_unused_result.
(c_expand_expr): Issue warning when result of inlined function
with warn_unused_result attribute is ignored.
* calls.c (expand_call): Issue warning when result of function
with warn_unused_result attribute is ignored.
* c-common.h (STMT_EXPR_WARN_UNUSED_RESULT): Define.
* expr.c (expr_wfl_stack): Define.
(expand_expr) <case EXPR_WITH_FILE_LOCATION>: If ignore,
pass const0_rtx as target.  Chain locations into expr_wfl_stack.
* tree-inline.c (expand_call_inline): Set STMT_EXPR_WARN_UNUSED_RESULT
bit if inlined function has warn_unused_result attribute.
* input.h (expr_wfl_stack): Declare.
* doc/extend.texi: Document warn_unused_result attribute.

* gcc.dg/attr-warn-unused-result.c: New test.

Co-Authored-By: Jakub Jelinek <jakub@redhat.com>
From-SVN: r71424
gcc/ChangeLog
gcc/c-common.c
gcc/c-common.h
gcc/calls.c
gcc/doc/extend.texi
gcc/expr.c
gcc/input.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/attr-warn-unused-result.c [new file with mode: 0644]
gcc/tree-inline.c