[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: To allow hex and oct %token values
From: |
Odd Arild Olsen |
Subject: |
Re: To allow hex and oct %token values |
Date: |
Fri, 5 Mar 2004 09:07:08 +0100 |
User-agent: |
KMail/1.5.1 |
On Thursday 04 March 2004 16:35, Tim Van Holder wrote:
(...)
> The main problem is that this is a breaking change - the (few) people
> that felt the need to specify specific token numbers may have done so
> like this:
>
> %token FOO 0800
> %token BAR 0801
> ...
> %token XYZZY 1077
>
> which is valid according to the current situation. With your change
> however, it breaks completely.
I see, I'm used to C and did not imagine that anyone would start a decimal
number with a 0 :)
> Aside from the fact that you should
> check that strtoul was able to parse the entire token and given an error
> if not, the above can no longer work (FOO and BAR would likely both get
> value 0 or ULONG_MAX, for example, as strtoul will error out when it
> hits the 8, which isn't a valid octal digit).
Correct,
> Adding hex support would not cause such breakage, and may be a valid
> extension to consider.
> I'm also not sure how such changes would impact POSIX compliance.
Thanks for considering the proposed change.
--
Odd Arild Olsen