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

Using -c gives warnings #2

Open
ojwb opened this issue Nov 15, 2012 · 2 comments
Open

Using -c gives warnings #2

ojwb opened this issue Nov 15, 2012 · 2 comments

Comments

@ojwb
Copy link

ojwb commented Nov 15, 2012

After building and installing clang 3.1 with the IOC patches, I get warnings with -c:

$ clang -fcatch-undefined-ansic-behavior -O -c add.c
clang: warning: -ltrapub: 'linker' input unused when '-c' is present
clang: warning: -lm: 'linker' input unused when '-c' is present

If using -Werror, these get promoted to errors.

Without -fcatch-undefined-ansic-behavior there are no warnings, so it looks like it is adding these options implicitly. Perhaps it should only add linker options when linking?

@dtzWill
Copy link
Owner

dtzWill commented Nov 27, 2012

Sorry for the delay, somehow missed this!

Yes, this happens and for the reason you mention--we aren't good about only adding those flags when they're needed. Does this break anything for you? If so, I can prioritize putting a fix together.

If building mainline clang/compiler-rt is an option for you, you might consider doing so: as of today the majority of IOC's checks are available upstream!

The primary related flags are now "-fsanitize=integer" and "-fsanitize=undefined", both imply a number of individual checks that you can also specify manually as desired. See http://clang.llvm.org/docs/UsersManual.html#codegen for more information, and don't hesitate to let me know if you have any questions or issues!

@ojwb
Copy link
Author

ojwb commented Nov 27, 2012

Is there a preferred place to report issues rather than here?

Turning on -Werror when doing development is fairly common (because it avoids the trap of introducing a new warning by not noticing it when you first recompile the file it is in, and then the warning doesn't reappear until that file changes again). For Xapian, we turn it on automatically in a developer build, and I believe some other projects have similar arrangements.

So this means that to use the IOC clang in a developer build, I have to manually disable -Werror. It does break stuff, but there is at least a workaround.

Great to hear this is getting merged. Using the upstream clang should be an option for me - it just means I'll need to build again.

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