wrljet / hercules-helper-windows

Utility scripts to help with building and deploying the Hercules emulator on Windows
MIT License
13 stars 3 forks source link

Warning C4789 treated as error - Link fails #12

Open vbandke opened 2 weeks ago

vbandke commented 2 weeks ago

I have been building hercules with the splendid hercules-helper-windows quite a few times now, with no issues. But today, when trying to get the latest and greatest hercules version, I run

.\hercules-buildall.ps1 -VS2022 -BuildDir D:\UTI -Flavor SDL-Hyperion -GitBranch develop

from my unchanged (!) hercules.helper directory and got

D:\Uti\sdl-hyperion\general1.c(2269) : error C2220: the following warning is treated as an error
D:\Uti\sdl-hyperion\general1.c(2269) : warning C4789: in function 'z900_compare_and_form_codeword' buffer 'tmp' of size 16 bytes will be overrun; 16 bytes will be written starting at offset 16
D:\Uti\sdl-hyperion\general1.c(2240) : warning C4789: in function 'z900_compare_and_form_codeword' buffer 'tmp' of size 16 bytes will be overrun; 16 bytes will be written starting at offset 16
LINK : fatal error LNK1257: code generation failed

I did see that warning on earlier builds. but they were not converted to errors then. Probably this is error 30 ("The error is 30 inches in front of the screen"). What am I overlooking/doing incorrectly/having misunderstoood?

With best regards Volker Bandke

wrljet commented 2 weeks ago

Volker,

Hmm... "It works for me" (tm)

This has come up a few times recently as MSVC releases seem to be getting more annoying with their incorrect warnings. We have made changes to SDL-Hercules, as you noticed, to try to keep up with it, but it is a moving target.

Please try adding the -ForceClone switch to your command line, just to make sure you have the latest of those changes. Note, this will override your git repo and blow away any local changes.

If that doesn't fix it, please send me the hercules-helper log file so I can compare MSVC version with what I have here. I seem to be running MSVC 2022 17.11.2. There is a slightly newer 17.11.5. But I'd like to hear back before I update to that version.

Thanks, Bill