Skip to content

NOB_PRINTF_FORMAT "-Wformat" warnings with MinGW#44

Closed
KillerxDBr wants to merge 5 commits intotsoding:mainfrom
KillerxDBr:main
Closed

NOB_PRINTF_FORMAT "-Wformat" warnings with MinGW#44
KillerxDBr wants to merge 5 commits intotsoding:mainfrom
KillerxDBr:main

Conversation

@KillerxDBr
Copy link
Copy Markdown
Contributor

Avoid warnings when using %zu with printf style nob functions with MinGW gcc compiler, tested with gcc and clang

nob.c: In function 'main':
nob.c:6:43: warning: unknown conversion type character 'z' in format [-Wformat=]
    6 |         nob_log(NOB_INFO, "sizeof(int) = %zu", sizeof(int));
      |                                           ^
nob.c:6:27: warning: too many arguments for format [-Wformat-extra-args]
    6 |         nob_log(NOB_INFO, "sizeof(int) = %zu", sizeof(int));
      |                           ^~~~~~~~~~~~~~~~~~~

To avoid Warnings when using %zu with printf style nob functions
@rexim
Copy link
Copy Markdown
Member

rexim commented May 16, 2025

Thanks! Committed in 6c5a74d

@rexim rexim closed this May 16, 2025
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