This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/35579] __attribute__(( warn_unused_result )) warns when it shouldn't, doesn't warn when it should
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 Mar 2008 04:54:52 -0000
- Subject: [Bug c/35579] __attribute__(( warn_unused_result )) warns when it shouldn't, doesn't warn when it should
- References: <bug-35579-15916@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from pinskia at gcc dot gnu dot org 2008-03-14 04:54 -------
This is the design of warn_unused_result, you cannot ignore the value, that is
why casting to void does not work.
The warning happens in the front-end so we don't know if you really ignore the
value if you don't use the actually variable.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35579