Skip to content

Clang should err, not warn, on unrecognized warning options #10073

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

Closed
llvmbot opened this issue Apr 13, 2011 · 9 comments
Closed

Clang should err, not warn, on unrecognized warning options #10073

llvmbot opened this issue Apr 13, 2011 · 9 comments
Labels
bugzilla Issues migrated from bugzilla clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' wontfix Issue is real, but we can't or won't fix it. Not invalid

Comments

@llvmbot
Copy link
Member

llvmbot commented Apr 13, 2011

Bugzilla Link 9701
Resolution WONTFIX
Resolved on Sep 23, 2013 18:57
Version trunk
OS All
Blocks llvm/llvm-bugzilla-archive#10638
Reporter LLVM Bugzilla Contributor
CC @efriedma-quic,@jeremyhu

Extended Description

Many open source projects, including Wine, pass various warning flags to the compiler to see if they're supported, expecting the compiler to return a non-zero status if they aren't.

Clang, on the other hand, only warns when it receives an unrecognized warning option. The warning is very annoying, particularly when compiling large numbers of source files, because it clutters the output. We believe the Clang should err (and thus return a non-zero status) instead of warn on warning options that aren't recognized.

We wanted to use -Werror, but Wine's maintainer told us to file a bug here instead.

@efriedma-quic
Copy link
Collaborator

Sure; I'll send a patch to cfe-commits for discussion soon. It was originally made a warning a while back, and it's probably about time to revisit that decision.

@llvmbot
Copy link
Member Author

llvmbot commented May 11, 2011

Sure; I'll send a patch to cfe-commits for discussion soon. It was originally
made a warning a while back, and it's probably about time to revisit that
decision.

Any news on this?

@efriedma-quic
Copy link
Collaborator

Oops, sorry, lost track of this one; sent an email for real now.

@llvmbot
Copy link
Member Author

llvmbot commented Sep 19, 2011

I am ready to take this one up if its not fixed yet. Shall I? I am a newbie so I don't know what the procedure for taking ownership of a bug is or the procedure for submitting a fix to one.

@llvmbot
Copy link
Member Author

llvmbot commented Sep 29, 2011

Oops, sorry, lost track of this one; sent an email for real now.

Any news on this?

@llvmbot
Copy link
Member Author

llvmbot commented Feb 14, 2012

Still present, as of
git-svn-id: http://llvm.org/svn/llvm-project/llvm/trunk@150433 91177308-0d34-0410-b5e6-96231b3b80d8

@llvmbot
Copy link
Member Author

llvmbot commented Feb 11, 2013

Still present as of

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174843 91177308-0d34-0410-b5e6-96231b3b80d8

@jeremyhu
Copy link
Mannequin

jeremyhu mannequin commented May 13, 2013

You can use -Werror=unknown-warning-option

As of 3.1, the ordering of -Werror=unknown-warning-option and the "bad" command line arguments doesn't matter.

See the XORG_TESTSET_CFLAG macro at http://cgit.freedesktop.org/xorg/util/macros/tree/xorg-macros.m4.in

@llvmbot
Copy link
Member Author

llvmbot commented Sep 24, 2013

This is a bit better with r191249:

$ clang -HHH -c test.c
clang-3.4: error: unknown argument: '-HHH'

clang still thinks it knows all the -f* options (for example), so we are still not as strict as gcc.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
@Quuxplusone Quuxplusone added the wontfix Issue is real, but we can't or won't fix it. Not invalid label Jan 20, 2022
qiongsiwu pushed a commit to qiongsiwu/llvm-project that referenced this issue Mar 1, 2025
[cxx-interop] Workaround a template instantiation issue
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' wontfix Issue is real, but we can't or won't fix it. Not invalid
Projects
None yet
Development

No branches or pull requests

3 participants