summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Pipping <sebastian@pipping.org>2017-08-03 21:35:24 +0200
committerSebastian Pipping <sebastian@pipping.org>2017-08-03 21:35:31 +0200
commitd98d4399174fd6f71d70e7bd89993a0e7346753d (patch)
treedbe10593569d47c4b9e4e908c747857a2be634ed
parent97c6bd01990090d4015364ae37dd141f3c39a30f (diff)
parent791d1b3f0a82f8fd4dc4a925267ffdde7a7b1c6b (diff)
downloadlibexpat-git-d98d4399174fd6f71d70e7bd89993a0e7346753d.tar.gz
Merge branch 'unsigned-char' (pull request #109)
-rw-r--r--expat/Changes10
-rwxr-xr-xexpat/coverage.sh11
-rw-r--r--expat/tests/minicheck.c7
-rw-r--r--expat/tests/runtests.c2
4 files changed, 26 insertions, 4 deletions
diff --git a/expat/Changes b/expat/Changes
index 147f4828..ab27ea0c 100644
--- a/expat/Changes
+++ b/expat/Changes
@@ -2,6 +2,16 @@ NOTE: We are looking for help with a few things:
https://github.com/libexpat/libexpat/labels/help%20wanted
If you can help, please get in touch. Thanks!
+Release 2.?.? ?????????????????
+ Other changes:
+ #109 Fix "make check" for non-x86 architectures that default
+ to unsigned type char (-128..127 rather than 0..255)
+ #109 coverage.sh: Cover -funsigned-char
+ Improve test suite error output
+
+ Special thanks to:
+ Joe Orton
+
Release 2.2.3 Wed August 2 2017
Security fixes:
#82 CVE-2017-11742 -- Windows: Fix DLL hijacking vulnerability
diff --git a/expat/coverage.sh b/expat/coverage.sh
index 0600847a..8f2e4d6e 100755
--- a/expat/coverage.sh
+++ b/expat/coverage.sh
@@ -21,7 +21,12 @@ _get_build_dir() {
mingw_part=__windows
fi
- echo "build__${version}__unicode_${unicode_enabled}__xml_context_${xml_context}${libbsd_part}${mingw_part}"
+ local char_part=
+ if ${with_unsigned_char}; then
+ char_part=__unsigned_char
+ fi
+
+ echo "build__${version}__unicode_${unicode_enabled}__xml_context_${xml_context}${libbsd_part}${mingw_part}${char_part}"
}
@@ -95,6 +100,8 @@ _run() {
local BASE_FLAGS='-pipe -Wall -Wextra -pedantic -Wno-overlength-strings'
BASE_FLAGS+=' --coverage --no-inline'
+ ${with_unsigned_char} && BASE_FLAGS="${BASE_FLAGS} -funsigned-char"
+
local CFLAGS="-std=c99 ${BASE_FLAGS}"
local CXXFLAGS="-std=c++98 ${BASE_FLAGS}"
@@ -193,6 +200,7 @@ _main() {
}
# All combinations:
+ with_unsigned_char=false
with_libbsd=false
for with_mingw in true false ; do
for unicode_enabled in false ; do
@@ -204,6 +212,7 @@ _main() {
# Single cases:
with_libbsd=true _build_case
+ with_unsigned_char=true _build_case
echo
echo 'Merging coverage files...'
diff --git a/expat/tests/minicheck.c b/expat/tests/minicheck.c
index a6cae231..e6266ca4 100644
--- a/expat/tests/minicheck.c
+++ b/expat/tests/minicheck.c
@@ -9,6 +9,7 @@
#include <stdlib.h>
#include <setjmp.h>
#include <assert.h>
+#include <string.h>
#include "internal.h" /* for UNUSED_P only */
#include "minicheck.h"
@@ -186,8 +187,10 @@ _fail_unless(int UNUSED_P(condition), const char *UNUSED_P(file), int UNUSED_P(l
we have a failure, so there's no reason to be quiet about what
it is.
*/
- if (msg != NULL)
- printf("%s", msg);
+ if (msg != NULL) {
+ const int has_newline = (msg[strlen(msg) - 1] == '\n');
+ fprintf(stderr, "ERROR: %s%s", msg, has_newline ? "" : "\n");
+ }
longjmp(env, 1);
}
diff --git a/expat/tests/runtests.c b/expat/tests/runtests.c
index aa95fd37..237de6e2 100644
--- a/expat/tests/runtests.c
+++ b/expat/tests/runtests.c
@@ -5671,7 +5671,7 @@ static int XMLCALL
prefix_converter(void *UNUSED_P(data), const char *s)
{
/* If the first byte is 0xff, raise an error */
- if (s[0] == -1)
+ if (s[0] == (char)-1)
return -1;
/* Just add the low bits of the first byte to the second */
return (s[1] + (s[0] & 0x7f)) & 0x01ff;