Project

General

Profile

Bug #13060

pkg_config breaks when adding '-Wconversion' to $CFLAGS

Added by hone (Terence Lee) over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
ruby -v:
ruby 2.4.0rc1 (2016-12-12 trunk 57064) [x86_64-linux]
Backport:
[ruby-core:78794]

Description

When compiling the nokogiri gem, you can opt to use system libraries which uses pkg_config. When I add '-Wconversion' to $CFLAGS, it causes 'pkg_config('libxml-2.0')' to return nil. This is not the case in Ruby 2.3.3.

This will affect anyone using nokogiri with Ruby 2.4.0 on Heroku.

test script:

require 'mkmf'

puts RUBY_DESCRIPTION
puts "pkg_config('libxml-2.0'): #{pkg_config('libxml-2.0').inspect}"
puts "Adding -Wconversion to $CFLAGS"
$CFLAGS << " -Wconversion"
puts "pkg_config('libxml-2.0'): #{pkg_config('libxml-2.0').inspect}"

ruby 2.3.3 output:

ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-linux]
pkg_config('libxml-2.0'): ["", "", "-lxml2"]
Adding -Wconversion to $CFLAGS
pkg_config('libxml-2.0'): ["", "", "-lxml2"]

ruby 2.4.0-rc1 output:

ruby 2.4.0rc1 (2016-12-12 trunk 57064) [x86_64-linux]
pkg_config('libxml-2.0'): ["", "", "-lxml2"]
Adding -Wconversion to $CFLAGS
pkg_config('libxml-2.0'): nil

Associated revisions

Revision 5153260c
Added by naruse (Yui NARUSE) over 2 years ago

suppress warning: implicit conversion changes signedness

It causes [Bug #13060]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57150 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 57150
Added by naruse (Yui NARUSE) over 2 years ago

suppress warning: implicit conversion changes signedness

It causes [Bug #13060]

Revision 57150
Added by naruse (Yui NARUSE) over 2 years ago

suppress warning: implicit conversion changes signedness

It causes [Bug #13060]

Revision 57150
Added by naruse (Yui NARUSE) over 2 years ago

suppress warning: implicit conversion changes signedness

It causes [Bug #13060]

Revision 57150
Added by naruse (Yui NARUSE) over 2 years ago

suppress warning: implicit conversion changes signedness

It causes [Bug #13060]

History

#2

Updated by naruse (Yui NARUSE) over 2 years ago

  • Status changed from Open to Closed

Applied in changeset r57150.


suppress warning: implicit conversion changes signedness

It causes [Bug #13060]

Updated by nobu (Nobuyoshi Nakada) over 2 years ago

  • Description updated (diff)

Also available in: Atom PDF