diff options
author | Manuel López-Ibáñez <manu@gcc.gnu.org> | 2009-07-10 07:27:32 +0000 |
---|---|---|
committer | Manuel López-Ibáñez <manu@gcc.gnu.org> | 2009-07-10 07:27:32 +0000 |
commit | 156f545a1bf194040a24f5e54e1ec5ac4eff642f (patch) | |
tree | cf4b509067e40cd7e3e96f721aebe6f76de83ac9 /gcc/c-common.c | |
parent | 5cec9f5974ed8ab0788179b2afd48eb484f39acb (diff) | |
download | gcc-156f545a1bf194040a24f5e54e1ec5ac4eff642f.zip gcc-156f545a1bf194040a24f5e54e1ec5ac4eff642f.tar.gz gcc-156f545a1bf194040a24f5e54e1ec5ac4eff642f.tar.bz2 |
re PR c/25509 (can't disable __attribute__((warn_unused_result)))
2009-07-10 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR 25509
PR 40614
* c.opt (Wunused-result): New.
* doc/invoke.texi: Document it.
* c-common.c (c_warn_unused_result): Use it.
testsuite/
* g++.dg/warn/unused-result1-Werror.c: New.
From-SVN: r149458
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r-- | gcc/c-common.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c index 1c883d1..20dac6b 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -8266,11 +8266,13 @@ c_warn_unused_result (gimple_seq seq) location_t loc = gimple_location (g); if (fdecl) - warning_at (loc, 0, "ignoring return value of %qD, " + warning_at (loc, OPT_Wunused_result, + "ignoring return value of %qD, " "declared with attribute warn_unused_result", fdecl); else - warning_at (loc, 0, "ignoring return value of function " + warning_at (loc, OPT_Wunused_result, + "ignoring return value of function " "declared with attribute warn_unused_result"); } break; |