Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 May 2006 20:43:28 +0400
From:      Yar Tikhiy <yar@comp.chem.msu.su>
To:        freebsd-arch@freebsd.org
Subject:   Can fts_open() be constified further?
Message-ID:  <20060528164328.GA84031@comp.chem.msu.su>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060528164328.GA84031>