compiling elf toolchain under gcc-5.3 mips

From: Adrian Chadd <adrian_at_freebsd.org>
Date: Sun, 14 Aug 2016 10:01:56 -0700
hiya,

This seems to be needed for compiling elftoolchain under gcc-5.3
targeting mips (CROSS_TOOLCHAIN=mips-gcc) otherwise it complains that
sz isn't always initialised:

adrian_at_gertrude:~/work/freebsd/head-embedded/src % svn diff contrib
Index: contrib/elftoolchain/elfcopy/ascii.c
===================================================================
--- contrib/elftoolchain/elfcopy/ascii.c        (revision 303837)
+++ contrib/elftoolchain/elfcopy/ascii.c        (working copy)
_at__at_ -251,6 +251,7 _at__at_
        sec_index = 1;
        sec_addr = entry = 0;
        while (fgets(line, _LINE_BUFSZ, ifp) != NULL) {
+               sz = 0;         /* Quieten GCC-5.3 */
                if (line[0] == '\r' || line[0] == '\n')
                        continue;
                if (line[0] == '$' && line[1] == '$') {


Is that acceptable?



-adrian
Received on Sun Aug 14 2016 - 15:01:58 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:07 UTC