Fix some compiler warnings in tests code#84
Open
SeverinLeonhardt wants to merge 3 commits intoscylladb:masterfrom
Open
Fix some compiler warnings in tests code#84SeverinLeonhardt wants to merge 3 commits intoscylladb:masterfrom
SeverinLeonhardt wants to merge 3 commits intoscylladb:masterfrom
Conversation
Compiling with MSVC produces the following warning: warning C4996: 'inet_addr': Use inet_pton() or InetPton() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings Instead of just ignoring the deprecation warnings replacing `inet_addr` is straight-forward here. `inet_pton` works well as a cross-platform alternative. The difference in parsing[^1] are acceptable since this is only used in test code where it won't lead to a chance in behavior since the only used value is a fixed string of "127.0.0.1" in `bridge.cpp`. [^1]: https://man7.org/linux/man-pages/man3/inet_pton.3.html#NOTES
Compiling the code with a higher warning level than the default gives the following warning from MSVC: warning C4245: 'argument': conversion from 'long' to 'uint64_t', signed/unsigned mismatch Indeed `long` is signed while `uint64_t` is unsigned. Casting to the right data type gives the same result but fixes the warning.
In the tests `cass_retry_policy_downgrading_consistency_new` is called intentionally, even though it's marked as deprecated. Ignore that warning on MSVC.
|
With which compiler? |
Author
This was with the Microsoft Visual C++ compiler. Details can be found in the individual commit messages. It seems c77df6c isn't necessary. The code compiles without it for version 19.29 and 19.40 of the compiler. |
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.
These are just some warnings I came across when building the driver for which I could implement a fix.