is this a g++ bug or an obscure ISO rule?
Josh Fryman
fryman@cc.gatech.edu
Thu Oct 30 21:16:00 GMT 2003
if i use the code as follows, everything is fine. if i replace the
"int x" with "void * x" (and cast appropriately), i get compiler
errors. i don't see in Stroustrup, 3rd ed, where this is an error
with "void *".
what am i missing? this is g++ 3.1.1 on sun-sparc-solaris2.8.
void
foo::foo_method( void )
{
int x;
void (foo::*ptr)(void) = &foo::foo_method;
x = (int)(this->*ptr);
cout << "foo::foo_method lives at addr " << (int*)x << endl;
}
thanks,
josh fryman
More information about the Gcc
mailing list