This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/25810] spurious warning about unused function return
- From: "wingo at pobox dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Jan 2006 15:07:35 -0000
- Subject: [Bug c/25810] spurious warning about unused function return
- References: <bug-25810-12024@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from wingo at pobox dot com 2006-01-16 15:07 -------
Just for clarity, here is the warning:
test.c: In function ?main?:
test.c:33: warning: value computed is not used
The line corresponding to 33 in the preprocessed file:
(void*)data_ref((data*)d);
data_ref is not declared as pure or const. It seems to be the cast that is
causing the warning. The real-world case that causes this warning to be an
issue are things like this, from GStreamer:
#define gst_buffer_ref(buf) \
GST_BUFFER_CAST (gst_mini_object_ref (GST_MINI_OBJECT (buf)))
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25810