glibc 2.1.2pre3
George T. Talbot
george@moberg.com
Fri Aug 27 08:07:00 GMT 1999
Andreas Jaeger wrote:
>
> >>>>> George Talbot writes:
>
> George> On 27 Aug 1999, Ulrich Drepper wrote:
> >> "George T. Talbot" <george@moberg.com> writes:
> >>
> >> > Can this release be compiled with GCC 2.95.1 or do I have to stick with
> >> > egcs 1.1.2?
> >>
> >> Depends on the platforms. gcc 2.95* works for platforms != Alpha.
>
> George> OK...then I'll give it a try. I was curious because when I recompiled
> George> 2.1.1pre2 with 2.95.1 atoll() and strtoll() broke, giving incorrect
> George> results. I was compiling with -fexceptions, so maybe this made a
> George> difference. (platform: Linux x86)
>
> Do you have testcases for the atoll and strtoll breakage?
Here's the program I used to test for breakage. Kinda simple and
stupid, but it works.
--
George T. Talbot
<george@moberg.com>
#include <stdlib.h>
#include <iostream.h>
#include <strstream.h>
int main(int argc, char *argv[])
{
long long i = 1;
int passed=1;
do
{
char buf[128];
ostrstream wr(buf, sizeof(buf));
wr << i << ends;
cout << " i= " << i << " (str=\"" << wr.str() << "\")";
long long conv = atoll(wr.str());
cout << " atoll(str)=" << conv;
if (i != conv)
{
cout << " ***";
passed=0;
}
long long conv2 = strtoll(wr.str(), 0, 10);
cout << " strtoll(str, 0, 10)=" << conv2;
if (i != conv2)
{
cout << " ***";
passed=0;
}
istrstream rd(wr.str());
long long conv3;
rd >> conv3;
cout << " long long operator>>(str)=" << conv3;
if (i != conv3)
{
cout << " ***";
passed=0;
}
cout << endl;
i = i << 1;
} while (i);
if (passed)
cout << "Test passed." << endl;
else
cout << "*** TEST FAILED. ***" << endl;
return 0;
}
More information about the Libc-alpha
mailing list