On 04/03/13 09:05, Ian MacArthur wrote:
>> void mycallback(widget* w, void* v) {
>>     eop e = (eop) (atoi((char*)v));
> 
> What is it you are trying to do here?

        Probably trying to sidestep the 'precision loss' error from the
        newer compilers due to sizeof(void*) != sizeof(int).

        Using a char* is sizeof() compatible with a void*.

        This was kinda covered last year in STR #2813:
        http://www.fltk.org/str.php?L2813

> We might need to see your code.
> Just tested with gcc 4.7.2 and that works fine...

        Might be a 32bit compile?

        I get the precision loss error when I build that example on 4.4.6 with 
a 64bit box:

$ make foo2
Compiling foo2.cxx...
foo2.cxx: In function 'void cb_item1(Fl_Menu_*, void*)':
foo2.cxx:15: error: cast from 'void*' to 'int' loses precision
make: *** [foo2.o] Error 1

_______________________________________________
fltk mailing list
fltk@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to