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

Compile fails on clang 9.0.0 #1

Open
parkerlreed opened this issue Apr 22, 2019 · 1 comment
Open

Compile fails on clang 9.0.0 #1

parkerlreed opened this issue Apr 22, 2019 · 1 comment

Comments

@parkerlreed
Copy link

Arch Linux
clang version 9.0.0 (trunk) (llvm/trunk 358753)

clang -Werror -Wall -Wno-unknown-warning-option -Wno-multichar -Wno-int-in-bool-context -std=gnu11 -D_GNU_SOURCE -DVERSION="0.11.1" -I. -D_USE_MATH_DEFINES -Wno-deprecated-declarations -g -DGB_INTERNAL -c Core/timing.c -o build/obj/Core/timing.c.o
clang -Werror -Wall -Wno-unknown-warning-option -Wno-multichar -Wno-int-in-bool-context -std=gnu11 -D_GNU_SOURCE -DVERSION="0.11.1" -I. -D_USE_MATH_DEFINES -Wno-deprecated-declarations -g -c Misc/wide_gb.c -o build/obj/Misc/wide_gb.c.o
Misc/wide_gb.c:154:47: error: format specifies type 'unsigned long long *' but the argument has type 'WGB_exact_hash *' (aka 'unsigned long *') [-Werror,-Wformat]
                sscanf(line, "%llu,%i,%i,%i", &frame_hash, &scene_id, &scene_scroll.x, &scene_scroll.y);
                              ~~~~            ^~~~~~~~~~~
                              %lu
Misc/wide_gb.c:218:57: error: format specifies type 'unsigned long long' but the argument has type 'WGB_exact_hash' (aka 'unsigned long') [-Werror,-Wformat]
                fprintf(frames_file, "%llu,%i,%i,%i\n", scene_frame->frame_hash, scene_frame->scene_id, scene_frame->scene_scroll.x, scene_frame->scene_scroll.y);
                                      ~~~~              ^~~~~~~~~~~~~~~~~~~~~~~
                                      %lu
2 errors generated.
make: *** [Makefile:162: build/obj/Misc/wide_gb.c.o] Error 1

(Thanks for enabling the issue tracker!)

@AntonioND
Copy link

I think that this highlights another problem. -Werror shouldn't be used by default when compiling. I imagine that the idea is to force developers to not introduce new warnings, but different versions of compilers may have different warnings, so it isn't realistic to expect that your code is always going to be warning-free.

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