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]
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;
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;
}