This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
[RFC] PR/24900: computed but not used cast values
- From: Aldy Hernandez <aldyh at redhat dot com>
- To: ian at airs dot com, gcc at gcc dot gnu dot org, joseph at codesourcery dot com
- Date: Thu, 17 Nov 2005 17:33:00 -0400
- Subject: [RFC] PR/24900: computed but not used cast values
Hi folks.
In this PR we are emitting a "value computed is not used" warning for the
following code (via some fancy macro expansion in the Linux kernel):
unsigned long t(void);
void apic_write_atomic(unsigned long reg, unsigned int v)
{
((__typeof__(*((volatile unsigned int *)((t())+reg))))t());
}
this reduces to:
int f(void);
void g(void)
{ (unsigned) f(); }
Which was made to deliberately warn by Joseph's patch here:
http://gcc.gnu.org/ml/gcc-patches/2005-08/msg00275.html
I closed the bug as a WONTFIX, but Ian suggested I bring this up on the
list, as he believes the choice to warn on this, isn't a good one.
Joseph, Ian?