C++11 attributes for C11 (was Re: [PATCH] Generalized attribute support)

Aaron Ballman aaron at aaronballman.com
Mon Apr 21 14:04:24 PDT 2014


On Sat, Apr 19, 2014 at 7:05 PM, Alp Toker <alp at nuanti.com> wrote:
> Small update for the list..
>
> We discussed this at LLVM Europe 2014 and came to the conclusion that we
> might as well offer the feature behind an -f flag.
>
> This should satisfy user requests for C++11-style attributes in C11 without
> prejudicing any standards process.

Why just C11? If we're using a feature flag, wouldn't it make sense to
expose this for C++98, or C99, or ObjC (presuming there are no
ambiguities)?

> Thanks to the many detailed use-cases
> people sent in that have made me more comfortable picking this up again.
>
> So, I've got a slightly improved version of the patch and will aim to rebase
> and post it to the list for review in the coming weeks.
>
> All we need now is great name for the -f flag ;-)

I like my bikesheds to be blue!

-fcxx-style-attributes
-fcxx-attributes

I don't have a strong opinion on the name, but I do think that the
feature flag should warn in nonsense situations (for instance
-fno-cxx-attributes -std=c++11), or maybe even -fcxx-attributes
-std=c++11 (since it's redundant, but I'm less tied to this).

~Aaron



More information about the cfe-commits mailing list