Greg Hudson <ghudson@MIT.EDU> writes:
> It wasn't "const char *const *argv" before because a "char **"
> argument is not compatible with such a parameter, and C programs
> canonically take "char **argv", not "const char *const *argv". I'm
> not sure if it's even valid C to silently change from char * to const
> char * without an explicit cast, which is what you'd be doing if you
> wrote a main() which accepted a list of const char pointers intead of
> a list of char pointers.
> (Branko said this as well, in different words.)
Just to second William Rowe's point about this, since we're trying to
use const wherever possible (in both APR and Subversion, I think):
Const is only important in lvalues. The rules are
1. It's okay to not modify something you were allowed to modify.
2. It's not okay to modify something you were not allowed to modify.
Const doesn't change the type (storage size) of anything. So a callee
can *always* add a const qualifier to its parameters, as long as it
then keeps that promise to never modify the data.
Received on Sat Oct 21 14:36:15 2006