This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Question involving const-value qualifiers in c++...
- To: gcc at gcc dot gnu dot org
- Subject: Question involving const-value qualifiers in c++...
- From: John Schmerge <schmerge at cyber dot com>
- Date: Tue, 06 Feb 2001 16:22:44 -0500
Hello Everyone,
Forgive me for sending this question to a list that probably has seen this
question several times before, but I am wondering whether it should be legal to
pass a 'char **' to function that requires a 'const char **'...
I know that:
1. it makes sense to be allowed to do this... All you are doing is trying to
obtain a guarantee that your pointer's pointer's contents do not get modified
when you call the function.
2. The standard makes nice provisions for things like the type 'const char **
const' to automatically be folded into 'const char **' as the function name gets
mangled...
3. gcc/g++ 2.95.2 generates an error when passing a 'char **' to a func
requiring a 'const char **'...
Is this correct behaviour? (Please CC. me on a response, as I do not subscribe
to the gcc mailing list).
Thanks,
-JS
---------------------------
John Schmerge
schmerge@cyber.com