bug-global
[Top][All Lists]
Advanced

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

Re: addition of a new keyword


From: Shigio Yamaguchi
Subject: Re: addition of a new keyword
Date: Wed, 11 Aug 2004 21:50:38 +0900

> I tried to add support of keyword __thread which was introduced in GCC-3.3.
> Gperf caused an error. What should I do?
> 
> 
> + gperf '--key-positions=1-3,6,$' --language=C --struct-type --slot-name=name
 --hash-fn-name=cpp_hash --lookup-fn-name=cpp_lookup
> 
> Internal error, duplicate value 82:
> try options -D or -r, or use new key positions.

You should teach gperf(1) which character should be used in a keyword
to calculate the unique hash value.
The --key-positions option is hard coded in gctags/reserved.pl.

[gctags/reserved.pl]
        #
        # This value should be maintained according to the value of
        # the reserved words.
        #
        if ($prefix eq 'php') {
                print "--key-positions=1-2,4-6,9,\$\n";
        } else {
                print "--key-positions=1-3,6,\$\n";
        }

Maybe, adding C++ case is required.

        } elsif ($prefix eq 'cpp') {
                gperf --key-position='<key position for cpp keyword>'
        }

The question is how to find the key position for C++ keyword.
It seems that we can do nothing but try and err.

For example, try 
        --key-position='1-3,7-8,$'
or
        --key-position='1,3,5,7,9,$'
or
        --key-position='2-5,7-9,$'
        ...
until becoming error-free. But we can select the -D option instead.
--
Shigio Yamaguchi <address@hidden> - Tama Communications Corporation
PGP fingerprint: D1CB 0B89 B346 4AB6 5663  C4B6 3CA5 BBB3 57BE DDA3




reply via email to

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