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: aj at suse dot de
- Subject: Re: [Various] libc/1864: strtol does not return 0xFFFFFFFFFFFF00FF when fed "0xFFFFFFFFFFFF00FF"
- From: Geoff Keating <geoffk at cygnus dot com>
- Date: Mon, 21 Aug 2000 11:28:23 -0700
- 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>
> 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>