[PATCH] Emit an extension warning when changing system header tokens

Reid Kleckner rnk at google.com
Mon Dec 2 17:29:52 PST 2013


Looks good to me.


On Thu, Nov 28, 2013 at 4:27 AM, Alp Toker <alp at nuanti.com> wrote:

>  clang converts keywords to identifiers for compatibility with various
> system headers such as GNU libc.
>
> The attached patch adds an extension warning diagnostic in those cases.
> The warning is typically ignored by default when the issue is encountered
> in system headers, but can be enabled to aid in standards conformance
> testing.
>
> This also changes the __uptr keyword avoidance from r195710 to not be
> special-cased for system headers now that a warning is in place, bringing
> it in line with other similar workarounds in clang.
>
> Some examples:
>
> warning: keyword '__is_pod' will be treated as an identifier for the
> remainder of the translation unit [-Wkeyword-compat]
> struct __is_pod
>
> warning: keyword '__uptr' will be treated as an identifier here
> [-Wkeyword-compat]
> union w *__uptr;
>
> Alp.
>
> -- http://www.nuanti.com
> the browser experts
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131202/1cd2dda4/attachment.html>


More information about the cfe-commits mailing list