This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
spurious warning on increment of bitfield
- To: "'gcc-bugs at gcc dot gnu dot org'" <gcc-bugs at gcc dot gnu dot org>
- Subject: spurious warning on increment of bitfield
- From: Ian Young <iay at 3L dot co dot uk>
- Date: Thu, 16 Mar 2000 13:02:05 -0000
Solaris 2.6, GCC 2.95.2
y.cpp:
struct proc {
unsigned c: 16;
};
void f(struct proc *p)
{
p->c++;
}
% g++ -c -Wall y.cpp
y.cpp: in function `void f(proc *)':
y.cpp:7: warning: value computed is not used
The warning does not occur if, for example, c is defined as an unsigned
short.
-- Ian