Skip to content
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

Converge the warning-flags in Makefile and CMake builds #67

Merged
merged 3 commits into from
Aug 14, 2024

Conversation

bjosv
Copy link
Collaborator

@bjosv bjosv commented Aug 13, 2024

Enable the same warnings in CMake as used in the Makefile (including -Werror).
Enable -pedantic in Makefile, as in CMake, to issue all the warnings demanded by strict ISO C .

Also fixes:

  • Correcting -Wwrite-strings warnings in cluster tests (warns about the deprecated conversion from string constants to char*).
  • Use the correct libevent2 type evutil_socket_t instead of int when implementing the libevent2 callback function in our tests. On Windows evutil_socket_t is an intptr_t (long long int) which gives a warning (and error with gcc-14).
    (Required by Bump msys2/setup-msys2 from 2.23.0 to 2.24.1 #62)

Use Werror in CMake builds and enable -pedantic in Makefile.

Signed-off-by: Björn Svensson <[email protected]>
Use the correct libevent2 type `evutil_socket_t` instead of `int`
when implementing the libevent2 callback function in our tests.
On Windows evutil_socket_t is an intptr_t (long long int).

Defined in include/event2/event.h:
typedef void(*  event_callback_fn )(evutil_socket_t, short, void *)

Signed-off-by: Björn Svensson <[email protected]>
@bjosv
Copy link
Collaborator Author

bjosv commented Aug 13, 2024

Not sure if adding -pedantic in the Makefile gives any problems? like for maintainers of packages

Copy link
Collaborator

@michael-grunder michael-grunder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bjosv bjosv merged commit ba31923 into valkey-io:main Aug 14, 2024
40 of 41 checks passed
@bjosv bjosv deleted the fix-build-warnings branch August 14, 2024 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants