This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: [Various] libc/1864: strtol does not return 0xFFFFFFFFFFFF00FF when fed "0xFFFFFFFFFFFF00FF"
- To: Geoff Keating <geoffk at cygnus dot com>
- Subject: Re: [Various] libc/1864: strtol does not return 0xFFFFFFFFFFFF00FF when fed "0xFFFFFFFFFFFF00FF"
- From: Andreas Jaeger <aj at suse dot de>
- Date: 22 Aug 2000 07:25:32 +0200
- Cc: libc-alpha at sourceware dot cygnus dot com, eh at adv dot sonybpe dot com,eamon at sonyoxford dot co dot uk
- References: <u88ztqaalc.fsf@gromit.rhein-neckar.de><200008211828.LAA31615@localhost.cygnus.com>
>>>>> Geoff Keating writes:
>> Cc: "Eamon Hughes." <eh@adv.sonybpe.com>, eamon@sonyoxford.co.uk
>> From: Andreas Jaeger <aj@suse.de>
>> Date: 21 Aug 2000 17:38:07 +0200
>> We've received the appended bug report. Can anybody clarify this,
>> please?
>>
>> If I understand this correctly, the basic question is whether strtol
>> handles:
>> Numbers > 0x8000000000000000 as a negative number - or not.
Geoff> It should not. It's easy to tell negative numbers in inputs to
Geoff> strtol, they start with a '-'.
>> Btw. this works with strtoul.
Geoff> That would be a bug (depending on your system). 0xFFFFFFFFFFFF00FF
Geoff> isn't representable as an unsigned long except on 64-bit systems.
I tried it on an 64 bit system - as the reporter did.
>> I've added this as a testcase to
>> tst-strtol and tst-strtoll. Please tell me if the tests cases are
>> correct (in this case the report is wrong) - or wrong and we need to
>> fix strtol/strtoll.
Geoff> I believe your testcase is right.
I'll commit it later,
Andreas
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de
http://www.suse.de/~aj