After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 300235 - Conversion between void pointer and function pointer in xpath.c
Conversion between void pointer and function pointer in xpath.c
Status: RESOLVED FIXED
Product: libxml2
Classification: Platform
Component: xpath
2.6.19
Other Linux
: Normal enhancement
: ---
Assigned To: Nick Wellnhofer
Depends on:
Blocks:
 
 
Reported: 2005-04-11 18:34 UTC by Mike Hommey
Modified: 2017-11-27 13:00 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Mike Hommey 2005-04-11 18:34:11 UTC
Distribution/Version: Debian

Here are the warnings I get while building libxml2 2.6.19 with -Wall
flag, you might want to fix these, or at least, some.

Mike

PS: I'm not sure the generated libxml.c file in the python directory
matches the one in the tarball, so line numbers might not be accurate.

xpath.c: In function `xmlXPathRegisterFuncNS__internal_alias':
xpath.c:2834: warning: ISO C forbids passing arg 4 of
`xmlHashAddEntry2__internal_alias' between function pointer and `void *'
xpath.c: In function `xmlXPathFunctionLookupNS__internal_alias':
xpath.c:2915: warning: ISO C forbids assignment between function pointer and
`void *'
xpath.c: In function `xmlXPathCompOpEval':
xpath.c:10434: warning: ISO C forbids assignment between function pointer and
`void *'
xpath.c:10459: warning: ISO C forbids assignment between function pointer and
`void *'

c14n.c: In function `xmlC14NIsNodeInNodeset':
c14n.c:268: warning: dereferencing type-punned pointer will break
strict-aliasing rules

testModule.c: In function `main':
testModule.c:46: warning: dereferencing type-punned pointer will break
strict-aliasing rules

libxml.c: In function `libxml_xmlValidCtxtGenericErrorFuncHandler':
libxml.c:1739: warning: unused parameter `severity'
libxml.c: In function `libxml_xmlValidCtxtGenericWarningFuncHandler':
libxml.c:1766: warning: unused parameter `severity'
libxml.c: In function `libxml_xmlRelaxNGSetValidErrors':
libxml.c:3092: warning: dereferencing type-punned pointer will break
strict-aliasing rules
libxml.c: In function `libxml_xmlRelaxNGFreeValidCtxt':
libxml.c:3138: warning: dereferencing type-punned pointer will break
strict-aliasing rules
libxml.c: In function `libxml_xmlSchemaSetValidErrors':
libxml.c:3256: warning: dereferencing type-punned pointer will break
strict-aliasing rules
libxml.c: In function `libxml_xmlSchemaFreeValidCtxt':
libxml.c:3303: warning: dereferencing type-punned pointer will break
strict-aliasing rules

Additionnal informations:
# gcc -v
Reading specs from /usr/lib/gcc-lib/i486-linux/3.3.5/specs
Configured with: ../src/configure -v
--enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr
--mandir=/usr/share/man --infodir=/usr/share/info
--with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared
--enable-__cxa_atexit --with-system-zlib --enable-nls --without-included-gettext
--enable-clocale=gnu --enable-debug --enable-java-gc=boehm
--enable-java-awt=xlib --enable-objc-gc i486-linux
Thread model: posix
gcc version 3.3.5 (Debian 1:3.3.5-12)

tree built using
CFLAGS="-Wall -g -O2" ./configure --prefix=/usr
Comment 1 Daniel Veillard 2005-04-12 01:04:16 UTC
Yeah, we used to have a work around but it broke register aliasing on
gcc4 in s390, so it's an open issue again,

Daniel
Comment 2 Nick Wellnhofer 2017-06-17 15:17:41 UTC
The most correct fix for the "conversion between void pointer and function pointer" warning in xpath.c is to use a union of function and void pointers as payload in hash.c and add separate functions to work with function pointers in hashes. This is a lot of stupid work just for one use case, of course.
Comment 3 Nick Wellnhofer 2017-11-27 13:00:40 UTC
Fixed here by ignoring the warnings using GCC pragmas: https://git.gnome.org/browse/libxml2/commit/?id=13acadbb1ca1f42a65c6466dca025d4020be192a