Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VS9 x64 warnings #1997

Closed
DorpsGek opened this issue May 8, 2008 · 18 comments
Closed

VS9 x64 warnings #1997

DorpsGek opened this issue May 8, 2008 · 18 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

DorpsGek commented May 8, 2008

Rindvieh opened the ticket and wrote:

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

Attachments

Reported version: trunk
Operating system: Windows


This issue was imported from FlySpray: https://bugs.openttd.org/task/1997
@DorpsGek
Copy link
Member Author

DorpsGek commented May 8, 2008

glx wrote:

The attached patch should remove some of the warnings.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/1997#comment4087

@DorpsGek
Copy link
Member Author

DorpsGek commented May 8, 2008

Rubidium wrote:

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

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/1997#comment4089

@DorpsGek
Copy link
Member Author

DorpsGek commented May 8, 2008

Rindvieh wrote:

@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

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/1997#comment4090

@DorpsGek
Copy link
Member Author

DorpsGek commented May 8, 2008

SmatZ wrote:

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.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/1997#comment4091

@DorpsGek
Copy link
Member Author

DorpsGek commented May 8, 2008

Rindvieh wrote:

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


This comment was imported from FlySpray: https://bugs.openttd.org/task/1997#comment4092

@DorpsGek
Copy link
Member Author

DorpsGek commented May 8, 2008

glx wrote:

The attached patch should remove another 4 warnings.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/1997#comment4096

@DorpsGek
Copy link
Member Author

DorpsGek commented May 8, 2008

Rindvieh wrote:

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

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/1997#comment4097

@DorpsGek
Copy link
Member Author

DorpsGek commented May 8, 2008

michi_cc wrote:

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.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/1997#comment4098

@DorpsGek
Copy link
Member Author

DorpsGek commented May 8, 2008

Rindvieh wrote:

Hi michi_cc,

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

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/1997#comment4100

@DorpsGek
Copy link
Member Author

DorpsGek commented May 8, 2008

glx wrote:

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

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/1997#comment4101

@DorpsGek
Copy link
Member Author

DorpsGek commented May 8, 2008

michi_cc wrote:

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.


This comment was imported from FlySpray: https://bugs.openttd.org/task/1997#comment4102

@DorpsGek
Copy link
Member Author

DorpsGek commented May 8, 2008

Rindvieh wrote:

40 warnings and one error :)

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/1997#comment4103

@DorpsGek
Copy link
Member Author

Rindvieh wrote:

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


This comment was imported from FlySpray: https://bugs.openttd.org/task/1997#comment4111

@DorpsGek
Copy link
Member Author

Rubidium wrote:

The compile error should be solved by r13037.


This comment was imported from FlySpray: https://bugs.openttd.org/task/1997#comment4118

@DorpsGek
Copy link
Member Author

Rindvieh wrote:

Yes Rubidium, it compile now errorless. Thank you.

Now there are only 36 warnings left :) .

Cheers,
Rindvieh

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/1997#comment4121

@DorpsGek
Copy link
Member Author

Rubidium wrote:

Are the warnings now all gone?


This comment was imported from FlySpray: https://bugs.openttd.org/task/1997#comment4199

@DorpsGek
Copy link
Member Author

Rindvieh wrote:

I've tested r13316 and yes all warnings are gone.

You're great guys, thanks :).

Cheers,
Rindvieh


This comment was imported from FlySpray: https://bugs.openttd.org/task/1997#comment4200

@DorpsGek
Copy link
Member Author

Rubidium closed the ticket.

Reason for closing: Fixed


This comment was imported from FlySpray: https://bugs.openttd.org/task/1997

@DorpsGek DorpsGek added Core flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) labels Apr 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

1 participant