Phil Thompson <[EMAIL PROTECTED]> writes:

> Is it invalid C++ to assign something to a void * without a cast? (I
> know its invalid to do the reverse.)

I don't know about C++, but the following piece of C-code does not pass
"gcc -Wall -ansi -pedantic":

int func() {
}

int main() {
  void *foo = func;

}

[0] palpatine:~ -> gcc -Wall -ansi -pedantic foo.c
foo.c: In function `func':
foo.c:3: warning: control reaches end of non-void function
foo.c: In function `main':
foo.c:6: warning: ANSI forbids initialization between function pointer and `void *'
foo.c:6: warning: unused variable `foo'
foo.c:8: warning: control reaches end of non-void function

/Jesper
-- 
-------------------------------------------------------------------------
Jesper Eskilson                                         [EMAIL PROTECTED]
Virtutech                                         http://www.virtutech.se
-------------------------------------------------------------------------


_______________________________________________
PyKDE mailing list    [EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde

Reply via email to