summaryrefslogtreecommitdiff
path: root/ext/openssl/extconf.rb
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2022-07-07 09:32:43 -0400
committerPeter Zhu <peter@peterzhu.ca>2022-07-07 13:14:41 -0400
commitc8b3bd45cc3cae93ae701333202416838ee6a00c (patch)
tree3339cfec5d5ad25a7010486cabeb7d8f57ba9c1a /ext/openssl/extconf.rb
parent4d8f12ba3806c735692429f1920a757024a935cc (diff)
Fix extconf.rb for OpenSSL 3 without $warnflags
On Windows with OpenSSL 3, the gem fails to compile with the following error message: ruby/src/ext/openssl/extconf.rb:188: undefined method \`sub!' for nil:NilClass This is because $warnflags is nil.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/6102
Diffstat (limited to 'ext/openssl/extconf.rb')
-rw-r--r--ext/openssl/extconf.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/openssl/extconf.rb b/ext/openssl/extconf.rb
index 467f7e7a86..26abfc8b2a 100644
--- a/ext/openssl/extconf.rb
+++ b/ext/openssl/extconf.rb
@@ -185,7 +185,7 @@ have_func("EVP_PKEY_dup")
Logging::message "=== Checking done. ===\n"
if openssl_3
- if $warnflags.sub!(/-W\K(?=deprecated-declarations)/, 'no-')
+ if $warnflags&.sub!(/-W\K(?=deprecated-declarations)/, 'no-')
$warnflags << " -Wno-incompatible-pointer-types-discards-qualifiers"
end
end