[cfe-dev] How to deal with mangled names matching with extern "C" ones?

Aaron Ballman aaron at aaronballman.com
Tue Jul 7 07:50:31 PDT 2015


IIRC, we already have a warning for defining identifiers with reserved
names, but I think we only do it for macros. (See
-Wreserved-id-macro). We may be able to expand that to defining any
reserved identifier, but since those are reserved for the
implementation namespace, I am uncertain of how well that would play
with things that can legitimately use the implementation namespace and
use Clang to compile (like libc++).

~Aaron

On Tue, Jul 7, 2015 at 10:44 AM, Andrey Bokhanko
<andreybokhanko at gmail.com> wrote:
> Hmmm, maybe we should just check that identifiers don't start with
> _[A-Z] and print an error if they are?
>
> Richard [Smith], what do you think?
>
> Yours,
> Andrey
>
>
> On Tue, Jul 7, 2015 at 2:39 PM, Renato Golin <renato.golin at linaro.org> wrote:
>> On 7 July 2015 at 12:20, Stephan Bergmann <sbergman at redhat.com> wrote:
>>> [lex.name]/3.1: "Each identifier that contains a double underscore __ or
>>> begins with an underscore followed by an
>>> uppercase letter is reserved to the implementation for any use."
>>
>> Right, I always forget the _[A-Z] case. I guess how we deal with this
>> is up to interpretation.
>>
>> cheers,
>> --renato
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev



More information about the cfe-dev mailing list