The branch, master has been updated
       via  afad332d77278232662e6d8c95c2fc80cb44c8dd (commit)
       via  086597adae360a831a70346d6f733faea2ec5e26 (commit)
      from  4377affc28d92f759d1de15ac68ce07b1aa48810 (commit)


- Log -----------------------------------------------------------------
commit afad332d77278232662e6d8c95c2fc80cb44c8dd
Author:     Kacper Michajłow <[email protected]>
AuthorDate: Sat Oct 4 20:37:27 2025 +0200
Commit:     Kacper Michajłow <[email protected]>
CommitDate: Thu Oct 9 03:35:16 2025 +0000

    avutil/attributes: use __has_attribute to test for format attribute
    
    Signed-off-by: Kacper Michajłow <[email protected]>

diff --git a/libavutil/attributes.h b/libavutil/attributes.h
index c0de3102af..2bdf5ed4e4 100644
--- a/libavutil/attributes.h
+++ b/libavutil/attributes.h
@@ -183,13 +183,13 @@
 
 #ifdef __MINGW_PRINTF_FORMAT
 #    define AV_PRINTF_FMT __MINGW_PRINTF_FORMAT
-#elif defined(__GNUC__) || defined(__clang__)
+#elif defined(__has_attribute) && __has_attribute(format)
 #    define AV_PRINTF_FMT __printf__
 #endif
 
 #ifdef __MINGW_SCANF_FORMAT
 #    define AV_SCANF_FMT __MINGW_SCANF_FORMAT
-#elif defined(__GNUC__) || defined(__clang__)
+#elif defined(__has_attribute) && __has_attribute(format)
 #    define AV_SCANF_FMT __scanf__
 #endif
 

commit 086597adae360a831a70346d6f733faea2ec5e26
Author:     Kacper Michajłow <[email protected]>
AuthorDate: Sat Oct 4 08:49:21 2025 +0200
Commit:     Kacper Michajłow <[email protected]>
CommitDate: Thu Oct 9 03:35:16 2025 +0000

    avutil/attributes: don't force format checking to __gnu_printf__ on mingw 
build
    
    Use __MINGW_{PRINTF,SCANF}_FORMAT which matches the format check for
    implementation that is actually used.
    
    Signed-off-by: Kacper Michajłow <[email protected]>

diff --git a/configure b/configure
index 3de3b150ef..7828381b5d 100755
--- a/configure
+++ b/configure
@@ -6225,8 +6225,6 @@ probe_libc(){
         if ! test_${pfx}cpp_condition crtdefs.h "defined(_UCRT)"; then
             add_${pfx}cppflags -D__USE_MINGW_ANSI_STDIO=1
         fi
-        eval test \$${pfx_no_}cc_type = "gcc" &&
-            add_${pfx}cppflags -D__printf__=__gnu_printf__
         test_${pfx}cpp_condition windows.h "!defined(_WIN32_WINNT) || 
_WIN32_WINNT < 0x0600" &&
             add_${pfx}cppflags -D_WIN32_WINNT=0x0600
         add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
@@ -6244,8 +6242,6 @@ probe_libc(){
             add_${pfx}cppflags -D__MSVCRT_VERSION__=0x0700
         test_${pfx}cpp_condition windows.h "!defined(_WIN32_WINNT) || 
_WIN32_WINNT < 0x0600" &&
             add_${pfx}cppflags -D_WIN32_WINNT=0x0600
-        eval test \$${pfx_no_}cc_type = "gcc" &&
-            add_${pfx}cppflags -D__printf__=__gnu_printf__
         add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
     elif test_${pfx}cpp_condition crtversion.h "defined 
_VC_CRT_MAJOR_VERSION"; then
         eval ${pfx}libc_type=msvcrt
diff --git a/libavutil/attributes.h b/libavutil/attributes.h
index 772e327fa4..c0de3102af 100644
--- a/libavutil/attributes.h
+++ b/libavutil/attributes.h
@@ -172,11 +172,36 @@
 
 #if defined(__GNUC__) || defined(__clang__)
 #    define av_builtin_constant_p __builtin_constant_p
-#    define av_printf_format(fmtpos, attrpos) 
__attribute__((__format__(__printf__, fmtpos, attrpos)))
-#    define av_scanf_format(fmtpos, attrpos) 
__attribute__((__format__(__scanf__, fmtpos, attrpos)))
 #else
 #    define av_builtin_constant_p(x) 0
+#endif
+
+// for __MINGW_PRINTF_FORMAT and __MINGW_SCANF_FORMAT
+#ifdef __MINGW32__
+#    include <stdio.h>
+#endif
+
+#ifdef __MINGW_PRINTF_FORMAT
+#    define AV_PRINTF_FMT __MINGW_PRINTF_FORMAT
+#elif defined(__GNUC__) || defined(__clang__)
+#    define AV_PRINTF_FMT __printf__
+#endif
+
+#ifdef __MINGW_SCANF_FORMAT
+#    define AV_SCANF_FMT __MINGW_SCANF_FORMAT
+#elif defined(__GNUC__) || defined(__clang__)
+#    define AV_SCANF_FMT __scanf__
+#endif
+
+#ifdef AV_PRINTF_FMT
+#    define av_printf_format(fmtpos, attrpos) 
__attribute__((format(AV_PRINTF_FMT, fmtpos, attrpos)))
+#else
 #    define av_printf_format(fmtpos, attrpos)
+#endif
+
+#ifdef AV_SCANF_FMT
+#    define av_scanf_format(fmtpos, attrpos) 
__attribute__((format(AV_SCANF_FMT, fmtpos, attrpos)))
+#else
 #    define av_scanf_format(fmtpos, attrpos)
 #endif
 

-----------------------------------------------------------------------

Summary of changes:
 configure              |  4 ----
 libavutil/attributes.h | 29 +++++++++++++++++++++++++++--
 2 files changed, 27 insertions(+), 6 deletions(-)


hooks/post-receive
-- 

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to