This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
c++ cast bug ?
- To: gcc at gcc dot gnu dot org
- Subject: c++ cast bug ?
- From: John Levon <moz at compsoc dot man dot ac dot uk>
- Date: Thu, 20 Sep 2001 04:52:22 +0100
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."