Hi Tobias,

one quick remark regarding POSIX:

The relevant text is

  http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html

section 12.1 Utility Argument Syntax, number 6.

Together with

  http://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html

we have the following consequences:

 * The minimum range we must support is 0 to 2147483647.
 * We are allowed to support a larger range if we want to.
 * Behaviour for integers out of the supported range
   appears to be unspecified.

If i read that correctly, both our current implementation, and the
new syntax and semantics with unlimited range that you propose, are
allowed by POSIX.

I agree that supporting an unlimited range is better and safer,
in particular if it can be done without excessive complication
of the code.


> - Numbers are always base 10, regardless of starting with 0

Yes, that is definitely required.

> - A number can start with arbitrary amounts of whitespaces
> - Then a sign char is allowed (POSIX only mentions -)

I don't think also accepting '+' does any harm - quite to the contrary,
given that we currently accept it, we should continue doing so.

> - An arbitrary amount of digits follows
> - Then an arbitrary amount of whitespaces can follow

I agree that discarding leading and trailing whitespace can do
no harm.  When unquoted, such whitespace is already stripped by
argument parsing, so it seems less surprising to also ignore it
when quoted.

Note that i did not inspect your patch yet.

Yours,
  Ingo

Reply via email to