-
Notifications
You must be signed in to change notification settings - Fork 322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build everything with -Werror #1100
Merged
Merged
Conversation
This file contains 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
When COMPILE_WARNING_AS_ERROR is set, compile everything with -Werror and not just Libiio. Signed-off-by: Paul Cercueil <paul@crapouillou.net>
time_t is implementation defined, and therefore there is no printf format specifier that is guaranteed to work on every platform. Address this issue by using %ld and casting the value to long. Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Specify the arguments to the yylex() function in its forward prototype, as old-style prototypes that don't specify the number of arguments are deprecated in C. Signed-off-by: Paul Cercueil <paul@crapouillou.net>
The return codes are stored within the "struct iiod_command" as a int32_t, there is no point to use a intptr_t in the public API. Signed-off-by: Paul Cercueil <paul@crapouillou.net>
We compute a difference between two 64-bit values, and given that the result corresponds to a timeout value in milliseconds, we can guarantee that it will fit in 32-bits. Use an explicit downcast to unsigned int to tell the compiler that we know it's okay. Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Set argc parameter to dup_argv/free_argw as unsigned int, to avoid signed/unsigned comparisons. Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Use PRId64 from <inttypes.h> to print the int64_t value. Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
MSVC does not support escape sequences and will complain if it finds some, even when those are actually dead code. Signed-off-by: Paul Cercueil <paul@crapouillou.net>
iio_strerror() expects an "int" value for the error code. Visual Studio will complain if we are passing a ssize_t, as it is a downcast. However, we know that error codes all fit in "int", so the downcast is safe. Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
pcercuei
force-pushed
the
pcercuei/werror
branch
from
December 11, 2023 16:20
c26a063
to
9e274d3
Compare
mhennerich
approved these changes
Dec 11, 2023
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.
Build everything (Libiio, IIOD, and iio-utils) with -Werror or the Visual Studio equivalent, and fix a bunch of warnings that were reported.