client: check PrintAndLogEx format strings at compile time

Add a printf format attribute to PrintAndLogEx so gcc/clang flag
argument/specifier mismatches (previous commit fixed the 34 existing ones).
On mingw use __MINGW_PRINTF_FORMAT, matching the GNU printf selected by
_ISOC99_SOURCE rather than ms_printf.

PrintAndLogEx(x, "") is the established way to print an empty line, so
-Wno-format-zero-length is added to every build that compiles callers:
client Makefile, client CMake, experimental_lib, and cliparser (Makefile
and cmake).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
iceman1001andClaude Opus 5.5 committed 2026-11-09 18:35:57 +07:00
1 parent 3deae3d904
commit cc50ed6b72
6 files changed
+14 -5

No files matched your search

+2
View File
@@ -485,6 +485,8 @@ CFLAGS += $(MYDEFS) $(MYCFLAGS) $(MYINCLUDES)
# We cannot just use CFLAGS+=... because it has impact on sub-makes if CFLAGS is defined in env:
PM3CFLAGS = $(CFLAGS)
PM3CFLAGS += -I./src -I./include -I../include -I../common -I../common_fpga $(PM3INCLUDES) $(INCLUDES)
# PrintAndLogEx(x, "") prints an empty line on purpose
PM3CFLAGS += -Wno-format-zero-length
# WIP Testing
#PM3CFLAGS += -std=c11 -pedantic