From 007df69726ae6c7711985a59491f078b7b55dab5 Mon Sep 17 00:00:00 2001 From: Dirk Zimoch Date: Wed, 30 Jul 2025 17:23:19 +0200 Subject: [PATCH] fix EPICS_PRINTF_STYLE so old mingw recognizes %ll and %z (#674) gcc knows __gnu_printf__ since version 4.4.0, not only for MinGW but for all targets. As we would need to check the gcc version anyway to avoid "unrecognized format function type" errors with older MinGW versions, we can simply use it for recent gcc versions and not depend on MinGW at all. --- modules/libcom/src/osi/compiler/gcc/compilerSpecific.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/libcom/src/osi/compiler/gcc/compilerSpecific.h b/modules/libcom/src/osi/compiler/gcc/compilerSpecific.h index 42723b97c..80b72012f 100644 --- a/modules/libcom/src/osi/compiler/gcc/compilerSpecific.h +++ b/modules/libcom/src/osi/compiler/gcc/compilerSpecific.h @@ -45,7 +45,11 @@ /* * Enable format-string checking if possible */ +#if __GNUC__ * 100 + __GNUC_MINOR__ >= 404 +#define EPICS_PRINTF_STYLE(f,a) __attribute__((format(__gnu_printf__,f,a))) +#else #define EPICS_PRINTF_STYLE(f,a) __attribute__((format(__printf__,f,a))) +#endif /* * Deprecation marker