Can fts_open() be constified further?
Yar Tikhiy
yar at comp.chem.msu.su
Sun May 28 09:43:35 PDT 2006
Hi folks,
Currently, fts_open() is declared as follows:
FTS *
fts_open(char * const *path_argv, int options,
int (*compar)(const FTSENT * const *, const FTSENT * const *));
This means that one cannot pass pointers to constant strings in
path_argv[] without getting rather justified warnings from cc.
AFAIK, fts(3) functions aren't supposed to modify the path strings.
Hence the prototype asks to be changed slightly:
fts_open(const char * const *path_argv, int options,
^^^^^
This shouldn't break fts consumers because a pointer to a variable
can be converted to a pointer to a constant w/o warnings (but not
the other way around.) Can anybody see other possible side effects
from such change?
--
Yar
More information about the freebsd-arch
mailing list