gerstrong / Commander-Genius

Modern Interpreter for the Commander Keen (Vorticon Dreams and Galaxy) and also Cosmos Cosmic Adventure games. This is a mirror repo: The main gitlab repository is at: https://gitlab.com/Dringgstein/Commander-Genius
http://clonekeenplus.sourceforge.net/
Other
192 stars 36 forks source link

v2.8.2.5 build fails on ARMv7 platforms #364

Closed rtissera closed 3 years ago

rtissera commented 3 years ago

Hello,

CCarmack.cpp: In function ‘void CarmackExpand(void, void, int)’: CCarmack.cpp:43:26: error: cast from ‘uint8_t’ {aka ‘unsigned char’} to ‘uint16_t’ {aka ‘short unsigned int’} increases required alignment of target type [-Werror=cast-align] cc1plus: some warnings being treated as errors

I know I can easily workaround this by tweaking compiler flags but I think it was worth reporting the issue.

gerstrong commented 3 years ago

Hi, thanks for reporting. Lately there were Carmack fixes, so possibly that brought us the problem. Unfortunately I cannot reproduce it. If you want, feel free to fix it. I'd have some ideas how to get this working correctly. Is that okay for you?

rtissera commented 3 years ago

Hello,

Yes, totally willing to fix it, I workaround by removing -Werror=cast-align right now but tink it's it's definitely needed to have proper alignment for ARM 32 bit platforms. Feel free to share ideas (properly aligning the offending allocated memory area ?)

gerstrong commented 3 years ago

We should not deal with such workaround.

I was thinking about replacing _reintepretcast by some memcpy. Do you think that would solve your problem?