tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: iconv(3) and POSIX

On Tue, Jan 08, 2013 at 07:03:25PM -0500, Greg Troxel wrote:
> It turns out this is more subtle.  James suggested that "const char **"
> as an argument type was not problematic, because a "char **" would be
> promoted.  That observation seemed entirely correct and reasonable to
> me.  ...

The problem is likely to caused by the fact that, although you can
pass a 'char *' to function that expects a 'const char *' you can't
pass a 'char **' to a function that expects a 'const char **'.

So when compilers started supporting function prototypes adding
'const' required many callers to change.
Interestingly it seems to have been done for execve().


David Laight:

Home | Main Index | Thread Index | Old Index