c++ cast bug ?

John Levon moz@compsoc.man.ac.uk
Wed Sep 19 20:52:00 GMT 2001


in 3.0.1 but also in rh gcc 2.96 :

void opp_get_options(int argc, char const *argv[])
{
	...
       /* Some old version of popt needs the cast to char ** */
       optcon = poptGetContext(NULL, argc, const_cast<char **>(argv), options, 0);


compiling this c++ :

oprofpp.c:143: cannot convert `char **' to `const char **' for argument
`3' to `poptGetContext (const char *, int, const char **, const
poptOption *, int)'

how can this be right (where is implicit cast to const version of char **) ? 

if it's wrong or not, how do I fix my code to work ?

thanks
john

-- 
"If you're not part of the problem, you're part of the problem space." 



More information about the Gcc mailing list