FYI
I wanted to experiment with perfect hash functions and tables because it was mentioned in this video.
https://www.youtube.com/watch?v=DMQ_HcNSOAIThis is my input file keywords.gperf.
struct month { char *name }
%%
january
february
march
april
may
june
july
august
september
november
december
Then a command "
gperf keywords.gperf > perfhash.c"
gave me (among other useless C-code) a hash function that returns 0.
static unsigned int
hash (register const char *str, register size_t len)
{
(void) str;
(void) len;
return 0;
}
Some people get proper hash functions so something is wrong in my input. I didn't find any simple example tutorial.
Anyway, always something happens with C-code...