build: speed up and extend picky compiler options#952
Closed
vszakats wants to merge 55 commits intolibssh2:masterfrom
Closed
build: speed up and extend picky compiler options#952vszakats wants to merge 55 commits intolibssh2:masterfrom
vszakats wants to merge 55 commits intolibssh2:masterfrom
Conversation
5eab2aa to
84b70ef
Compare
238d329 to
2a3d85e
Compare
8535a63 to
88d10ed
Compare
```
knownhost.c: In function ‘knownhost_writeline’:
knownhost.c:1045:11: error: this statement may fall through [-Werror=implicit-fallthrough=]
1045 | if(key_type_name) {
| ^
knownhost.c:1051:5: note: here
1051 | default:
| ^~~~~~~
```
TODO: retrofit to curl? It could optimize out a feature check.
Ref: curl/curl@bd12c44
-Wextra is the same as -W in clang. But the former is preferred. -Wextra also works in gcc like this, but it came with newer versions.
88d10ed to
0202879
Compare
vszakats
added a commit
to vszakats/curl
that referenced
this pull request
Apr 16, 2023
Extend existing picky compiler options with ones missing compared to autotools builds. Also sync options between clang and gcc. Redesign the way we enable these options to avoid the slow option detection almost completely. This reduces the number of detections from 35 to zero for clang and 3 for gcc, even after adding a bunch of new options. clang 3.0 (2011-11-29) and gcc 2.95 (1999-07-31) now required. Also show enabled picky options. Ref: libssh2/libssh2#952 Closes #xxxxx
vszakats
added a commit
to curl/curl
that referenced
this pull request
Apr 16, 2023
Extend existing picky compiler options with ones missing compared to autotools builds. Also sync options between clang and gcc. Redesign the way we enable these options to avoid the slow option detection almost completely. This reduces the number of detections from 35 to zero for clang and 3 for gcc, even after adding a bunch of new options. clang 3.0 (2011-11-29) and gcc 2.95 (1999-07-31) now required. Also show enabled picky options. Ref: libssh2/libssh2#952 Reviewed-by: Daniel Stenberg Closes #10973
bch
pushed a commit
to bch/curl
that referenced
this pull request
Jul 19, 2023
Extend existing picky compiler options with ones missing compared to autotools builds. Also sync options between clang and gcc. Redesign the way we enable these options to avoid the slow option detection almost completely. This reduces the number of detections from 35 to zero for clang and 3 for gcc, even after adding a bunch of new options. clang 3.0 (2011-11-29) and gcc 2.95 (1999-07-31) now required. Also show enabled picky options. Ref: libssh2/libssh2#952 Reviewed-by: Daniel Stenberg Closes curl#10973
This was referenced Oct 9, 2023
agreppin
pushed a commit
to agreppin/libssh2
that referenced
this pull request
Jul 14, 2024
Implement picky warnings with clang in autotools. Extend picky gcc warnings, sync them between build tools and compilers and greatly speed up detection in CMake. - autotools: enable clang compiler warnings with `--enable-debug`. - autotools: enable more gcc compiler warnings with `--enable-debug`. - autotools/cmake: sync compiler warning options between gcc and clang. - sync compiler warning options between autotools and cmake. - cmake: reduce option-checks to speed up the detection phase. Bring them down to 3 (from 35). Leaving some checks to keep the CMake logic alive and for an easy way to add new options. clang 3.0 (2011-11-29) and gcc 2.95 (1999-07-31) now required. - autotools logic copied from curl, with these differences: - delete `-Wimplicit-fallthrough=4` due to a false positive. - reduce `-Wformat-truncation=2` to `1` due to a false positive. - simplify MinGW detection for `-Wno-pedantic-ms-format`. - cmake: show enabled picky compiler options (like autotools). - cmake: do compile `tests/simple.c` and `tests/ssh2.c`. - fix new compiler warnings. - `tests/CMakeLists.txt`: fix indentation. Original source of autotools logic: - https://github.com/curl/curl/blob/a8fbdb461cecbfe1ac6ecc5d8f6cf181e1507da8/acinclude.m4 - https://github.com/curl/curl/blob/a8fbdb461cecbfe1ac6ecc5d8f6cf181e1507da8/m4/curl-compilers.m4 Notice that the autotools implementation considers Apple clang as legacy clang 3.7. CMake detection works more accurately, at the same time more error-prone and difficult to update due to the sparsely documented nature of Apple clang option evolution. Closes libssh2#952
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implement picky warnings with clang in autotools. Extend picky gcc
warnings, sync them between build tools and compilers and greatly
speed up detection in CMake.
autotools: enable clang compiler warnings with
--enable-debug.autotools: enable more gcc compiler warnings with
--enable-debug.autotools/cmake: sync compiler warning options between gcc and clang.
sync compiler warning options between autotools and cmake.
cmake: reduce option-checks to speed up the detection phase.
Bring them down to 3 (from 35). Leaving some checks to keep the
CMake logic alive and for an easy way to add new options.
clang 3.0 (2011-11-29) and gcc 2.95 (1999-07-31) now required.
autotools logic copied from curl, with these differences:
delete
-Wimplicit-fallthrough=4due to a false positive.reduce
-Wformat-truncation=2to1due to a false positive.simplify MinGW detection for
-Wno-pedantic-ms-format.cmake: show enabled picky compiler options (like autotools).
cmake: do compile
tests/simple.candtests/ssh2.c.fix new compiler warnings.
tests/CMakeLists.txt: fix indentation.Original source of autotools logic:
Notice that the autotools implementation considers Apple clang as
legacy clang 3.7. CMake detection works more accurately, at the same
time more error-prone and difficult to update due to the sparsely
documented nature of Apple clang option evolution.
Closes #952
Without whitespace changes: https://github.com/libssh2/libssh2/pull/952/files?w=1