This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

spurious warning on increment of bitfield


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]