From 340819e430fcb51023d58d1d9e3a3538ee533179 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Mon, 9 Nov 2026 12:56:24 +0700 Subject: [PATCH] reveng: build with clang and _FORTIFY_SOURCE Makefile.defs hardening sets -D_FORTIFY_SOURCE=3. Under clang, glibc's stdio2.h then defines fprintf as a macro, so the stdout hook in deps/reveng/config.h redefined it and -Werror stopped the build in bmpbit.c, cli.c, model.c, poly.c, preset.c and src/cmdcrc.c. Undefine fprintf, fputs and puts before hooking them. Co-Authored-By: Claude Opus 5.5 --- client/deps/reveng/config.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/deps/reveng/config.h b/client/deps/reveng/config.h index 177df030e..c2439f659 100644 --- a/client/deps/reveng/config.h +++ b/client/deps/reveng/config.h @@ -103,6 +103,10 @@ // Proxmark3 stdout/stderr hooking #include "ui.h" +// glibc defines these as macros under clang with _FORTIFY_SOURCE +#undef fprintf +#undef fputs +#undef puts #define fprintf(stream, ...) PrintAndLogEx(INFO, __VA_ARGS__) #define fputs(s, stream) PrintAndLogEx(INFO, "%s", s) #define puts(s) PrintAndLogEx(SUCCESS, "%s", s)