libstdc++/40: bitset::operator<<= and >>= incorrect for multiples of 32
anders@ieee.org
anders@ieee.org
Thu Mar 9 20:57:00 GMT 2000
>Number: 40
>Category: libstdc++
>Synopsis: bitset::operator<<= and >>= incorrect for multiples of 32
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Mar 09 20:57:00 PST 2000
>Closed-Date:
>Last-Modified:
>Originator: Anders Johnson
>Release: libstdc++-2.90.7
>Organization:
>Environment:
SunOS thresher 5.6 Generic_105181-05 sun4u sparc SUMW,Ultra-60
>Description:
The implementation of bitset relies on the behavior
of _WordT >> __BITS_PER_WORDT(_WordT), which is not
defined according to the C standard, and is equivalent
to _WordT >> 0 on the Sparc. This occurs whenever the
shift amount is a multiple of __BITS_PER_WORDT(_WordT).
>How-To-Repeat:
>Fix:
The expressions on lines 201 and 220 of stl/bits/std_bitset.h
should read (__offset ? ... : static_cast<_WordT>(0)) instead.
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the Libstdc++-prs
mailing list