1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-27 13:25:05 +03:00
Commit Graph

4647 Commits

Author SHA1 Message Date
Nick Wellnhofer
790c230fcf Run Travis tests with -Werror 2017-11-27 14:35:29 +01:00
Nick Wellnhofer
45efd0b05b Build with "-Wall -Wextra"
Remove warning options that are enabled with "-Wall -Wextra".

Disable -Warray-bounds warning that produces a (seemingly) false
positive in xpath.c.
2017-11-27 14:35:29 +01:00
Nick Wellnhofer
2677fbf4a4 Fix -Wtautological-pointer-compare warnings
Skip tautological pointer comparisons on pthread systems where we don't
use the weak symbols hack.
2017-11-27 14:35:29 +01:00
Nick Wellnhofer
ff628d46a1 Stop including ansidecl.h
This seems to be an undocumented, internal GCC header added a long time
ago. I don't know why it was included, but I think it can be safely
removed.
2017-11-27 14:35:29 +01:00
Nick Wellnhofer
bf3b456350 Remove unused AC_CHECKs 2017-11-27 14:35:29 +01:00
Nick Wellnhofer
cb5541c9f3 Fix libz and liblzma detection
If libz or liblzma are detected with pkg-config, AC_CHECK_HEADERS must
not be run because the correct CPPFLAGS aren't set. It is actually not
required have separate checks for LIBXML_ZLIB_ENABLED and HAVE_ZLIB_H.
Only check for LIBXML_ZLIB_ENABLED and remove HAVE_ZLIB_H macro.

Fixes bug 764657, bug 787041.
2017-11-27 14:33:37 +01:00
Nick Wellnhofer
ddbb075b70 Fix xmlXPathIsNaN broken by recent commit 2017-11-27 14:33:26 +01:00
Nick Wellnhofer
c1002101f7 Update information about contributing
The contents of the HACKING file were hopelessly outdated. Remove the
file and start with a CONTRIBUTING document.
2017-11-27 13:42:30 +01:00
Nick Wellnhofer
b21895717d Fix -Wenum-compare warnings
Also fixes a serious bug in xmlXPtrNewRangeNodePoint.
2017-11-27 13:42:30 +01:00
Nick Wellnhofer
359e750482 Fix -Wmisleading-indentation warnings 2017-11-27 13:42:30 +01:00
Nick Wellnhofer
8cb8e31773 Don't touch CFLAGS in configure.ac
CFLAGS shouldn't be touched by configure.ac. The variable is supplied by
the user and must come after other flags, so flags like warning options
can be overridden.

Rename CFLAGS to EXTRA_CFLAGS and add the value to AM_CFLAGS. This also
makes it possible to override flags for each Automake program or library.
2017-11-14 16:03:36 +01:00
Nick Wellnhofer
00859f9118 Fix callback signature in testapi.c 2017-11-14 16:03:31 +01:00
Nick Wellnhofer
13acadbb1c Ignore function pointer cast warnings
Use GCC pragmas as these warnings are enabled by -Wpedantic and there's
no way to disable them selectively.
2017-11-14 16:01:48 +01:00
Nick Wellnhofer
8813f397f8 Simplify XPath NaN, inf and -0 handling
Use C99 macros NAN, INFINITY, isnan, isinf. If they're not available:

- Assume that (0.0 / 0.0) generates a NaN and !(x == x) tests for NaN.
- Use C89's HUGE_VAL for INFINITY.

Remove manual handling of NaN, infinity and negative zero in functions
xmlXPathValueFlipSign and xmlXPathDivValues.

Remove xmlXPathGetSign. All the tests for negative zero can be replaced
with a test for negative or positive zero.

Simplify xmlXPathRoundFunction.

Remove Trio dependency.

This should work on IEEE 754 compliant implementations even if the C99
macros aren't available, but will likely break some ancient platforms.
If problems arise, my plan is to port the relevant trionan.c solution
to xpath.c. Note that non-compliant implementations are impossible
to fully support, anyway, since XPath requires IEEE 754.
2017-11-14 15:58:40 +01:00
Nick Wellnhofer
861823902b Revert "Compile testapi with -Wno-unused-function"
This reverts commit f404c4f500.

The change broke non-GCC compilers.
2017-11-14 15:58:01 +01:00
Nick Wellnhofer
772c06487b Fix unused parameter warning without ICU 2017-11-09 17:56:31 +01:00
Nick Wellnhofer
86615e43bb Fix IO callback signatures 2017-11-09 17:47:47 +01:00
Nick Wellnhofer
e5f33e56ba Fix misc callback signatures
Fix parameter and return types for xmlC14NIsVisibleCallback and
xmlRegExecCallbacks.
2017-11-09 17:29:22 +01:00
Nick Wellnhofer
4dd6d7a58e Fix list callback signatures
Make sure that all parameters and return values of list callback
functions exactly match the callback function type. This is required
to pass clang's Control Flow Integrity checks and to allow compilation
to asm.js with Emscripten.

Also change the `user` parameter type from `const void *` to `void *`.
2017-11-09 17:28:00 +01:00
Nick Wellnhofer
e03f0a199a Fix hash callback signatures
Make sure that all parameters and return values of hash callback
functions exactly match the callback function type. This is required
to pass clang's Control Flow Integrity checks and to allow compilation
to asm.js with Emscripten.

Fixes bug 784861.
2017-11-09 16:42:47 +01:00
Nick Wellnhofer
71462a6006 Introduce xmlPosixStrdup and update xmlMemStrdup
Introduce xmlPosixStrdup, an internal strdup implementation matching the
POSIX strdup type signature, and update xmlMemStrdup to use it.

Thanks to Vlad Tsyrklevich for the initial patch.
2017-11-09 15:30:15 +01:00
Vlad Tsyrklevich
28f52fe89d Refactor name and type signature for xmlNop
Update xmlNop's name to xmlInputReadCallbackNop and its type signature
to match xmlInputReadCallback.

Fixes bug 786134.
2017-11-09 13:43:08 +01:00
Nick Wellnhofer
7218255092 Add test for ICU flush and pivot buffer 2017-11-04 15:38:58 +01:00
Joel Hockey
0b19f236a2 Fixed ICU to set flush correctly and provide pivot buffer.
By always setting flush=TRUE when doing multiple reads, ICU
will not correctly handle truncated utf8 chars across read
boundaries.

The fix is to set flush=TRUE only on final read, and to
provide a pivot buffer which is maintained by libxml
between calls to ucnv_convertEx.
2017-11-04 15:25:31 +01:00
Nick Wellnhofer
4b4135977e Skip EBCDIC tests if EBCDIC isn't supported
Fixes bug 603432.
2017-11-04 15:25:30 +01:00
Nick Wellnhofer
f404c4f500 Compile testapi with -Wno-unused-function 2017-11-04 15:03:20 +01:00
Daniel Veillard
bc5a5d6583 Release of libxnl2-2.9.7
* configure.ac doc/news.html : update for release
* doc/news.html doc/xmlcatalog.1 doc/xmlcatalog_man.html: regenerated
2017-11-02 21:26:55 +01:00
Nick Wellnhofer
09f51ecbc5 Add Makefile rules to rebuild HTML man pages
This should make sure that the online version of the man pages for
xmllint and xmlcatalog stay up to date. Also rebuild both HTML
documents.
2017-10-24 14:29:26 +02:00
Jan Pokorný
ca01f8133e xmlcatalog: refresh man page wrt. quering system catalog easily
Also normalize "lookup" spelling.
2017-10-24 13:57:43 +02:00
Jan Pokorný
6b780f65d8 xmlcatalog: restore ability to query system catalog easily
I've noticed that easy way of locating a DocBook XSLT in a configure
script of another project doesn't work anymore.  It is using something
like: xmlcatalog "" ${DOCBOOK_XSL_URI}/${DOCBOOK_XSL_PATH}.  The script
is then forced to a plain, suboptimal search using find utility.
Indeed, I retrospectively realize that the check was working just
by mere accident given that the window this presumably side-effect
was applicable had not lasted long, some 8 months between

  054c716ea1

introducing xmlInitializeCatalog in the LIBXML_TEST_VERSION-rooted
call chain, and

  f65128f382

reverting that again.

So while one can state /etc/xml/catalog constant explicitly, in
some use cases (such as the mentioned one -- that's why I wanted
to omit stating the full path in the first place), this is rather
an implementation detail, perhaps subject to change from that POV.
Therefore I propose to restore that behaviour in the targeted
manner without global disruptions this time around.

