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

compiler warnings #38

Closed
Saugstrahler opened this issue Feb 10, 2018 · 10 comments
Closed

compiler warnings #38

Saugstrahler opened this issue Feb 10, 2018 · 10 comments

Comments

@Saugstrahler
Copy link

I get a lot of warnings for various files...all same message:

benchmark.c:209:21: warning: ISO C does not support the 'I' ms_printf length modifier [-Wformat=]

and

benchmark.c:223:19: warning: ISO C does not support the 'I64' ms_printf length modifier [-Wformat=]

@syzygy1
Copy link
Owner

syzygy1 commented Feb 11, 2018

Did you update your MSYS installation after #29 ?

It seems MSYS/MinGW doesn't know what it wants.

@syzygy1
Copy link
Owner

syzygy1 commented Feb 11, 2018

Ah, I thought these warning were caused by the changes I made then, but that's not true.

@syzygy1
Copy link
Owner

syzygy1 commented Feb 11, 2018

The problem is that fixing this by using the %z modifier for both Linux and Windows breaks cross-compilation for Windows with MinGW on Linux. (I could just cast the size_t values to int and use %d to work around the problem, but there is an annoying inconsistency in MinGW.)

@syzygy1
Copy link
Owner

syzygy1 commented Feb 11, 2018

Adding a compilation flag may have done the trick. At least it works now for MinGW on Linux.
1e615f5

@Saugstrahler
Copy link
Author

nope, it's not fixed and now I get additional warnings.....

a) benchmark.c:209:35: warning: unknown conversion type character 'z' in format [-Wformat=]
fprintf(stderr, "\nPosition: %zu/%zu\n", ++j, num_fens - num_opts);

b) benchmark.c:209:21: warning: too many arguments for format [-Wformat-extra-args]
fprintf(stderr, "\nPosition: %zu/%zu\n", ++j, num_fens - num_opts);

c) benchmark.c:223:19: warning: ISO C does not support the 'I64' ms_printf length modifier [-Wformat=]

@syzygy1
Copy link
Owner

syzygy1 commented Feb 11, 2018

Do you get those warnings with COMP=mingw or with the (default) COMP=gcc?

I suppose you're also getting warnings in at least search,c?

@Saugstrahler
Copy link
Author

COMP=gcc (7.3.0)
I get warnings in:
benchmark.c
position.c
search.c
tt.c

@syzygy1
Copy link
Owner

syzygy1 commented Feb 11, 2018

OK, please try again with the latest commit.

@Saugstrahler
Copy link
Author

works fine, no warnings anymore........but final executable increased size from 196k to 221k

@syzygy1
Copy link
Owner

syzygy1 commented Feb 11, 2018

Yes, because it now links in a standard-compliant version of printf.
Without it you need to use %I, but then the compiler complains.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants