OpenTTD

Login!
Register as a new userLost password?

for Project:

FS#1997 — Several warnings and one error (VS9/x64)

Attached to Project— OpenTTD
Opened by Rindvieh (Rindvieh) - Thursday, 08 May 2008, 12:59AM
Bug Report
Build system / Makefile
New
No-one
Windows
High
Normal
Devel (specify rev)
Undecided
Undecided
0%
Hi,

I try to compile the current rev 13001 on Vista with VS9 and for 64bit (if I switch to 'normal' 32bit all is OK).

Current are 73! warnings, yesterday it was ~68 and two days before ~63 (the error is since today). I would say: the wrong way ;) .

Attached the compile log. It's german, but this shouldn't a problem. The warnings are all "conversion from ... to ..." and the error "negative index".

Cheers,
Rindvieh  x64-compile_warnings.txt
This task depends upon

This task blocks these from closing
Comment by Loïc GUILLOUX (glx) - Thursday, 08 May 2008, 02:46AM

The attached patch should remove some of the warnings.

  maybe_silence_some_warnings.diff
Comment by Remko Bijker (Rubidium) - Thursday, 08 May 2008, 10:18AM

And the following attached patch might remove the error. But I'm not sure, so please test and report back.

  possibly_fix_the_error.diff
Comment by Rindvieh (Rindvieh) - Thursday, 08 May 2008, 12:30PM

@glx: yes this patch works. Now 44 warnings left (see attached file).

@Rubidium: no sorry, with your patch the same error is still there.

Cheers,
Rindvieh

  x64-compile_warnings.txt
Comment by Zdenek Sojka (smatz) - Thursday, 08 May 2008, 12:42PM

Rindvieh, can you test following patch? It will crash, but will tell how much memory it needs.
It would be good to know results both with and without Rubidium's patch.

  sizeof_test.diff
Comment by Rindvieh (Rindvieh) - Thursday, 08 May 2008, 01:09PM

Smatz, here you have it:

without Rubidiums patch: sizeof(replaceveh_d) == 120, sizeof(EngineList) == 48
with Rubidiums patch: sizeof(replaceveh_d) == 112, sizeof(EngineList) == 48


Comment by Loïc GUILLOUX (glx) - Thursday, 08 May 2008, 06:30PM

The attached patch should remove another 4 warnings.

  x64_warnings.diff
Comment by Rindvieh (Rindvieh) - Thursday, 08 May 2008, 07:13PM

Yes, now 40 warnings left. But now are 2 errors.

  VS90_x64-compile_warnings-r13016-with_patch.txt
Comment by Michael Lutz (michi_cc) - Thursday, 08 May 2008, 07:16PM

In relase mode of VS9 std::vector is just too big, I don't see a way around increasing WINDOW_CUSTOM_SIZE.

Attached is a patch for some easy warnings, some data type changes and three casts that can't be avoided because they are in function calls to library functions that we can't change.

EDIT: looks like you were faster on with some changes :) But at least the change for spritecache.cpp:GetSpriteCacheUsage is wrong, because you didn't update the format strings in the DEBUG statements. Note that size_t can't be used completely portable in printf and friends.

  fix_some_more_warnings.diff
Comment by Rindvieh (Rindvieh) - Thursday, 08 May 2008, 07:33PM

Hi michi_cc,

with only your patch are 36 warnings left and only 1 error (the new one was from glxs patch, I think).

  VS90_x64-compile_warnings-r13016-with_patch_from_michi_cc.txt
Comment by Loïc GUILLOUX (glx) - Thursday, 08 May 2008, 07:36PM

Yes my patch caused the new error :)
It should be fixed with this version.

  x64_warnings.diff
Comment by Michael Lutz (michi_cc) - Thursday, 08 May 2008, 07:43PM

There's still a problem with declaring GetSpriteCacheUsage() to return size_t. The problem are the DEBUG calls:

DEBUG(sprite, 3, "Fixing lru %d, inuse=%d", _sprite_lru_counter, GetSpriteCacheUsage());

The format specifier %d can only be used in 32-bit mode for size_t, a fully C99 compatible clib should support %zd which has automatically the right width, C90 clibs should use %ld and a cast to unsigned long (working because unix long is 64-bit in 64-bit mode), and %Id for MSVC. That's certainly messy.


Comment by Rindvieh (Rindvieh) - Thursday, 08 May 2008, 07:59PM

40 warnings and one error :)

  VS90_x64-compile_warnings-r13016-with_patch_from_glx.txt
Comment by Rindvieh (Rindvieh) - Saturday, 10 May 2008, 02:22PM

Hey,
how is the progress to fix the error that a compilation for x64 will be possible again?

I've tested which rev broken it, it was r12995. Maybe that can help you.

Cheers,
Rindvieh


Comment by Remko Bijker (Rubidium) - Sunday, 11 May 2008, 01:44AM

The compile error should be solved by r13037.


Comment by Rindvieh (Rindvieh) - Sunday, 11 May 2008, 12:12PM

Yes Rubidium, it compile now errorless. Thank you.

Now there are only 36 warnings left :) .

Cheers,
Rindvieh

  VS90_x64-compile_warnings-r13040.txt