Something just struck me as odd about this.

All these checks of the form:

   if (sizeof(void *) == sizeof(<whatever>))

The compiler must surely evaluate these statically at compile time, and
the optimiser will surely be optimising away the invalid cases... So why
are we getting the warning?

I guess it must be simply because the parser interprets the code, before
the optimiser discards all the invalid bits anyway.

I still think we might be able to do something similar with
pre-processor checks, so discarding the unused code paths before we even
get to the parser...

Unfortunately, I don't know what the pre-processor would have to look
for to make the appropriate decision.

We could do something in configure, of course, to set a macro of our own
devising, but that wouldn't necessarily do for the IDE users out there.


Is there something we should be doing here with the "ptrdiff_t" type to
make this code not trigger the compile time warning?


SELEX Galileo Ltd
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 
3EL
A company registered in England & Wales.  Company no. 02426132
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************

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

Reply via email to