[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gperf bug
From: |
Morten Welinder |
Subject: |
gperf bug |
Date: |
25 Jun 2001 14:33:43 -0000 |
Hi,
when gperf 2.7 is run with the arguments
gperf -c -a -E -C -t -L C++ -Z MYCLASS -H hash -N lookup -k 1-5 -T -o
myfile.gperf
it will generate code like
-----------------------------------------------------------------------------
/* C++ code produced by gperf version 2.7 */
...
inline unsigned int
MYCLASS::hash (register const char *str, register unsigned int len)
{
...
}
...
register int key = hash (str, len);
if (key <= MAX_HASH_VALUE && key >= 0)
-----------------------------------------------------------------------------
Clearly, "key" should be unsigned and the wasteful test against 0 should
be eliminated.
(And perhaps gperf should use C++ comments in C++ mode.)
Morten
- gperf bug,
Morten Welinder <=