diff options
author | David Boddie <david@boddie.org.uk> | 2017-07-14 00:59:19 +0200 |
---|---|---|
committer | David Boddie <david@boddie.org.uk> | 2017-07-14 00:59:19 +0200 |
commit | e3bca5d865c831d3a6426b05bffd8c8d31e69886 (patch) | |
tree | 29f93d2c2d71c6bf6fff5ccc3ab2f0c89c5567fb | |
parent | 8823998c509302a526d8711095f664dd06997234 (diff) |
Fixed warnings from recent versions of GCC.
Fixed incorrect buffering due to a change in the way the buf.dbuf array is
compiled in at least GCC 4.9.2, GCC 5.4.0 and GCC 6.3.0.
-rw-r--r-- | utils/8l/asm.c | 20 | ||||
-rw-r--r-- | utils/8l/l.h | 2 |
2 files changed, 11 insertions, 11 deletions
diff --git a/utils/8l/asm.c b/utils/8l/asm.c index 6d09ae7c..de75499f 100644 --- a/utils/8l/asm.c +++ b/utils/8l/asm.c @@ -408,11 +408,11 @@ datblk(long s, long n) if(debug['a'] && i == 0) { Bprint(&bso, pcstr, l+s+INITDAT); for(j=0; j<c; j++) - Bprint(&bso, "%.2ux", cast[fnuxi4[j]] & 0xff); + Bprint(&bso, "%.2ux", cast[(int)fnuxi4[j]] & 0xff); Bprint(&bso, "\t%P\n", curp); } for(; i<c; i++) { - buf.dbuf[l] = cast[fnuxi4[i]]; + buf.dbuf[l] = cast[(int)fnuxi4[i]]; l++; } break; @@ -421,11 +421,11 @@ datblk(long s, long n) if(debug['a'] && i == 0) { Bprint(&bso, pcstr, l+s+INITDAT); for(j=0; j<c; j++) - Bprint(&bso, "%.2ux", cast[fnuxi8[j]] & 0xff); + Bprint(&bso, "%.2ux", cast[(int)fnuxi8[j]] & 0xff); Bprint(&bso, "\t%P\n", curp); } for(; i<c; i++) { - buf.dbuf[l] = cast[fnuxi8[i]]; + buf.dbuf[l] = cast[(int)fnuxi8[i]]; l++; } break; @@ -468,11 +468,11 @@ datblk(long s, long n) if(debug['a'] && i == 0) { Bprint(&bso, pcstr, l+s+INITDAT); for(j=0; j<c; j++) - Bprint(&bso, "%.2ux", cast[inuxi1[j]] & 0xff); + Bprint(&bso, "%.2ux", cast[(int)inuxi1[j]] & 0xff); Bprint(&bso, "\t%P\n", curp); } for(; i<c; i++) { - buf.dbuf[l] = cast[inuxi1[i]]; + buf.dbuf[l] = cast[(int)inuxi1[i]]; l++; } break; @@ -480,11 +480,11 @@ datblk(long s, long n) if(debug['a'] && i == 0) { Bprint(&bso, pcstr, l+s+INITDAT); for(j=0; j<c; j++) - Bprint(&bso, "%.2ux", cast[inuxi2[j]] & 0xff); + Bprint(&bso, "%.2ux", cast[(int)inuxi2[j]] & 0xff); Bprint(&bso, "\t%P\n", curp); } for(; i<c; i++) { - buf.dbuf[l] = cast[inuxi2[i]]; + buf.dbuf[l] = cast[(int)inuxi2[i]]; l++; } break; @@ -492,11 +492,11 @@ datblk(long s, long n) if(debug['a'] && i == 0) { Bprint(&bso, pcstr, l+s+INITDAT); for(j=0; j<c; j++) - Bprint(&bso, "%.2ux", cast[inuxi4[j]] & 0xff); + Bprint(&bso, "%.2ux", cast[(int)inuxi4[j]] & 0xff); Bprint(&bso, "\t%P\n", curp); } for(; i<c; i++) { - buf.dbuf[l] = cast[inuxi4[i]]; + buf.dbuf[l] = cast[(int)inuxi4[i]]; l++; } break; diff --git a/utils/8l/l.h b/utils/8l/l.h index da151014..ca3059e9 100644 --- a/utils/8l/l.h +++ b/utils/8l/l.h @@ -195,7 +195,7 @@ EXTERN union uchar obuf[MAXIO]; /* output buffer */ uchar ibuf[MAXIO]; /* input buffer */ } u; - char dbuf[1]; + char dbuf[MAXIO]; } buf; #define cbuf u.obuf |