[Scummvm-devel] g++ 3.4 patch

Falk Hueffner falk.hueffner at student.uni-tuebingen.de
Mon Aug 18 14:21:04 CEST 2003


Hi,

I just tried to compile CVS. g++ 3.4 with -pedantic won't accept
spurious semicolons. It also warns about -Wstrict-prototypes (which
doesn't make sense for C++). Patch attached.

Also, I noticed that SCUMM_NEED_ALIGNMENT tries to detect whether
unaligned accesses "work". Unfortunately, this is bogus; many systems,
like Alpha, don't support unaligned accesses, but catch them with a
trap, fix them in kernel space and continue. Therefore, it will appear
they work; only they slow down the program by a factor of 100. The
only reasonable method is to hardcode architectures where it is known
that unaligned accesses are OK and fast.

Anyway, I doubt it is of much use for code like this:

#if defined(SCUMM_NEED_ALIGNMENT)
			memcpy(dst, src, 8);
#else
			((uint32 *)dst)[0] = ((const uint32 *)src)[0];
			((uint32 *)dst)[1] = ((const uint32 *)src)[1];
#endif

If gcc doesn't generate optimal code for memcpy(dst, src, 8) for your
platform, you should rather file a bug report against gcc than kludge
around it.

Oh, and if you're that interested in performance, you should compile
with -O2 or -O3, -O doesn't really do a lot of optimizations.

Hrm. It compiles then, but DOTT crashes in the intro on Alpha. I'll
try to debug it...

-- 
	Falk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: scummvm-compile-fix.patch
Type: text/x-patch
Size: 32915 bytes
Desc: not available
URL: <http://lists.scummvm.org/pipermail/scummvm-devel/attachments/20030818/f71f586d/attachment.bin>


More information about the Scummvm-devel mailing list