[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug in #include guards
From: |
Alexander Belopolsky |
Subject: |
Re: Bug in #include guards |
Date: |
Tue, 2 Oct 2001 12:28:58 -0400 (EDT) |
Akim Demaille writes:
> >>>>> "marc-alexandre" == marc-alexandre autret <address@hidden> writes:
> Don't go into the hexa stuff please, `_' is fine for non
> alphanumeriscoral characters.
>
I disagree. The whole point of include guards is that they are unique
and no two files can ever have the same guards. If you replace
non-alphanumeric characters with _ it is possible to have include
files with different names but the same include guard. At least three
non-alphanumeric characters from the basic character set: '/', '.' and
'-' are very commonly used in include file names. Three more ':', ','
and '+' are less common, but not unheard of. If you fold them all
(and '_' itself) into '_' there is high risk of collision.
However I am not particularly keen on 'hexa stuff', if you suggest any
other scheme that produces unique guards from path names I can recode
my patch.
--
Alexander Belopolsky | Renaissance Technologies Corp.
600 Route 25A | East Setauket | NY 11733-1249
PH: 631-444-7125 | FAX: 631-444-7009