[PATCH] Generalized attribute support

Aaron Ballman aaron at aaronballman.com
Wed Jan 15 06:58:08 PST 2014


On Wed, Jan 15, 2014 at 6:59 AM, Alp Toker <alp at nuanti.com> wrote:
>
> On 15/01/2014 11:41, Alp Toker wrote:
>>
>>
>> On 15/01/2014 06:04, Nico Weber wrote:
>>>
>>> Does gcc allow this for C? Is C planning on standardizing this?
>>
>>
>> The impression I get is that everybody's doing it but nobody's talking
>> about it. Yet.
>>
>> ISO C is reactionary so if we set a sensible standard there's a reasonable
>> shot at getting it adopted. Likewise OpenMP and other dialects -- they'll go
>> with the mainstream.
>>
>> This is also why we should use a name that's already recognised like
>> "generalized attributes." Language bodies simply won't accept a foreign name
>> like "C++ attributes" -- it has never happened before, given how fiercely
>> independent these committees are -- so they'll end up each going their own
>> route, choosing their own names. It's a better plan to consolidate
>> proactively here.
>
>
> To be clear, this isn't just about naming. The syntaxes will also end up
> differing if we end up with disparate "C++ attributes", "OpenMP attributes",
> "OpenCL attributes" (?), "C attributes"  -- potentially a bunch of different
> specifications and quirky parse rules with no way out.

We're already in this situation today, even within the "same"
language. C++11 uses [[]] while C++/CLI uses []. The last time this
came up in the C committee (from what I understand) was 2009 (N1403)
and leaned towards __attribute__ as the specifier. So I don't think
there's a way we can push this as a cross-language "generalized"
attribute feature.

~Aaron



More information about the cfe-commits mailing list