From 0566abe557b8454ffccb4e93dbe675204ad46366 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Fri, 6 Aug 2021 10:54:25 -0400 Subject: [PATCH] ext: explicitly allow C90 and C99 features Related to #2302 and #2303. --- ext/nokogiri/extconf.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ext/nokogiri/extconf.rb b/ext/nokogiri/extconf.rb index 4278dd6e46..0a771b684c 100644 --- a/ext/nokogiri/extconf.rb +++ b/ext/nokogiri/extconf.rb @@ -594,6 +594,10 @@ def do_clean append_ldflags(ENV["LDFLAGS"].split) unless ENV["LDFLAGS"].nil? $LIBS = concat_flags($LIBS, ENV["LIBS"]) +# nokogumbo code uses C90/C99 features, let's make sure older compilers won't give +# errors/warnings. see #2302 +append_cflags(["-std=c99", "-Wno-declaration-after-statement"]) + # always include debugging information append_cflags("-g")