Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Jan 2005 01:47:53 +0300
From:      Andrey Chernov <ache@nagual.pp.ru>
To:        Joerg Wunsch <joerg_wunsch@uriah.heep.sax.de>
Cc:        bde@FreeBSD.ORG
Subject:   Re: Implementation errors in strtol()
Message-ID:  <20050120224753.GB71573@nagual.pp.ru>
In-Reply-To: <20050120223232.GF30862@uriah.heep.sax.de>
References:  <20050120192324.GA30862@uriah.heep.sax.de> <20050120205501.GA69123@nagual.pp.ru> <20050120211449.GC30862@uriah.heep.sax.de> <20050120214406.GA70088@nagual.pp.ru> <20050120220227.GB70629@nagual.pp.ru> <20050120223232.GF30862@uriah.heep.sax.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Jan 20, 2005 at 11:32:32PM +0100, Joerg Wunsch wrote:
> You can perform a conversion on any valid subject sequence (that ``has
> the expected form'').  The optional sign is part of the valid
> sequence.

As you (and POSIX) say, it is only PART of the valid sequence, but not 
whole valid sequence which could be converted.

> Thus, we do have a subject sequence of the ``expected form''.  Any
> such sequence is convertible per definitionem.

This is just your speculation about what "expected form" is. But POSIX 
clearly says, what expected form is:

"If the value of base is 0, the expected form of the subject sequence is 
                            ^^^^^^^^^^^^^^^^^^^
that of a decimal constant, octal constant, or hexadecimal constant, any 
of which may be preceded by a .+. or .-. sign."

No CONSTANT found in just +- case.

Next, lets see what expected form is, if base is nonzero:

"If the value of base is between 2 and 36, the expected form of the 
                                           ^^^^^^^^^^^^^^^^^
subject sequence is a sequence of letters and digits representing an 
integer with the radix specified by base, optionally preceded by a .+. or 
.-. sign."

The same no SEQUENCE OF LETTERS AND DIGITS found in just +- case.

As I say, read POSIX, please.

-- 
http://ache.pp.ru/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050120224753.GB71573>