[Scummvm-devel] Re: [Scummvm-cvs-logs] SF.net SVN: scummvm: [21824] scummvm/trunk/engines/sky

Max Horn max at quendi.de
Wed Apr 12 04:06:01 CEST 2006


Am 12.04.2006 um 12:01 schrieb khalek at users.sourceforge.net:

> Revision: 21824
> Author:   khalek
> Date:     2006-04-12 03:01:41 -0700 (Wed, 12 Apr 2006)
> ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=21824&view=rev
>
> Log Message:
> -----------
> sizeof(void *) != sizeof(int) for a large number of systems.
> Fix a lot of debug/error statements that were using %d/%x
> for the result of pointer arithmetic.
>
> As C++ apparently has no format string for ptrdiff_t use
> %lu/%lx as appropriate.


Unfortunately, that change isn't correct either. While maybe now you  
are warning free on a 64bit system, now I get lots of warnings on my  
32bit system, because *here* pointer diffs are not long int, but  
rather int.

Neither C nor C++ define a printf extension for handling pointer  
diffs. The only way we can deal with them "portably enough" would be  
to explicitly case the diffs to int or long. In most cases, int  
should be sufficient, since we know that the correct diffs will be  
small, even on a 64bit system. Though we can also use long, I don't  
mind which one is used.

As it is, I can't compile ScummVM with -Werror anymore. :-(


Cheers,
Max





More information about the Scummvm-devel mailing list