compiling elf toolchain under gcc-5.3 mips

Adrian Chadd adrian at freebsd.org
Sun Aug 14 17:01:58 UTC 2016


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)
@@ -251,6 +251,7 @@
        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


More information about the freebsd-mips mailing list