This is the mail archive of the gcc-prs@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]

c++/118: Re: spurious warning on increment of bitfield



>Number:         118
>Category:       c++
>Synopsis:       spurious warning on increment of bitfield
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          analyzed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Mar 16 12:06:00 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     Ian Young <iay@3L.co.uk>
>Release:        2.95.2
>Organization:
>Environment:
>Description:
 Original-Message-ID: <2F78B0E5B56AD311B71500A0C9B57C36087BBE@viola.threel.co.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

>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:

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