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 739466 - HTMLparser.c: missing field initializer
HTMLparser.c: missing field initializer
Status: RESOLVED FIXED
Product: libxml2
Classification: Platform
Component: htmlparser
git master
Other Mac OS
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
: 739720 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2014-10-31 20:55 UTC by Daniel Macks
Modified: 2017-06-17 11:00 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Daniel Macks 2014-10-31 20:55:22 UTC
Building libxml2-2.9.2 on OS X 10.8 via fink, I get a warning that did not appear in 2.9.1:

/bin/sh ./libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.  -I./include -I./include -I/sw/include -I/sw/include -D_REENTRANT  -I/sw/include  -g -O2 -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls -Wno-long-long -MT HTMLparser.lo -MD -MP -MF .deps/HTMLparser.Tpo -c -o HTMLparser.lo HTMLparser.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I./include -I./include -I/sw/include -I/sw/include -D_REENTRANT -I/sw/include -g -O2 -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls -Wno-long-long -MT HTMLparser.lo -MD -MP -MF .deps/HTMLparser.Tpo -c HTMLparser.c  -fno-common -DPIC -o .libs/HTMLparser.o
HTMLparser.c:4369:41: warning: missing field 'begin_pos' initializer [-Wmissing-field-initializers]
    htmlParserNodeInfo node_info = { 0, };
                                        ^
According to parser.h, htmlParserNodeInfo is a 5-field struct, but here in the htmlParseElementInternal function, only the first field is initialized. Presumably the codeblock knows not to use the other fields before setting them (Bug #731990 only flagged the first field as susceptible to being used before being set), but clang apparently wants you to set them all anyway if you're going to set any of them.
Comment 1 Nick Wellnhofer 2017-06-17 10:59:32 UTC
*** Bug 739720 has been marked as a duplicate of this bug. ***