[ub] Remove undefined behavior from the preprocessor

Jens Maurer Jens.Maurer at gmx.net
Mon Oct 14 23:28:39 CEST 2013


On 10/14/2013 03:18 PM, Gabriel Dos Reis wrote:
> Gabriel Dos Reis <gdr at axiomatics.org> writes:
> 
> | Howdy!
> | 
> | At the evening session (Thursday September 26) at the Chicago meeting,
> | there was a consensus expressed that erroneous preprocessor constructs
> | should not be ground for undefined behavior.
> | 
> | The attached PDF file is my current attempt at implementing that consensus.
> | Please read and comment.  Suggestions for improvements, corrections welcome.
> 
> Revision based on feedback attached.
>   - UCN token splicing is made conditionally supported with
>     implementation defined semantics, instead of just ill-formed as
>     proposed earlier.

Aren't there just two options:  Either this becomes a UCN by token splicing,
or it stays a sequence of individual characters?  Can't we just say that?

Isn't 2.2p1 bullet 4 in the same category? 

>   - I left the limit on line-number in expanded form the way it is the
>     current standard, since a change should be coherent with the rest.

16.4p3 should have a cross-reference to annex B.

I don't know what you mean by "coherent with the rest".

Personally, I'd remove "which shall be no less than 2^31-1" and rely
on annex B for the recommended minimum quantity.  (Yes, that changes
the de-jure rules, but de-facto, no implementation will limit to
less than 2^31-1 given the recommendation in annex B.)

Thanks,
Jens


More information about the ub mailing list