aboutsummaryrefslogtreecommitdiff
path: root/libbacktrace/ztest.c
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2020-02-03 16:44:33 -0800
committerIan Lance Taylor <iant@golang.org>2020-02-03 18:13:28 -0800
commit628ee3c2f339da37e7570bcce0ebc6eb12bc33ae (patch)
tree366c184656a557546b4f4bd3231abaf8f1f41982 /libbacktrace/ztest.c
parent8b117ad0c394ec13c7d3c98a29b475a0379c5297 (diff)
downloadgcc-628ee3c2f339da37e7570bcce0ebc6eb12bc33ae.zip
gcc-628ee3c2f339da37e7570bcce0ebc6eb12bc33ae.tar.gz
gcc-628ee3c2f339da37e7570bcce0ebc6eb12bc33ae.tar.bz2
libbacktrace: always pass -g when compiling test code
This approach required adding a few casts to ztest.c, as it is now compiled with -Wall. Fixes PR libbacktrace/90636
Diffstat (limited to 'libbacktrace/ztest.c')
-rw-r--r--libbacktrace/ztest.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/libbacktrace/ztest.c b/libbacktrace/ztest.c
index de7e7f0..40f9c38 100644
--- a/libbacktrace/ztest.c
+++ b/libbacktrace/ztest.c
@@ -89,7 +89,8 @@ struct zlib_test
/* Error callback. */
static void
-error_callback_compress (void *vdata, const char *msg, int errnum)
+error_callback_compress (void *vdata ATTRIBUTE_UNUSED, const char *msg,
+ int errnum)
{
fprintf (stderr, "%s", msg);
if (errnum > 0)
@@ -360,7 +361,7 @@ test_large (struct backtrace_state *state)
fclose (e);
if (got > 0)
{
- orig_buf = rbuf;
+ orig_buf = (unsigned char *) rbuf;
orig_bufsize = got;
break;
}
@@ -383,7 +384,7 @@ test_large (struct backtrace_state *state)
}
compress_sizearg = compressed_bufsize - 12;
- r = compress (compressed_buf + 12, &compress_sizearg,
+ r = compress ((unsigned char *) compressed_buf + 12, &compress_sizearg,
orig_buf, orig_bufsize);
if (r != Z_OK)
{
@@ -406,7 +407,8 @@ test_large (struct backtrace_state *state)
}
uncompressed_bufsize = orig_bufsize;
- if (!backtrace_uncompress_zdebug (state, compressed_buf, compressed_bufsize,
+ if (!backtrace_uncompress_zdebug (state, (unsigned char *) compressed_buf,
+ compressed_bufsize,
error_callback_compress, NULL,
&uncompressed_buf, &uncompressed_bufsize))
{
@@ -443,7 +445,8 @@ test_large (struct backtrace_state *state)
return;
}
- if (!backtrace_uncompress_zdebug (state, compressed_buf,
+ if (!backtrace_uncompress_zdebug (state,
+ (unsigned char *) compressed_buf,
compressed_bufsize,
error_callback_compress, NULL,
&uncompressed_buf,
@@ -472,8 +475,9 @@ test_large (struct backtrace_state *state)
}
uncompress_sizearg = uncompressed_bufsize;
- r = uncompress (uncompressed_buf, &uncompress_sizearg,
- compressed_buf + 12, compressed_bufsize - 12);
+ r = uncompress ((unsigned char *) uncompressed_buf, &uncompress_sizearg,
+ (unsigned char *) compressed_buf + 12,
+ compressed_bufsize - 12);
if (clock_gettime (cid, &ts2) < 0)
{