bug-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Conflicts with header guards


From: Akim Demaille
Subject: Re: Conflicts with header guards
Date: Tue, 25 Sep 2012 10:15:31 +0200

Le 21 sept. 2012 à 18:22, Paul Eggert a écrit :

> On 09/21/2012 02:42 AM, Akim Demaille wrote:
>> we should at least always start
>> with YY_ to stay within our realm:
>> 
>>   foo/bar.hh    -> YY_YY_FOO_BAR_HH
>>   0foo--bar12.h -> YY_YY_0FOO_BAR12_H
>> 
>> (two YY_: one for Bison, the other for the prefix)
> 
> That should work, but can't we shorten the second prefix
> to something simpler, like "_"?  That way, the symbols
> would be YY__FOO_BAR_HH, which is a bit more palatable.

Suppose someone has the brilliant idea to have:

   src/lang1/parser.y
   src/lang2/parser.y

and that lang1/parser.y has %prefix "lang1", likewise
for lang2/parser.y, then if we smash both YY_LANG1_PARSER_H
and YY_LANG2_PARSER_H to YY__PARSER_H, we lose.  Unless
I have misunderstood your suggestion.

Frank has a point on _INCLUDED too, this way, since there
is little chance that we ever introduce a YY_*_INCLUDED macro,
we should be completely safe.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]