http://llvm.org/bugs/show_bug.cgi?id=14280
Bug #: 14280
Summary: warning correct does not handle -Wno options correctly
Product: clang
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Frontend
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
Classification: Unclassified
Created attachment 9504
--> http://llvm.org/bugs/attachment.cgi?id=9504
Example patch fixing '-Wno' handling
clang does a bad job of giving recommendations on misformed '-Wno' options.
Basically if an option doesn't start with '-Wno-', it can never match a '-Wno-'
option.
Consider:
$ clang++ -Wbrc
clang: warning: unknown warning option '-Wbrc'; did you mean '-Warc'?
$ clang++ -Wno-brc
clang: warning: unknown warning option '-Wno-brc'; did you mean '-Wno-arc'?
$ clang++ -Wnobrc
clang: warning: unknown warning option '-Wnobrc'; did you mean '-Warc'?
$ clang++ -Wnoarc
clang: warning: unknown warning option '-Wnoarc'; did you mean '-Warc'?
I attach a patch which takes an attempt at fixing this problem. However, I
realised that I'm not really 100% sure about quite a few parts of the clang
coding standard, so I suspect this isn't acceptably finished. In particular I'm
worried I'm breaking the internationalisation. In Warnings.cpp, the two terms
diag::warn_unknown_warning_option_suggest and
diag::warn_unknown_negative_warning_option_suggest look identical to me, so I
was tempted to remove one. But, I assume there is a reason for two of them?
However, this patch does give:
$ clang++ -Wnobrc
clang: warning: unknown warning option '-Wnobrc'; did you mean '-Wno-arc'?
$ clang++ -Won-arc
clang: warning: unknown warning option '-Won-arc'; did you mean '-Wno-arc'?
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs