User Details
- User Since
- Dec 14 2022, 10:49 AM (14 w, 1 d)
Tue, Mar 21
Rebase and Ping
Sun, Mar 19
Sat, Mar 18
Mon, Mar 13
Address comments from @aaron.ballman
- NFC stylistic changes
Address comments from @aaron.ballman
- Dropped const qualifier from value objects for style consistency
- Passed boolean HasFallThroughAttr to callback and handled warning suppression in HandleUnreachable in order to make code cleaner.
Added a release note
Sun, Mar 12
Address comments from @shafik
- Pass bool flag UnreachableFallThroughDiagIsEnabled instead of DiagnosticsEngine
Sat, Mar 11
Fri, Mar 10
Address comment from @aaron.ballman
- Rewording the diagnostic
Fri, Mar 3
Update the differential
- Revise warning messages based on ideas from @aaron.ballman.
- Introduce a new warning flag -Wchaining-comparisons that is enabled by default, to warn about chaining relationals or equal operators.
- Adjust existing test files to conform with the new warning settings.
Feb 4 2023
Also, why are these diagnostics off by default? Do we have some idea as to the false positive rate?
As for the false positive rate, I have checked for instances of this warning in the codebases for 'oneapi-src/oneTBB', 'rui314/mold', and 'microsoft/lightgbm', but did not find any new cases.
I also ran a test on 'tensorflow/tensorflow' using gcc '-Wparentheses' and found six lines of code that trigger the new diagnostic. They all relate to checking whether x and y have the same sign using x > 0 == y > 0 and alike. I tried to build with tensorflow using clang, but I stumbled upon some errors (for my poor knowledge of bazel configuration), so here I am using gcc.
Feb 3 2023
Address comments from erichkeane:
- Fix comment wording
- Avoid using macro in test file
Jan 31 2023
Jan 28 2023
Fix the new warning issued against libcxx test code.
Jan 27 2023
Jan 12 2023
I added the release note.
Also, do you need someone to commit on your behalf? If so, what name and email address would you like used for patch attribution?
I don't have commit access. Would you please land this patch for me? Please use "Takuya Shimizu <shimizu2486@gmail.com>" for the patch attribution.
Thank you.
Jan 10 2023
FWIW a lot of build systems support setting CXXFLAGS/CFLAGS before invoking the build system/build generator (cmake, for instance) and respects those - so might be relatively easy to add a new warning flag to the build (& CXX/CC to set the compiler to point to your local build with the patch/changes)
Thanks for your advice! I'll give it a try. It might be a nice opportunity for me to learn some compiler development methods.
Jan 7 2023
I have yet to do thorough checks using this patched clang to build significant code bases.
It will likely take quite a bit of time as I am not used to editing build tool files.
Jan 6 2023
So, so long as a string literal still does the suppression, it's probably fine.
I agree with you. I now also think that integer literals _should not_ do the warning suppression because programmers are sometimes unsure of the expansion result of predefined macros in the compiled environment.
I updated the differential. I am new to Phabricator and made some unnecessary operations. Sorry for bothering you.
add up the former 2 commits into 1
This update limits the warning suppression case to string literals only, and delete no longer necessary functions.
Jan 5 2023
As you point out, enhancement may be more accurate than bug fix.
There are rare cases where enabling a warning for missing parentheses in constexpr logical expressions can be helpful, I think. For example, consider the following code:
constexpr A = ...; constexpr B = ...; constexpr C = ...;