[Various] libc/1864: strtol does not return 0xFFFFFFFFFFFF00FF when fed "0xFFFFFFFFFFFF00FF"
Andreas Jaeger
aj@suse.de
Mon Aug 21 22:27:00 GMT 2000
>>>>> 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
More information about the Libc-alpha
mailing list