Skip to content

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.

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