This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Question involving const-value qualifiers in c++...


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]