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

Warnings and strictness #353

Merged
merged 7 commits into from
Aug 2, 2024
Merged

Warnings and strictness #353

merged 7 commits into from
Aug 2, 2024

Conversation

dsvensson
Copy link
Collaborator

@dsvensson dsvensson commented Jul 29, 2024

  • Strict prototypes prevents accidentally passing arguments to functions that are void.
  • Fix invalid use of strlcpy.

Both protected by corresponding -Werror=... where available from now on. Added macOS to CI to have at least one platform that supports the strlcpy warning.

src/client.c Outdated Show resolved Hide resolved
This prevents incorrect invocation of functions.

Almost exclusively updated via dirty search/replaces:

find include -name '*.h' -exec sed -i '' -r 's/\(\);/(void);/g' {} \;
find src -name '*.c' -exec sed -i '' -r 's/\(\)$/(void)/g' {} \;
find src -name '*.c' -exec sed -i '' -r 's/^(((extern|static) )?(void|float|qbool)[^(]+)\(\);/\1(void);/g' {} \;

Followed by a handful of manual cleanups.
Henceforth guarded via -Werror=strlcpy-strlcat-size where supported.
@dsvensson dsvensson force-pushed the warnings branch 2 times, most recently from 5acb7b4 to 9478740 Compare July 30, 2024 10:24
@dsvensson dsvensson requested a review from ciscon July 30, 2024 12:19
@dsvensson dsvensson force-pushed the warnings branch 3 times, most recently from 373e703 to ee3f485 Compare July 31, 2024 12:27
@dsvensson dsvensson merged commit ea92a73 into QW-Group:master Aug 2, 2024
10 checks passed
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.

1 participant