You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by Nicole Willson <wi...@roguewave.com> on 2006/08/04 22:33:27 UTC

Problem with bitset

 
Ok, I've been working on a problem with the bitset test in containers in
stdlib.  Basically, when it compares the 0 length MyChar string against
the bitset of a 0 length string, it comes back with 0 (mismatch at bit
0) rather than the expected -1.  This is apparently because the MyChar
is never initialized.  Is this an issue with the test, or showing an
actual problem with the library?

Nicole Willson
Consulting Engineer
Rogue Wave Software, Inc.
A Division of Quovadx
303-545-3210


Re: Problem with bitset

Posted by Martin Sebor <se...@roguewave.com>.
Nicole Willson wrote:
>  
> Ok, I've been working on a problem with the bitset test in containers in
> stdlib.  Basically, when it compares the 0 length MyChar string against
> the bitset of a 0 length string, it comes back with 0 (mismatch at bit
> 0) rather than the expected -1.  This is apparently because the MyChar
> is never initialized.  Is this an issue with the test, or showing an
> actual problem with the library?

Which test exactly (there are three), what compiler, OS, build type,
etc.?

I've seen the failures below with Intel C++ on Linux but I haven't
investigated them yet. We also have a bug report with Intel for
this problem: http://issues.apache.org/jira/browse/STDCXX-248.

Martin

##    StepTag = std::bitset<80>::bitset(const std::basic_string<UDT>&)

## -       AssertionTag = line 386: 
bitset<80>::bitset("11111111111111111111111111111111111111111111111111111111111111111111111111111111", 
4294967295, 4294967295) expected { 
11111111111111111111111111111111111111111111111111111111111111111111111111111111 
}, got { 
00000000000000000000000000000000000000000000000000000000000000000000000000000000 
}
## -       FileName     = ../bitset_cons.cpp
## -       LineNumber   = 585

## -       AssertionTag = line 386: 
bitset<80>::bitset("10000000000000000000000000000000000000000000000000000000000000000000000000000001", 
4294967295, 4294967295) expected { 
10000000000000000000000000000000000000000000000000000000000000000000000000000001 
}, got { 
00000000000000000000000000000000000000000000000000000000000000000000000000000000 
}
## -       FileName     = ../bitset_cons.cpp
## -       LineNumber   = 586

## -       AssertionTag = line 386: 
bitset<80>::bitset("10000000000000000000000000000000000000000000000000000000000000000000000000000010", 
4294967295, 4294967295) expected { 
10000000000000000000000000000000000000000000000000000000000000000000000000000010 
}, got { 
00000000000000000000000000000000000000000000000000000000000000000000000000000000 
}
## -       FileName     = ../bitset_cons.cpp
## -       LineNumber   = 587