------- 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