Re: [hatari-devel] windows build failing on cirrus-ci

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hi,

On 24.4.2024 17.16, Nicolas Pomarède wrote:
since patch "Add autoload support also for TOS debug symbols"

the windows build is failing with lots of similar errors about size_t / int conversions :

see https://cirrus-ci.com/task/5677615988604928

for example

src\debug\symbols-common.c(81,1): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data [C:\Users\ContainerAdministrator\AppData\Local\Temp\cirrus-ci-build\src\debug\Debug.vcxproj]

Eero can you have a look to find a common solution for Windows too ?

It's complaining about assigning strlen(), for a debug symbol name, to an int.

Although Windows build would be 32-bit, it's quite unlikely that debug symbol names within Atari programs, even C++ ones, are so long that they would occupy more than 2GB of memory...


And when looking at the other size_t -> int conversion warnings, those appear to be even more stupid.

According to warnings line & column values, it's complaining that in something like:
	reads += fread(&prgflags, sizeof(prgflags), 1, fp);

The value 4 returned by sizeof() for uint32_t variable, is so large that it does not fit into int. On a function, where that argument is actually supposed to be of size_t type, not int. And it wars only of some of those calls, not all of them...

In case that VS just happens to show wrong column for the error, I've changed fread() return values to be stored into size_t variable in symbols-common.c. Let's see whether that lessens the number of warnings.


	- Eero



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/