1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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.
This commit is contained in:
Peter Zhu 2022-07-07 09:32:43 -04:00
parent 4d8f12ba38
commit c8b3bd45cc
Notes: git 2022-07-08 02:15:01 +09:00

View file

@ -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