[Bug c++/40614] no -Werror= for attribute warn_unused_result

2009-07-10 Thread manu at gcc dot gnu dot org


--- Comment #4 from manu at gcc dot gnu dot org  2009-07-10 07:29 ---
FIXED in GCC 4.5


-- 

manu at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40614



[Bug c++/40614] no -Werror= for attribute warn_unused_result

2009-07-10 Thread manu at gcc dot gnu dot org


--- Comment #3 from manu at gcc dot gnu dot org  2009-07-10 07:27 ---
Subject: Bug 40614

Author: manu
Date: Fri Jul 10 07:27:32 2009
New Revision: 149458

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=149458
Log:
2009-07-10  Manuel López-Ibáñez  

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.

Added:
trunk/gcc/testsuite/g++.dg/warn/unused-result1-Werror.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/c-common.c
trunk/gcc/c.opt
trunk/gcc/doc/invoke.texi
trunk/gcc/testsuite/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40614



[Bug c++/40614] no -Werror= for attribute warn_unused_result

2009-07-02 Thread manu at gcc dot gnu dot org


--- Comment #2 from manu at gcc dot gnu dot org  2009-07-02 23:41 ---
We can add an option Wunused-result that controls the warnings.
Wno-unused-result and -Werror=unused-result will then work as expected.

Index: gcc/c-common.c
===
--- gcc/c-common.c  (revision 149197)
+++ gcc/c-common.c  (working copy)
@@ -8258,13 +8258,14 @@ c_warn_unused_result (gimple_seq seq)
  location_t loc = gimple_location (g);

  if (fdecl)
-   warning (0, "%Hignoring return value of %qD, "
-"declared with attribute warn_unused_result",
-&loc, fdecl);
+warning_at (loc, OPT_Wunused_result,
+"ignoring return value of %qD, "
+"declared with attribute warn_unused_result",
+fdecl);
  else
-   warning (0, "%Hignoring return value of function "
-"declared with attribute warn_unused_result",
-&loc);
+   warning_at (loc, OPT_Wunused_result,
+"ignoring return value of function "
+"declared with attribute warn_unused_result");
}
  break;


-- 

manu at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||manu at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40614



[Bug c++/40614] no -Werror= for attribute warn_unused_result

2009-07-02 Thread rguenth at gcc dot gnu dot org


--- Comment #1 from rguenth at gcc dot gnu dot org  2009-07-02 11:33 ---
Confirmed.


-- 

rguenth at gcc dot gnu dot org changed:

   What|Removed |Added

   Severity|normal  |enhancement
 Status|UNCONFIRMED |NEW
 Ever Confirmed|0   |1
   Keywords||diagnostic
   Last reconfirmed|-00-00 00:00:00 |2009-07-02 11:33:27
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40614