From: Rolf Eike Beer Date: Wed, 21 Nov 2018 19:22:31 +0000 (+0100) Subject: tests: fix compile error with -Wshadow on older gcc releases X-Git-Tag: v3.4.0~157^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1087%2Fhead;p=thirdparty%2Flibarchive.git tests: fix compile error with -Wshadow on older gcc releases Older gcc releases also warn when a local variable has the name of a global function, like this output from gcc 4.6: test_read_format_rar5.c:93:23: error: declaration of 'read' shadows a global declaration [-Werror=shadow] --- diff --git a/libarchive/test/test_read_format_rar5.c b/libarchive/test/test_read_format_rar5.c index 6c570f1c6..0ccedc76f 100644 --- a/libarchive/test/test_read_format_rar5.c +++ b/libarchive/test/test_read_format_rar5.c @@ -90,7 +90,7 @@ int verify_data(const uint8_t* data_ptr, int magic, int size) { static int extract_one(struct archive* a, struct archive_entry* ae, uint32_t crc) { - la_ssize_t fsize, read; + la_ssize_t fsize, bytes_read; uint8_t* buf; int ret = 1; uint32_t computed_crc; @@ -100,9 +100,9 @@ int extract_one(struct archive* a, struct archive_entry* ae, uint32_t crc) { if(buf == NULL) return 1; - read = archive_read_data(a, buf, fsize); - if(read != fsize) { - assertEqualInt(read, fsize); + bytes_read = archive_read_data(a, buf, fsize); + if(bytes_read != fsize) { + assertEqualInt(bytes_read, fsize); goto fn_exit; }