tfind missing a const qualifier.

Collin Funk collin.funk1@gmail.com
Thu Apr 24 03:28:03 GMT 2025


Hi,

While testing gnulib I noticed that tfind on cygwin is defined like:

    void *tfind (const void *, void **,
                 int (*) (const void *, const void *));

But POSIX requires [1] (*):

    void *tfind (const void *key, void *const *rootp,
                int (*compar) (const void *, const void *));

For programs written expecting the POSIX prototype, there will be many
warnings that 'rootp' has it's const qualifier discarded.

Collin

[1] https://pubs.opengroup.org/onlinepubs/9799919799/functions/tfind.html

(*) Ignoring the fact that POSIX.1-2024 added the requirement for
'typedef void posix_tnode;'.


More information about the Cygwin mailing list