[Various] libc/1864: strtol does not return 0xFFFFFFFFFFFF00FF when fed "0xFFFFFFFFFFFF00FF"
Geoff Keating
geoffk@cygnus.com
Mon Aug 21 11:29:00 GMT 2000
> 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.
It should not. It's easy to tell negative numbers in inputs to
strtol, they start with a '-'.
> Btw. this works with strtoul.
That would be a bug (depending on your system). 0xFFFFFFFFFFFF00FF
isn't representable as an unsigned long except on 64-bit systems.
> 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.
I believe your testcase is right.
--
- Geoffrey Keating <geoffk@cygnus.com>
More information about the Libc-alpha
mailing list