-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Review and remove ignored warnings #76944
Copy link
Copy link
Open
Labels
Description
By default we enable -Wall -Wextra -Wpedantic -Weverything in the project which helps making the code cleaner and detect many issues during development.
But since ALL the warnings include some aggressive ones or some we don't care about, we have a list of warnings that we disable:
ClickHouse/cmake/warnings.cmake
Lines 20 to 48 in dbfd86c
| add_warning(everything) | |
| add_warning(pedantic) | |
| add_warning(vla-cxx-extension) | |
| no_warning(return-type-c-linkage) | |
| no_warning(zero-length-array) | |
| no_warning(c++98-compat-pedantic) | |
| no_warning(c++98-compat) | |
| no_warning(c++20-compat) # Use constinit in C++20 without warnings | |
| no_warning(sign-conversion) | |
| no_warning(implicit-int-conversion) | |
| no_warning(implicit-int-float-conversion) | |
| no_warning(ctad-maybe-unsupported) # clang 9+, linux-only | |
| no_warning(disabled-macro-expansion) | |
| no_warning(documentation-unknown-command) | |
| no_warning(double-promotion) | |
| no_warning(exit-time-destructors) | |
| no_warning(float-equal) | |
| no_warning(global-constructors) | |
| no_warning(missing-prototypes) | |
| no_warning(missing-variable-declarations) | |
| no_warning(padded) | |
| no_warning(switch-enum) | |
| no_warning(undefined-func-template) | |
| no_warning(unused-template) | |
| no_warning(weak-template-vtables) | |
| no_warning(weak-vtables) | |
| no_warning(thread-safety-negative) # experimental flag, too many false positives | |
| no_warning(unsafe-buffer-usage) # too aggressive | |
| no_warning(switch-default) # conflicts with "defaults in a switch covering all enum values" |
There are several problems with this list:
- Some warnings are disabled because we didn't spend time fixing the reported issues, which are correct and should be addressed. For example: Conversion warnings.
- Some warnings point to performance problems and issues with unnecessary memory usage which should be reviewed, but are not important except in key classes. E.g: padded.
- Some warnings tell us about wasting compilation time and resources. E.g.
weak-vtables. - And some I have no idea because the reason it's lost and we should explain it.
Reactions are currently unavailable