Patch to fix handling of incomplete header names

Joseph S. Myers jsm@polyomino.org.uk
Thu Feb 5 21:41:00 GMT 2004


On Thu, 5 Feb 2004, Zack Weinberg wrote:

> You can check the patch in if and only if you file a defect report
> proposing the changes outlined in
> http://groups.google.com/groups?selm=9e4ejk%24d06%241%40nntp.Stanford.EDU

Derek Jones has early draft DR proposals for two defects related to greedy
lexing that will allow the committee to revisit the whole question of the
lexing algorithm.  I do not know what proposed resolutions might be
included in such DRs (and quite plausibly the UK C Panel could agree on
the presence of defects, and so on the submission of DRs, while
disagreeing on the appropriate resolution).

The known provable defects are:

(a) The list of phases of translation refers to partial preprocessing
tokens, but there is currently no such thing.  The possible prefixes of
preprocessing tokens that are not themselves preprocessing tokens (so
requiring a lexer to back up or look ahead) are tentatively identified as:

> >>   ..
> >>   %:%
> >>   sequences beginning ' L' " or L" that are not properly formed
> >>   sequences beginning < that are improperly formed header-names

(b) Footnote 64 says (of escape sequences) "If any other character follows
a backslash, the result is not a token and a diagnostic is required.".  
But the syntax of string and character constants doesn't permit any other
characters to appear like that; if they do, the quotes are individual
tokens and there is undefined behavior (no diagnostic required),
regardless of whether that preprocessing token gets converted to a token.

-- 
Joseph S. Myers
jsm@polyomino.org.uk



More information about the Gcc-patches mailing list