1
0
mirror of https://git.savannah.gnu.org/git/gperf.git synced 2025-12-02 13:09:22 +00:00

Avoid "gcc -Wunused-parameter" warnings on the generated hash function.

Reported by Vinícius dos Santos Oliveira <vini.ipsmaker@gmail.com> in
<https://savannah.gnu.org/bugs/index.php?64393>.

* src/output.cc (Output::output_hash_function): If str is not used, emit
a cast from str to void. If len is not used, emit a cast from len to
void.
* tests/permut2.exp: Update.
* tests/permut3.exp: Likewise.
* tests/permutc2.exp: Likewise.
This commit is contained in:
Bruno Haible
2023-07-08 12:30:47 +02:00
parent 2173338a30
commit 91ed1621cc
5 changed files with 37 additions and 7 deletions

View File

@@ -122,6 +122,7 @@ hash (register const char *str, register size_t len)
8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8, 8
};
(void) len;
return asso_values[(unsigned char)str[1]+3] + asso_values[(unsigned char)str[0]];
}