Repository navigation
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
vszakats
force-pushed
the
cm-warnover
branch
3 times, most recently
from
April 27, 2025 07:22
477c4ab to
4721527
Compare
```
src/packet.c: In function ‘_libssh2_packet_add’:
src/packet.c:671:9: error: jump skips variable initialization [-Werror=jump-misses-init]
671 | goto libssh2_packet_add_jump_point5;
| ^~~~
src/packet.c:934:1: note: label ‘libssh2_packet_add_jump_point5’ defined here
934 | libssh2_packet_add_jump_point5:
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/packet.c:920:31: note: ‘want_reply’ declared here
920 | unsigned char want_reply = 0;
| ^~~~~~~~~~
src/packet.c:671:9: error: jump skips variable initialization [-Werror=jump-misses-init]
671 | goto libssh2_packet_add_jump_point5;
| ^~~~
src/packet.c:934:1: note: label ‘libssh2_packet_add_jump_point5’ defined here
934 | libssh2_packet_add_jump_point5:
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/packet.c:919:26: note: ‘len’ declared here
919 | uint32_t len = 0;
| ^~~
src/packet.c:669:9: error: jump skips variable initialization [-Werror=jump-misses-init]
669 | goto libssh2_packet_add_jump_point4;
| ^~~~
src/packet.c:1198:1: note: label ‘libssh2_packet_add_jump_point4’ defined here
1198 | libssh2_packet_add_jump_point4:
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/packet.c:1121:31: note: ‘want_reply’ declared here
1121 | unsigned char want_reply = 1;
| ^~~~~~~~~~
src/packet.c:669:9: error: jump skips variable initialization [-Werror=jump-misses-init]
669 | goto libssh2_packet_add_jump_point4;
| ^~~~
src/packet.c:1198:1: note: label ‘libssh2_packet_add_jump_point4’ defined here
1198 | libssh2_packet_add_jump_point4:
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/packet.c:1120:26: note: ‘len’ declared here
1120 | uint32_t len = _libssh2_ntohu32(data + 5);
| ^~~
src/packet.c:669:9: error: jump skips variable initialization [-Werror=jump-misses-init]
669 | goto libssh2_packet_add_jump_point4;
| ^~~~
src/packet.c:1198:1: note: label ‘libssh2_packet_add_jump_point4’ defined here
1198 | libssh2_packet_add_jump_point4:
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/packet.c:1119:26: note: ‘channel’ declared here
1119 | uint32_t channel = _libssh2_ntohu32(data + 1);
| ^~~~~~~
```
VS2015: ``` tests\test_simple.c(60): error C2220: warning treated as error - no 'object' file generated tests\test_simple.c(60): warning C4777: 'fprintf' : format string '%d' requires an argument of type 'int', but variadic argument 1 has type 'std::size_t' tests\test_simple.c(60): note: to simplify migration, consider the temporary use of /Wv:18 flag with the version of the compiler with which you used to build without warnings tests\test_simple.c(60): note: the sizes of types 'std::size_t' and 'int' might differ on other platforms tests\test_simple.c(60): note: consider using '%zd' in the format string tests\test_simple.c(60): warning C4777: 'fprintf' : format string '%.*s' requires an argument of type 'int', but variadic argument 2 has type 'std::size_t' tests\test_simple.c(60): note: to simplify migration, consider the temporary use of /Wv:18 flag with the version of the compiler with which you used to build without warnings tests\test_simple.c(60): note: this argument is used as a precision tests\test_simple.c(60): note: the sizes of types 'std::size_t' and 'int' might differ on other platforms ```
1. `CMAKE_C_FLAGS` may apply to other projects, and deleting/altering it may be unexpected. 2. We pass `-W4`/`-Wall` internally now, which do override custom `-W<n>` options in all supported MSVC versions. (as tested with Visual Studio generators)
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.
-ftree-vrpbehavior with autotools.-Wjump-misses-initfor GCC 4.5+.Credits-to: Marcel Raad
-Wjump-misses-initwarnings.-Wtrampolinespicky warning for gcc 4.x versions.Follow-up to 854cfa8 build: prepare builds for clang-cl, add cmake ossfuzz support #1524
-Wallfor MSVC whenPICKY_COMPILER=ON.-Wallwarnings.Seen on VS2015. Not seen on VS2022. Unknown for other versions.
Follow-up to a3aa6b4 cmake: misc improvements, add
LIBSSH2_USE_PKGCONFIGoption #1525-W<n>fromCMAKE_C_FLAGS(MSVC)CMAKE_C_FLAGSmay apply to other projects, and deleting/altering itmay be unexpected.
-W4/-Wallinternally now, which do override custom-W<n>options as tested with VS2008 and newer VS generators.w/o ws https://github.com/libssh2/libssh2/pull/1588/files?w=1