On 23.09.2010, at 10:37, MacArthur, Ian (SELEX GALILEO, UK) wrote:
>
>> This ugly hack might sufficiently fool the compiler, at least
>> for another 10 years, LOL:
>>
>> long argument() const {return *((long*)user_data_);}
>>
>> I'm not sure what the 'right' solution is, or if there even
>> is one for what's being done here.
>
> I wondered if we could have #define that resolves to "long long" on
> Win64 and "long" everywhere else and "fix" it that way?
>
> Would that work?
I'm not sure, but I don't think so. The function returns a "long",
and that's documented and shouldn't be changed to protect existing
user code.
The internal user_data member is defined as "void *", and we need
to keep this as well to be able to store real pointers.
IMHO we need a tricky cast and ISTR that someone wrote that Greg's
approach is the "usual" way to avoid such warnings.
Looks at least as if it could solve this and maybe other similar
issues by suppressing the warnings (or maybe even errors in some
cases).
Albrecht
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk