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 751679 - self-assignment warning in xmlschemas.c
self-assignment warning in xmlschemas.c
Status: RESOLVED FIXED
Product: libxml2
Classification: Platform
Component: general
git master
Other Windows
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2015-06-29 21:07 UTC by Scott Graham
Modified: 2015-06-30 02:50 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Scott Graham 2015-06-29 21:07:42 UTC
When compiling with clang (on Windows in this case, but presumably everywhere) with -Wself-assign enabled, this is triggered:

FAILED: ninja -t msvc -e environment.x64 -- "..\..\third_party/llvm-build/Release+Asserts/bin/clang-cl" -m64 /nologo /showIncludes /FC @obj\third_party\libxml\src\libxml.xmlschemas.obj.rsp /c ..\..\third_party\libxml\src\xmlschemas.c /Foobj\third_party\libxml\src\libxml.xmlschemas.obj /Fdobj\third_party\libxml\libxml.c.pdb
..\..\third_party\libxml\src\xmlschemas.c(24205,10) :  error: explicitly assigning value of variable of type 'xmlSchemaValType' to itself [-Werror,-Wself-assign]
        valType = valType;
        ~~~~~~~ ^ ~~~~~~~
1 error generated.

(line 24205 at current ToT)

I'm not certain whether valType needs to be computed in another way? But if not then simply

    if (val != NULL)
	valType = xmlSchemaGetValType(val);

is probably a better way to write what happens at the moment.
Comment 1 Daniel Veillard 2015-06-30 02:50:25 UTC
Ack, makes sense, commited:

https://git.gnome.org/browse/libxml2/commit/?id=58b84e1f822d9323b4bbadeb07ee147cccc96e7e

 thanks !

Daniel