From 569d2e0480fc1eaa888d74bcd03511514ec7b232 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Sun, 5 Jul 2026 19:06:00 +0900 Subject: [PATCH] Use append_cflags for GCC-specific warning flags cl.exe rejects -Wno-declaration-after-statement with command line error D8021, breaking source builds on x64-mswin64. append_cflags keeps only the flags the compiler actually accepts, so GCC and clang builds are unaffected. Co-Authored-By: Claude Fable 5 --- ext/yajl/extconf.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/yajl/extconf.rb b/ext/yajl/extconf.rb index 631c68c..fc9f4af 100644 --- a/ext/yajl/extconf.rb +++ b/ext/yajl/extconf.rb @@ -1,7 +1,7 @@ require 'mkmf' require 'rbconfig' -$CFLAGS << ' -Wall -funroll-loops -Wno-declaration-after-statement' +append_cflags(%w[-Wall -funroll-loops -Wno-declaration-after-statement]) $CFLAGS << ' -Werror-implicit-function-declaration -Wextra -O0 -ggdb3' if ENV['DEBUG'] if ENV['SANITIZE']