As a side-effect, this fixes indenting of the affected part.
2017-10-21 15:26:40 +02:00
Nick Wellnhofer
5e986e3b33 Fix mixed decls and code in timsort.h 2017-10-21 15:09:33 +02:00
Nick Wellnhofer
cfa912dd91 Fix deprecated Travis compiler flag 2017-10-21 15:02:30 +02:00
Nick Wellnhofer
cf820462b7 Rework handling of return values in thread tests
Pass a struct to each thread that contains the filename and the return
value. This avoids casting a DWORD to a pointer on Windows.
2017-10-21 14:52:35 +02:00
J. Peter Mugaas
f05af837bb Add declaration for DllMain
Fixes a compiler warning.
2017-10-21 14:51:35 +02:00
J. Peter Mugaas
882a165a3f Fix preprocessor conditional in threads.h
Make sure that the preprocessor conditions and types for xmlDllMain
match exactly in threads.h and threads.c.
2017-10-21 14:50:44 +02:00
Nick Wellnhofer
154824ee5e Fix unused variable warnings in testrecurse 2017-10-21 14:10:11 +02:00
J. Peter Mugaas
a4864c2f98 Fix pointer comparison warnings on 64-bit Windows 2017-10-21 14:01:10 +02:00
J. Peter Mugaas
8bc6c878e9 Fix macro redefinition warning 2017-10-21 13:57:44 +02:00
J. Peter Mugaas
d2c329a9a4 Fix -Wimplicit-fallthrough warnings
Add "falls through" comments to quench implicit-fallthrough warnings
which are enabled by -Wextra under GCC 7.
2017-10-21 13:49:31 +02:00
Nick Wellnhofer
bec3c17fae Upgrade timsort.h to latest revision
Upgrade timsort.h to revision 05fd77bfec049ce8b7c408c4d3dd2d51ee061a15
from https://github.com/swenson/sort

Removed all code unrelated to Timsort and made minor adjustments for
cross-platform compatibility.
2017-10-12 15:22:21 +02:00
Nick Wellnhofer
25499fc229 Increase warning level to /W3 under MSVC
With the exception of timsort.h and warnings 4244 and 4267, the MSVC
build is now warnings-free with /W3.
2017-10-09 16:52:34 +02:00
Nick Wellnhofer
6472dfe337 Fix a couple of warnings in dict.c and threads.c
Only visible on Windows.
2017-10-09 16:52:15 +02:00
Nick Wellnhofer
8575c1170b Default to native threads on MinGW-w64 2017-10-09 16:52:14 +02:00
Nick Wellnhofer
5672397477 Simplify Windows IO functions
Remove "native" non-Unicode functions which were only needed for
pre-NT systems like Windows 95/98.

Don't redefine `stat` but use `struct _stat` and `_stat()` instead.
2017-10-09 16:52:14 +02:00
Nick Wellnhofer
d1505ef57a Update .gitignore for Windows 2017-10-09 14:35:56 +02:00
Nick Wellnhofer
82e0394d46 Fix runtest on Windows
Unbuffer the output and fix some compiler warnings.
2017-10-09 14:35:56 +02:00
Nick Wellnhofer
ecbdfa9eb3 Fix unused variable warnings in nanohttp.c
Some variables are only used if certain macros are set. Move the
declarations around.
2017-10-09 14:35:55 +02:00
Nick Wellnhofer
e3890546d7 Fix the Windows header mess
Don't include windows.h and wsockcompat.h from config.h but only when
needed.

Don't define _WINSOCKAPI_ manually. This was apparently done to stop
windows.h from including winsock.h which is a problem if winsock2.h
wasn't included first. But on MinGW, this causes compiler warnings.
Define WIN32_LEAN_AND_MEAN instead which has the same effect.

Always use the compiler-defined _WIN32 macro instead of WIN32.
2017-10-09 14:35:40 +02:00
Nick Wellnhofer
bee8f1e47b Don't include winsock2.h in xmllint.c
I'm not sure why xmllint.c did include winsock2.h at all. Stop
including the header as both MinGW and MSVC builds don't seem to
require it.
2017-10-09 13:59:44 +02:00
Nick Wellnhofer
45b0ebdc8d socklen_t is always int on Windows
Define XML_SOCKLEN_T as `int` unconditionally in wsockcompat.h. Fixes
compiler warnings and removes some duplicated code.
2017-10-09 13:57:42 +02:00