-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix all GCC -Wall, -Wextra, -Wpedantic and -D_FORTIFY_SOURCE=2 warnings
Approach used to fix each error type is as follows: warning: unused parameter ‘x’ [-Wunused-parameter] - add `__attribute__((unused))` to parameter signature in .c file (but not on its .h counterpart) warning: ignoring return value of ‘f’, declared with attribute warn_unused_result [-Wunused-result] - wrap function call in an `if (f(...) ...)` with appopriate error test condition, followed by an `fprintf(stderr, "Warning: ...\n")` with some informative error message warning: ‘x’ may be used uninitialized in this function [-Wmaybe-uninitialized] - initialize the variable in its declaration with a dummy value such as 0 warning: pointer targets in passing argument 1 of ‘read_d64_le’ differ in signedness [-Wpointer-sign] - change passed argument type to match signedness. Luckly the argument exists solely for that function call
- Loading branch information
1 parent
eb1e488
commit 934e66b
Showing
4 changed files
with
28 additions
and
14 deletions.
There are no files selected for viewing
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
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
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
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