DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR Pending]

Link: http://www.fltk.org/str.php?L2308
Version: 1.3.0


Albrecht, you said: This *might* be okay as long as the callback is defined
as my_callback(Fl_Widget*, long), but what if it is defined as
my_callback(Fl_Widget*,void *v), and the code casts the given argument
like "long my_arg = (long)v" ? What if the same is done on a big-endian
and on a little-endian machine?

To answer your questions: nothing is going to happen. As long as I use
"long" to read and write, and the "void*" is equal in size or bigger, the
"junk" bits will be clipped by the casts, no matter if that will be the
first bits or last bits (MSB, LSB). The "union" approach would also always
work.

I feel like this is an overly protective default compiler option. The user
should set this to a warning, if at all.

Oh, and there is a perfect solution, too: we can have two member
variables, a pointer AND a long. But that needs more space and would be
incompatible to existing code.


Link: http://www.fltk.org/str.php?L2308
Version: 1.3.0

_______________________________________________
fltk-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-bugs

Reply via email to