This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/25509] can't voidify __attribute__((warn_unused_result))
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Dec 2005 09:59:43 -0000
- Subject: [Bug c/25509] can't voidify __attribute__((warn_unused_result))
- References: <bug-25509-3563@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #9 from rguenth at gcc dot gnu dot org 2005-12-21 09:59 -------
The (technical) problem that the void cast does not work is that the warning
is applied after gimplification, which strips the cast to void. So, this is
another case where warnings from the middle-end show their bad side - not that
it would be easy to move to the frontend(s).
This is at least a bug because the warning cannot be disabled:
if (lookup_attribute ("warn_unused_result", TYPE_ATTRIBUTES (ftype)))
{
if (fdecl)
warning (0, "%Hignoring return value of %qD, "
"declared with attribute warn_unused_result",
EXPR_LOCUS (t), fdecl);
else
warning (0, "%Hignoring return value of function "
"declared with attribute warn_unused_result",
EXPR_LOCUS (t));
}
so, confirmed. Suggestions for a proper -Wno-XXX identifier?
-Wno-unused-result?
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2005-12-21 09:59:43
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509