]> git.ipfire.org Git - thirdparty/libarchive.git/commit
Fixes for GCC 4.7.0
authorDan McGee <dan@archlinux.org>
Tue, 27 Mar 2012 22:22:40 +0000 (17:22 -0500)
committerTim Kientzle <kientzle@acm.org>
Tue, 3 Apr 2012 15:32:43 +0000 (08:32 -0700)
commitda8ac32da9e5ee4a27674de4442e24c26cb2aa6a
tree5edfa02ad0bfde7d4b579ede0f1e614394304e7d
parentff7c1a4053f67ce8574833cfb977d6ef297162da
Fixes for GCC 4.7.0

Fixes the following compile error exposed with GCC 4.7.0:

    libarchive/archive_string.c: In function 'cesu8_to_unicode':
    libarchive/archive_string.c:2450:11: error: 'wc' may be used uninitialized in this function [-Werror=uninitialized]
    cc1: all warnings being treated as errors

As well as a test failure that depends on signed integer wraparound,
which is a very bad thing to do in C [1]. Mark the intermediate result
as volatile to prevent the compiler optimizing away the arithmetic and
the logical test.

[1] http://www.gnu.org/software/autoconf/manual/autoconf-2.67/html_node/Signed-Overflow-Examples.html
libarchive/archive_string.c
libarchive/test/test_read_format_mtree.c