This is the mail archive of the
libstdc++-prs@sourceware.cygnus.com
mailing list for the libstdc++ project.
libstdc++/40: bitset::operator<<= and >>= incorrect for multiples of 32
- To: libstdc++-gnats at sourceware dot cygnus dot com
- Subject: libstdc++/40: bitset::operator<<= and >>= incorrect for multiples of 32
- From: anders at ieee dot org
- Date: 10 Mar 2000 04:54:38 -0000
- Reply-To: anders at ieee dot org
- Resent-Cc: libstdc++-prs at sourceware dot cygnus dot com
- Resent-Reply-To: libstdc++-gnats@sourceware.cygnus.com, anders@ieee.org
>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: