Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix gcc warings - alternative to #2061 #2068

Merged
merged 2 commits into from
Aug 28, 2020

Conversation

larskanis
Copy link
Member

What problem is this PR intended to solve?

GCC raises warnings for the function pointer mismatches and Visual-C raises errors in #2061 . Both should be fixed by this patch. In contrast to #2061 this patch ensures type safety for the single values to be passed to the callback.

Have you included adequate test coverage?

Visual-C is not tested.

Does this change affect the C or the Java implementations?

Only C.

../../../../ext/nokogiri/xml_document.c: In function ‘dealloc’:
../../../../ext/nokogiri/xml_document.c:58:25: warning: passing argument 2 of ‘rb_st_foreach’ from incompatible pointer type [-Wincompatible-pointer-types]
   58 |   st_foreach(node_hash, dealloc_node_i, (st_data_t)doc);
      |                         ^~~~~~~~~~~~~~
      |                         |
      |                         int (*)(xmlNode *, xmlNode *, xmlDoc *) {aka int (*)(struct _xmlNode *, struct _xmlNode *, struct _xmlDoc *)}
@codeclimate
Copy link

codeclimate bot commented Aug 25, 2020

Code Climate has analyzed commit 6c0af79 and detected 0 issues on this pull request.

View more on Code Climate.

@larskanis
Copy link
Member Author

I'm always cautious with casting function pointers. It disables all type checks and the compiler isn't aware about type casts for the values passed to and from the callback.

@flavorjones Do you agree with me?
@preetpalS Could you verify that this PR fixes the build issue on Visual-C for you?

@AppVeyorBot
Copy link

@preetpalS
Copy link

@larskanis It builds successfully on Ruby build with Visual C++ and all tests pass (re-compiled my Ruby installation).

Command Line Log from Compilation and Run of Test Suite
C:\Users\preet\Projects\OpenSource\forks\nokogiri>bundle exec rake compile -- --use-system-libraries
mkdir -p tmp/x64-mswin64_140/nokogiri/2.7.1
cd tmp/x64-mswin64_140/nokogiri/2.7.1
C:/ruby/mswin64/ruby271/bin/ruby.exe -I. ../../../../ext/nokogiri/extconf.rb  -- --use-system-libraries
checking if the C compiler accepts ... no
Building nokogiri using system libraries.
pkg-config could not be used to find libxml-2.0
Please install either `pkg-config` or the pkg-config gem per

    gem install pkg-config -v "~> 1.1"

pkg-config could not be used to find libxslt
Please install either `pkg-config` or the pkg-config gem per

    gem install pkg-config -v "~> 1.1"

pkg-config could not be used to find libexslt
Please install either `pkg-config` or the pkg-config gem per

    gem install pkg-config -v "~> 1.1"

checking for xmlParseDoc() in libxml/parser.h... no
checking for xmlParseDoc() in xml2.lib... no
checking for xmlParseDoc() in libxml2.lib... yes
checking for xsltParseStylesheetDoc() in libxslt/xslt.h... no
checking for xsltParseStylesheetDoc() in xslt.lib... no
checking for xsltParseStylesheetDoc() in libxslt.lib... yes
checking for exsltFuncRegister() in libexslt/exslt.h... no
checking for exsltFuncRegister() in exslt.lib... no
checking for exsltFuncRegister() in libexslt.lib... yes
checking for xmlHasFeature()... yes
checking for xmlFirstElementChild()... yes
checking for xmlRelaxNGSetParserStructuredErrors()... yes
checking for xmlRelaxNGSetParserStructuredErrors()... yes
checking for xmlRelaxNGSetValidStructuredErrors()... yes
checking for xmlSchemaSetValidStructuredErrors()... yes
checking for xmlSchemaSetParserStructuredErrors()... yes
creating Makefile
cd -
cd tmp/x64-mswin64_140/nokogiri/2.7.1
nmake

Microsoft (R) Program Maintenance Utility Version 14.27.29111.0
Copyright (C) Microsoft Corporation.  All rights reserved.

generating nokogiri-x64-mswin64_140.def
compiling ../../../../ext/nokogiri/html_document.c
html_document.c
C:\ruby\mswin64\ruby271\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/html_element_description.c
html_element_description.c
C:\ruby\mswin64\ruby271\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/html_entity_lookup.c
html_entity_lookup.c
C:\ruby\mswin64\ruby271\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/html_sax_parser_context.c
html_sax_parser_context.c
C:\ruby\mswin64\ruby271\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/html_sax_push_parser.c
html_sax_push_parser.c
C:\ruby\mswin64\ruby271\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/nokogiri.c
nokogiri.c
C:\ruby\mswin64\ruby271\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_attr.c
xml_attr.c
C:\ruby\mswin64\ruby271\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_attribute_decl.c
xml_attribute_decl.c
C:\ruby\mswin64\ruby271\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_cdata.c
xml_cdata.c
C:\ruby\mswin64\ruby271\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_comment.c
xml_comment.c
C:\ruby\mswin64\ruby271\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_document.c
xml_document.c
C:\ruby\mswin64\ruby271\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_document_fragment.c
xml_document_fragment.c
C:\ruby\mswin64\ruby271\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_dtd.c
xml_dtd.c
C:\ruby\mswin64\ruby271\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_element_content.c
xml_element_content.c
C:\ruby\mswin64\ruby271\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_element_decl.c
xml_element_decl.c
C:\ruby\mswin64\ruby271\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_encoding_handler.c
xml_encoding_handler.c
C:\ruby\mswin64\ruby271\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_entity_decl.c
xml_entity_decl.c
C:\ruby\mswin64\ruby271\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_entity_reference.c
xml_entity_reference.c
C:\ruby\mswin64\ruby271\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_io.c
xml_io.c
C:\ruby\mswin64\ruby271\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_libxml2_hacks.c
xml_libxml2_hacks.c
compiling ../../../../ext/nokogiri/xml_namespace.c
xml_namespace.c
C:\ruby\mswin64\ruby271\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_node.c
xml_node.c
C:\ruby\mswin64\ruby271\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
../../../../ext/nokogiri/xml_node.c(304): warning C4090: 'function': different 'const' qualifiers
../../../../ext/nokogiri/xml_node.c(383): warning C4311: 'type cast': pointer truncation from 'xmlNodePtr' to 'long'
compiling ../../../../ext/nokogiri/xml_node_set.c
xml_node_set.c
C:\ruby\mswin64\ruby271\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_processing_instruction.c
xml_processing_instruction.c
C:\ruby\mswin64\ruby271\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_reader.c
xml_reader.c
C:\ruby\mswin64\ruby271\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_relax_ng.c
xml_relax_ng.c
C:\ruby\mswin64\ruby271\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_sax_parser.c
xml_sax_parser.c
C:\ruby\mswin64\ruby271\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_sax_parser_context.c
xml_sax_parser_context.c
C:\ruby\mswin64\ruby271\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_sax_push_parser.c
xml_sax_push_parser.c
C:\ruby\mswin64\ruby271\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_schema.c
xml_schema.c
C:\ruby\mswin64\ruby271\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_syntax_error.c
xml_syntax_error.c
C:\ruby\mswin64\ruby271\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_text.c
xml_text.c
C:\ruby\mswin64\ruby271\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xml_xpath_context.c
xml_xpath_context.c
C:\ruby\mswin64\ruby271\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
compiling ../../../../ext/nokogiri/xslt_stylesheet.c
xslt_stylesheet.c
C:\ruby\mswin64\ruby271\include\ruby-2.7.0\x64-mswin64_140\ruby/config.h(22): warning C4117: macro name '_INTEGRAL_MAX_BITS' is reserved, '#define' ignored
../../../../ext/nokogiri/xslt_stylesheet.c(167): warning C4090: 'function': different 'const' qualifiers
linking shared-object nokogiri/nokogiri.so
   Creating library nokogiri-x64-mswin64_140.lib and object nokogiri-x64-mswin64_140.exp
cd -
mkdir -p tmp/x64-mswin64_140/stage/lib/nokogiri
cp LICENSE-DEPENDENCIES.md tmp/x64-mswin64_140/stage/LICENSE-DEPENDENCIES.md
cp LICENSE.md tmp/x64-mswin64_140/stage/LICENSE.md
cp README.md tmp/x64-mswin64_140/stage/README.md
mkdir -p tmp/x64-mswin64_140/stage/bin
cp bin/nokogiri tmp/x64-mswin64_140/stage/bin/nokogiri
cp dependencies.yml tmp/x64-mswin64_140/stage/dependencies.yml
mkdir -p tmp/x64-mswin64_140/stage/ext/nokogiri
cp ext/nokogiri/depend tmp/x64-mswin64_140/stage/ext/nokogiri/depend
cp ext/nokogiri/extconf.rb tmp/x64-mswin64_140/stage/ext/nokogiri/extconf.rb
cp ext/nokogiri/html_document.c tmp/x64-mswin64_140/stage/ext/nokogiri/html_document.c
cp ext/nokogiri/html_document.h tmp/x64-mswin64_140/stage/ext/nokogiri/html_document.h
cp ext/nokogiri/html_element_description.c tmp/x64-mswin64_140/stage/ext/nokogiri/html_element_description.c
cp ext/nokogiri/html_element_description.h tmp/x64-mswin64_140/stage/ext/nokogiri/html_element_description.h
cp ext/nokogiri/html_entity_lookup.c tmp/x64-mswin64_140/stage/ext/nokogiri/html_entity_lookup.c
cp ext/nokogiri/html_entity_lookup.h tmp/x64-mswin64_140/stage/ext/nokogiri/html_entity_lookup.h
cp ext/nokogiri/html_sax_parser_context.c tmp/x64-mswin64_140/stage/ext/nokogiri/html_sax_parser_context.c
cp ext/nokogiri/html_sax_parser_context.h tmp/x64-mswin64_140/stage/ext/nokogiri/html_sax_parser_context.h
cp ext/nokogiri/html_sax_push_parser.c tmp/x64-mswin64_140/stage/ext/nokogiri/html_sax_push_parser.c
cp ext/nokogiri/html_sax_push_parser.h tmp/x64-mswin64_140/stage/ext/nokogiri/html_sax_push_parser.h
cp ext/nokogiri/nokogiri.c tmp/x64-mswin64_140/stage/ext/nokogiri/nokogiri.c
cp ext/nokogiri/nokogiri.h tmp/x64-mswin64_140/stage/ext/nokogiri/nokogiri.h
cp ext/nokogiri/xml_attr.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_attr.c
cp ext/nokogiri/xml_attr.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_attr.h
cp ext/nokogiri/xml_attribute_decl.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_attribute_decl.c
cp ext/nokogiri/xml_attribute_decl.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_attribute_decl.h
cp ext/nokogiri/xml_cdata.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_cdata.c
cp ext/nokogiri/xml_cdata.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_cdata.h
cp ext/nokogiri/xml_comment.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_comment.c
cp ext/nokogiri/xml_comment.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_comment.h
cp ext/nokogiri/xml_document.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_document.c
cp ext/nokogiri/xml_document.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_document.h
cp ext/nokogiri/xml_document_fragment.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_document_fragment.c
cp ext/nokogiri/xml_document_fragment.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_document_fragment.h
cp ext/nokogiri/xml_dtd.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_dtd.c
cp ext/nokogiri/xml_dtd.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_dtd.h
cp ext/nokogiri/xml_element_content.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_element_content.c
cp ext/nokogiri/xml_element_content.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_element_content.h
cp ext/nokogiri/xml_element_decl.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_element_decl.c
cp ext/nokogiri/xml_element_decl.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_element_decl.h
cp ext/nokogiri/xml_encoding_handler.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_encoding_handler.c
cp ext/nokogiri/xml_encoding_handler.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_encoding_handler.h
cp ext/nokogiri/xml_entity_decl.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_entity_decl.c
cp ext/nokogiri/xml_entity_decl.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_entity_decl.h
cp ext/nokogiri/xml_entity_reference.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_entity_reference.c
cp ext/nokogiri/xml_entity_reference.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_entity_reference.h
cp ext/nokogiri/xml_io.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_io.c
cp ext/nokogiri/xml_io.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_io.h
cp ext/nokogiri/xml_libxml2_hacks.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_libxml2_hacks.c
cp ext/nokogiri/xml_libxml2_hacks.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_libxml2_hacks.h
cp ext/nokogiri/xml_namespace.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_namespace.c
cp ext/nokogiri/xml_namespace.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_namespace.h
cp ext/nokogiri/xml_node.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_node.c
cp ext/nokogiri/xml_node.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_node.h
cp ext/nokogiri/xml_node_set.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_node_set.c
cp ext/nokogiri/xml_node_set.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_node_set.h
cp ext/nokogiri/xml_processing_instruction.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_processing_instruction.c
cp ext/nokogiri/xml_processing_instruction.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_processing_instruction.h
cp ext/nokogiri/xml_reader.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_reader.c
cp ext/nokogiri/xml_reader.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_reader.h
cp ext/nokogiri/xml_relax_ng.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_relax_ng.c
cp ext/nokogiri/xml_relax_ng.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_relax_ng.h
cp ext/nokogiri/xml_sax_parser.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_sax_parser.c
cp ext/nokogiri/xml_sax_parser.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_sax_parser.h
cp ext/nokogiri/xml_sax_parser_context.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_sax_parser_context.c
cp ext/nokogiri/xml_sax_parser_context.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_sax_parser_context.h
cp ext/nokogiri/xml_sax_push_parser.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_sax_push_parser.c
cp ext/nokogiri/xml_sax_push_parser.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_sax_push_parser.h
cp ext/nokogiri/xml_schema.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_schema.c
cp ext/nokogiri/xml_schema.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_schema.h
cp ext/nokogiri/xml_syntax_error.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_syntax_error.c
cp ext/nokogiri/xml_syntax_error.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_syntax_error.h
cp ext/nokogiri/xml_text.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_text.c
cp ext/nokogiri/xml_text.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_text.h
cp ext/nokogiri/xml_xpath_context.c tmp/x64-mswin64_140/stage/ext/nokogiri/xml_xpath_context.c
cp ext/nokogiri/xml_xpath_context.h tmp/x64-mswin64_140/stage/ext/nokogiri/xml_xpath_context.h
cp ext/nokogiri/xslt_stylesheet.c tmp/x64-mswin64_140/stage/ext/nokogiri/xslt_stylesheet.c
cp ext/nokogiri/xslt_stylesheet.h tmp/x64-mswin64_140/stage/ext/nokogiri/xslt_stylesheet.h
cp lib/nokogiri.rb tmp/x64-mswin64_140/stage/lib/nokogiri.rb
cp lib/nokogiri/css.rb tmp/x64-mswin64_140/stage/lib/nokogiri/css.rb
mkdir -p tmp/x64-mswin64_140/stage/lib/nokogiri/css
cp lib/nokogiri/css/node.rb tmp/x64-mswin64_140/stage/lib/nokogiri/css/node.rb
racc -l -o lib/nokogiri/css/parser.rb lib/nokogiri/css/parser.y
1 reduce/reduce conflicts
cp lib/nokogiri/css/parser.rb tmp/x64-mswin64_140/stage/lib/nokogiri/css/parser.rb
cp lib/nokogiri/css/parser.y tmp/x64-mswin64_140/stage/lib/nokogiri/css/parser.y
cp lib/nokogiri/css/parser_extras.rb tmp/x64-mswin64_140/stage/lib/nokogiri/css/parser_extras.rb
cp lib/nokogiri/css/syntax_error.rb tmp/x64-mswin64_140/stage/lib/nokogiri/css/syntax_error.rb
rex --independent -o lib/nokogiri/css/tokenizer.rb lib/nokogiri/css/tokenizer.rex
cp lib/nokogiri/css/tokenizer.rb tmp/x64-mswin64_140/stage/lib/nokogiri/css/tokenizer.rb
cp lib/nokogiri/css/tokenizer.rex tmp/x64-mswin64_140/stage/lib/nokogiri/css/tokenizer.rex
cp lib/nokogiri/css/xpath_visitor.rb tmp/x64-mswin64_140/stage/lib/nokogiri/css/xpath_visitor.rb
mkdir -p tmp/x64-mswin64_140/stage/lib/nokogiri/decorators
cp lib/nokogiri/decorators/slop.rb tmp/x64-mswin64_140/stage/lib/nokogiri/decorators/slop.rb
cp lib/nokogiri/html.rb tmp/x64-mswin64_140/stage/lib/nokogiri/html.rb
mkdir -p tmp/x64-mswin64_140/stage/lib/nokogiri/html
cp lib/nokogiri/html/builder.rb tmp/x64-mswin64_140/stage/lib/nokogiri/html/builder.rb
cp lib/nokogiri/html/document.rb tmp/x64-mswin64_140/stage/lib/nokogiri/html/document.rb
cp lib/nokogiri/html/document_fragment.rb tmp/x64-mswin64_140/stage/lib/nokogiri/html/document_fragment.rb
cp lib/nokogiri/html/element_description.rb tmp/x64-mswin64_140/stage/lib/nokogiri/html/element_description.rb
cp lib/nokogiri/html/element_description_defaults.rb tmp/x64-mswin64_140/stage/lib/nokogiri/html/element_description_defaults.rb
cp lib/nokogiri/html/entity_lookup.rb tmp/x64-mswin64_140/stage/lib/nokogiri/html/entity_lookup.rb
mkdir -p tmp/x64-mswin64_140/stage/lib/nokogiri/html/sax
cp lib/nokogiri/html/sax/parser.rb tmp/x64-mswin64_140/stage/lib/nokogiri/html/sax/parser.rb
cp lib/nokogiri/html/sax/parser_context.rb tmp/x64-mswin64_140/stage/lib/nokogiri/html/sax/parser_context.rb
cp lib/nokogiri/html/sax/push_parser.rb tmp/x64-mswin64_140/stage/lib/nokogiri/html/sax/push_parser.rb
mkdir -p tmp/x64-mswin64_140/stage/lib/nokogiri/jruby
cp lib/nokogiri/jruby/dependencies.rb tmp/x64-mswin64_140/stage/lib/nokogiri/jruby/dependencies.rb
cp lib/nokogiri/syntax_error.rb tmp/x64-mswin64_140/stage/lib/nokogiri/syntax_error.rb
cp lib/nokogiri/version.rb tmp/x64-mswin64_140/stage/lib/nokogiri/version.rb
cp lib/nokogiri/xml.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml.rb
mkdir -p tmp/x64-mswin64_140/stage/lib/nokogiri/xml
cp lib/nokogiri/xml/attr.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/attr.rb
cp lib/nokogiri/xml/attribute_decl.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/attribute_decl.rb
cp lib/nokogiri/xml/builder.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/builder.rb
cp lib/nokogiri/xml/cdata.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/cdata.rb
cp lib/nokogiri/xml/character_data.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/character_data.rb
cp lib/nokogiri/xml/document.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/document.rb
cp lib/nokogiri/xml/document_fragment.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/document_fragment.rb
cp lib/nokogiri/xml/dtd.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/dtd.rb
cp lib/nokogiri/xml/element_content.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/element_content.rb
cp lib/nokogiri/xml/element_decl.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/element_decl.rb
cp lib/nokogiri/xml/entity_decl.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/entity_decl.rb
cp lib/nokogiri/xml/entity_reference.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/entity_reference.rb
cp lib/nokogiri/xml/namespace.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/namespace.rb
cp lib/nokogiri/xml/node.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/node.rb
mkdir -p tmp/x64-mswin64_140/stage/lib/nokogiri/xml/node
cp lib/nokogiri/xml/node/save_options.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/node/save_options.rb
cp lib/nokogiri/xml/node_set.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/node_set.rb
cp lib/nokogiri/xml/notation.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/notation.rb
cp lib/nokogiri/xml/parse_options.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/parse_options.rb
cp lib/nokogiri/xml/pp.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/pp.rb
mkdir -p tmp/x64-mswin64_140/stage/lib/nokogiri/xml/pp
cp lib/nokogiri/xml/pp/character_data.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/pp/character_data.rb
cp lib/nokogiri/xml/pp/node.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/pp/node.rb
cp lib/nokogiri/xml/processing_instruction.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/processing_instruction.rb
cp lib/nokogiri/xml/reader.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/reader.rb
cp lib/nokogiri/xml/relax_ng.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/relax_ng.rb
cp lib/nokogiri/xml/sax.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/sax.rb
mkdir -p tmp/x64-mswin64_140/stage/lib/nokogiri/xml/sax
cp lib/nokogiri/xml/sax/document.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/sax/document.rb
cp lib/nokogiri/xml/sax/parser.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/sax/parser.rb
cp lib/nokogiri/xml/sax/parser_context.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/sax/parser_context.rb
cp lib/nokogiri/xml/sax/push_parser.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/sax/push_parser.rb
cp lib/nokogiri/xml/schema.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/schema.rb
cp lib/nokogiri/xml/searchable.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/searchable.rb
cp lib/nokogiri/xml/syntax_error.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/syntax_error.rb
cp lib/nokogiri/xml/text.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/text.rb
cp lib/nokogiri/xml/xpath.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/xpath.rb
mkdir -p tmp/x64-mswin64_140/stage/lib/nokogiri/xml/xpath
cp lib/nokogiri/xml/xpath/syntax_error.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/xpath/syntax_error.rb
cp lib/nokogiri/xml/xpath_context.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xml/xpath_context.rb
cp lib/nokogiri/xslt.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xslt.rb
mkdir -p tmp/x64-mswin64_140/stage/lib/nokogiri/xslt
cp lib/nokogiri/xslt/stylesheet.rb tmp/x64-mswin64_140/stage/lib/nokogiri/xslt/stylesheet.rb
mkdir -p tmp/x64-mswin64_140/stage/lib/xsd/xmlparser
cp lib/xsd/xmlparser/nokogiri.rb tmp/x64-mswin64_140/stage/lib/xsd/xmlparser/nokogiri.rb
install -c tmp/x64-mswin64_140/nokogiri/2.7.1/nokogiri.so lib/nokogiri/nokogiri.so
cp tmp/x64-mswin64_140/nokogiri/2.7.1/nokogiri.so tmp/x64-mswin64_140/stage/lib/nokogiri/nokogiri.so

C:\Users\preet\Projects\OpenSource\forks\nokogiri>bundle exec rake test
rubocop lib --only Security
Inspecting 62 files
..............................................................

62 files inspected, no offenses detected
rubocop lib --auto-correct-all --only Style/FrozenStringLiteralComment
Inspecting 62 files
...C..C.......................................................

Offenses:

lib/nokogiri/css/parser.rb:1:1: C: [Corrected] Style/FrozenStringLiteralComment: Missing frozen string literal comment.
#
^
lib/nokogiri/css/tokenizer.rb:1:1: C: [Corrected] Style/FrozenStringLiteralComment: Missing frozen string literal comment.
#--
^

62 files inspected, 2 offenses detected, 2 offenses corrected
C:/ruby/mswin64/ruby271/lib/ruby/gems/2.7.0/gems/simplecov-0.19.0/lib/simplecov/configuration.rb:203: warning: instance variable @enable_for_subprocesses not initialized
C:/Users/preet/Projects/OpenSource/forks/nokogiri/test/helper.rb:29: version info: {"warnings"=>[], "nokogiri"=>"1.11.0.rc2", "ruby"=>{"version"=>"2.7.1", "platform"=>"x64-mswin64_140", "description"=>"ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x64-mswin64_140]", "engine"=>"ruby"}, "libxml"=>{"source"=>"system", "compiled"=>"2.9.9", "loaded"=>"2.9.9"}, "libxslt"=>{"source"=>"system", "compiled"=>"1.1.33", "loaded"=>"1.1.33"}}
Run options: --seed 64393

# Running:

******************************************************************************************************************************************************************************************S***************************************************************S************************************************************************************************************************************************************S*****************************************************S*****************************************************************************S*S*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************S*S*************************************************************************************************************************************************************************************************S******************************************************************************************************S******************************************************************************************************************************************************************************

Fabulous run in 16.468551s, 92.1150 runs/s, 257.8855 assertions/s.

1517 runs, 4247 assertions, 0 failures, 0 errors, 10 skips

You have skipped tests. Run with --verbose for details.
Coverage report generated for Minitest to C:/Users/preet/Projects/OpenSource/forks/nokogiri/coverage. 2260 / 2396 LOC (94.32%) covered.

C:\Users\preet\Projects\OpenSource\forks\nokogiri>ruby -v
ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x64-mswin64_140]

C:\Users\preet\Projects\OpenSource\forks\nokogiri>git log -n 1
commit 0026e337e65bd7bee7a1ddf0ef429fb64ecad0a8 (HEAD -> fix-gcc-warings, origin/fix-gcc-warings)
Author: Lars Kanis <[email protected]>
Date:   Tue Aug 25 21:58:13 2020 +0200

    Fix gcc warning about mismatching function pointers

    ../../../../ext/nokogiri/xml_io.c: In function <E2><80><98>io_read_callback<E2><80><99>:
    ../../../../ext/nokogiri/xml_io.c:20:22: warning: passing argument 1 of <E2><80><98>rb_rescue<E2><80><99> from incompatible pointer type [-Wincompatible-pointer-types]
       20 |   string = rb_rescue(read_check, (VALUE)args, read_failed, 0);
          |                      ^~~~~~~~~~
          |                      |
          |                      VALUE (*)(VALUE *) {aka long unsigned int (*)(long unsigned int *)}

    and

    ../../../../ext/nokogiri/xml_io.c:20:47: warning: passing argument 3 of <E2><80><98>rb_rescue<E2><80><99> from incompatible pointer type [-Wincompatible-pointer-types]
       20 |   string = rb_rescue(read_check, (VALUE)args, read_failed, 0);
          |                                               ^~~~~~~~~~~
          |                                               |
          |                                               VALUE (*)(void) {aka long unsigned int (*)(void)}

C:\Users\preet\Projects\OpenSource\forks\nokogiri>

ext/nokogiri/xml_io.c Outdated Show resolved Hide resolved
../../../../ext/nokogiri/xml_io.c: In function ‘io_read_callback’:
../../../../ext/nokogiri/xml_io.c:20:22: warning: passing argument 1 of ‘rb_rescue’ from incompatible pointer type [-Wincompatible-pointer-types]
   20 |   string = rb_rescue(read_check, (VALUE)args, read_failed, 0);
      |                      ^~~~~~~~~~
      |                      |
      |                      VALUE (*)(VALUE *) {aka long unsigned int (*)(long unsigned int *)}

and

../../../../ext/nokogiri/xml_io.c:20:47: warning: passing argument 3 of ‘rb_rescue’ from incompatible pointer type [-Wincompatible-pointer-types]
   20 |   string = rb_rescue(read_check, (VALUE)args, read_failed, 0);
      |                                               ^~~~~~~~~~~
      |                                               |
      |                                               VALUE (*)(void) {aka long unsigned int (*)(void)}
@AppVeyorBot
Copy link

@flavorjones
Copy link
Member

I like this approach - will merge shortly.

@flavorjones flavorjones merged commit 6f7dc6e into sparklemotion:master Aug 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants