I like your solution (to not warn for underscore keywords). If this type of check is ever needed, it can be implemented outside the core lexer/preprocessor.
snaroff On Sep 2, 2008, at 8:34 PM, Eli Friedman wrote: > On Tue, Sep 2, 2008 at 11:50 AM, Steve Naroff <[EMAIL PROTECTED]> > wrote: >> - Replace FIXME in Preprocessor::HandleIdentifier() with a check >> that avoids diagnosing extension tokens that originate from macro >> definitions. >> >> + // We avoid diagnosing tokens that originate from macro >> definitions. >> + if (II.isExtensionToken() && Features.C99 && ! >> DisableMacroExpansion) >> Diag(Identifier, diag::ext_token_used); > > I think the right solution here is just to not warn for reserved > keywords (those starting with two underscores or an underscore plus a > capital letter). Allowing such keywords without a warning doesn't > affect standards-compliance (C99 7.1.3p2, and similar passages in all > the other C/C++ standards). The only reason I can imagine why anyone > would care to see warnings about them would be some sort of > portability checker, which isn't normal usage, and probably doesn't > belong in the main compiler. > > If we do that, whether the identifier comes out of a macro doesn't > matter; system headers can't use plain versions of extension keywords > anyway because they would break in any mode which didn't include them. > > -Eli _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
