[ub] Remove undefined behavior from the preprocessor

Gabriel Dos Reis gdr at microsoft.com
Mon Oct 14 23:58:17 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?

A third option is "ill-formed".  I don't think we should get down to that
level of detail here.  I would rather leave it to implementations and tools
whether they want to support clean mode (diagnose), garbage mode (individual
characters), or make sense of it (implementation-defined semantics.)

-- Gaby



More information about the ub mailing list