0x47e+barney not considered C

Jerry Schwarz jss at hector.UUCP
Sun Jul 3 03:06:20 AEST 1988


In article <11445 at steinmetz.ge.com> davidsen at crdos1.UUCP (bill davidsen) writes:
>In article <10413 at ulysses.homer.nj.att.com> jss at hector (Jerry Schwarz) writes:
>
>| I believe an explicit syntax for pp-numbers is required.  The "0xe+b"
>| example points to a flaw in the current definition. But, in my
>| opinion, it is a minor flaw and does not require a change at this
>| stage in the standardization process.
>
>  I hate to say this, but a bad standard which breaks existing programs
>should not be rushed out the door, even if everyone is tired of working
>or waiting on it. If it breaks existing programs, there better be a
>better rationale than the convenience of the compiler implementors. If
>this really was the intent that hex number ending in e can't be followed
>by a variable, then I don't see any rationale at all. If the wording is
>poor it should be changed.
>

My purpose in proposing pp-numbers was ease of understanding of the
rules. That would frequently make it easier to implement, but that is
a happy side effect not the motivation.

I suppose "rush" is a subjective notion, but given the time that has
elapsed since the committee began work nothing that emerges at this
point would seem rushed to me.

If you believe that any standard that breaks any existing program is
bad then I'm afraid you will have to accept a bad standard.  There
are several points at which the current proposal may break existing
K&R programs.  See the "silent changes" discussed in the rationale.

>  Was it intended that exponentiol value be allowed on hex (and I assume
>octal) values? If so, how about fractional values, such as "0x1ea.b", or
>even worse "0x1ea.e+2"? Is the final e a fractional part or an exponent?
>

I can't speak to what the committee believes, but my intention when I
proposed pp-numbers was that all of these are pp-tokens.  They are
not, however, legal tokens.  Because they are illegal tokens it makes
no sense to ask what the "." or the "e+" are. As I pointed out in my
earlier note, the committee has always had a vague notion of "illegal
token".  The syntax of pp-number is intended to be part of the
formalization of that notion. Any change for "0xe+y" should not change
the status of the above.

>  I will assume that the committee intended this to work as it always
>has, and not have a program which will fail if there is no whitespace
>somewhere. This should just be an editorial change.

Whitespace has always been required in some contexts.  A well known
example is "x+++++y"  versus "x++ + ++y".



More information about the Comp.std.c mailing list