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]

c++ cast bug ?



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." 


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