This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/25509] New: can't voidify __attribute__((warn_unused_result))
- From: "mueller at kde dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Dec 2005 23:09:48 -0000
- Subject: [Bug c/25509] New: can't voidify __attribute__((warn_unused_result))
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
casting to (void) doesn't avoid the unused_result warning. testcase:
=== Cut ===
extern int foo() __attribute__((warn_unused_result));
int main()
{
(void) foo();
return 0;
}
=== Cut ===
g++ -Wall -W -O2 -c unused.cc
unused.cc: In function 'int main()':
unused.cc:4: warning: ignoring return value of 'int foo()', declared with
attribute warn_unused_result
--
Summary: can't voidify __attribute__((warn_unused_result))
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: mueller at kde dot org
GCC host triplet: i686-suse-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509