qbism / q2tools-220

Quake 2 map compiler tools with v220 map support, automatic phong, enhancements, and fixes.
GNU General Public License v2.0
61 stars 20 forks source link

Issues when compiling with MSVC 2019 #12

Closed motorsep closed 2 years ago

motorsep commented 2 years ago

I loaded this solution with MSVC2019 Community with Windows 10 SDK. MSVC asked to convert the projects and I said sure thing.

4bsp/vis/rad seemed to compile with bunch of the following warnings:

warning C4244: '=': conversion from 'double' to 'vec_t', possible loss of data warning C4244: '=': conversion from 'float' to 'int', possible loss of data warning C4018: '<': signed/unsigned mismatch warning C4244: 'return': conversion from '__int64' to 'int', possible loss of data

and stuff like that.

4data failed to compile:

q2tools-220-04-25-21\common\l3dslib.c(68): error C4700: uninitialized local variable 'ptri' used

qbism commented 2 years ago

Just committed initialization of ptri. gcc (and prior version of MSVC?) does not catch that, not even gcc 10 with analyze option.

motorsep commented 2 years ago

Just committed initialization of ptri. gcc (and prior version of MSVC?) does not catch that, not even gcc 10 with analyze option.

Someone suggested to me earlier to do this triangle_t *ptri = 0; and that worked :)

Thanks!

motorsep commented 2 years ago

Alright, tried the fix from the master and it all builds fine (minus all those warnings that are still present) !

qbism commented 2 years ago

Good, I'm flying blind with MSVC. I cross-compile from Linux to generate Windows builds. To supress warnings and weird behavior I suppose someone experienced in MSVC 2019 could do a pull request that ideally does not break 2017.

qbism commented 2 years ago

Appears to be fixed by MSVC project files committed by Paril.