From 97fcc0ce31300825e8d5cf214d8302ffa2f891e9 Mon Sep 17 00:00:00 2001 From: kientzle Date: Mon, 8 Sep 2008 00:58:12 +0000 Subject: Fix a type-aliasing problem in the libarchive test suite, restore WARNS=6. --- lib/libarchive/test/Makefile | 2 +- lib/libarchive/test/test_read_format_gtar_sparse.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/libarchive/test/Makefile b/lib/libarchive/test/Makefile index cbfb6dd..42869e8 100644 --- a/lib/libarchive/test/Makefile +++ b/lib/libarchive/test/Makefile @@ -89,7 +89,7 @@ CFLAGS+= -I${LA_SRCDIR} -I. # Uncomment to link against dmalloc #LDADD+= -L/usr/local/lib -ldmalloc #CFLAGS+= -I/usr/local/include -DUSE_DMALLOC -#WARNS=6 +WARNS=6 # Build libarchive_test and run it. check test: libarchive_test diff --git a/lib/libarchive/test/test_read_format_gtar_sparse.c b/lib/libarchive/test/test_read_format_gtar_sparse.c index 4506a3a..2c4a7e3 100644 --- a/lib/libarchive/test/test_read_format_gtar_sparse.c +++ b/lib/libarchive/test/test_read_format_gtar_sparse.c @@ -187,6 +187,7 @@ verify_archive_file(const char *name, struct archive_contents *ac) struct contents expect; /* data, size, offset of block read from archive. */ struct contents actual; + const void *p; struct archive *a; extract_reference_file(name); @@ -206,10 +207,10 @@ verify_archive_file(const char *name, struct archive_contents *ac) expect = *cts++; while (0 == (err = archive_read_data_block(a, - (const void **)&actual.d, - &actual.s, &actual.o))) { + &p, &actual.s, &actual.o))) { + actual.d = p; while (actual.s > 0) { - char c = *(const char *)actual.d; + char c = *actual.d; if(actual.o < expect.o) { /* * Any byte before the expected -- cgit v1.1