diff options
| -rw-r--r-- | fw/src/fw.c | 3 | ||||
| -rwxr-xr-x | fw/test/fwtest.rc | 22 |
2 files changed, 23 insertions, 2 deletions
diff --git a/fw/src/fw.c b/fw/src/fw.c index 23971cd..b7beb9a 100644 --- a/fw/src/fw.c +++ b/fw/src/fw.c @@ -729,7 +729,7 @@ fsdestroyfid(Fid *fid) static void fsread(Req *r) { - char buf[256], *s; + char *s; long n; switch((int)(uintptr)r->fid->file->aux){ @@ -1283,7 +1283,6 @@ threadmain(int argc, char **argv) ethergw != nil ? ", gateway " : "", ethergw != nil ? ethergw : ""); } - m = nil; if((m = strchr(etheraddr, '/')) != nil){ k = m - etheraddr; if(k >= sizeof abuf) diff --git a/fw/test/fwtest.rc b/fw/test/fwtest.rc index a7ba4d2..ffbc6b6 100755 --- a/fw/test/fwtest.rc +++ b/fw/test/fwtest.rc @@ -25,6 +25,11 @@ if(! test -x $fw){ exit nofw } +# where the source is, for the build check; skipped if it is not here +src=$2 +if(~ $#src 0) + src=/sys/src/cmd/fw + tmp=/tmp/fwtest.$pid mkdir -p $tmp nA=$tmp/nA @@ -139,6 +144,23 @@ fn nfw { } fwbefore=`{nfw} +echo '== it builds without complaint' +# A warning is a finding nobody had to look for. Two stood in fw.c for +# as long as the program has existed, which is how long it has been +# since anyone read the output of mk. +if(test -d $src){ + if(@{ cd $src && mk clean && mk all } >$tmp/build >[2=1]) + r=ok + if not + r=failed + check 'the source still builds' ok $"r + grep warning $tmp/build > $tmp/why + r=`{grep -c warning $tmp/build} + check 'and the compiler has nothing to say about it' 0 $"r +} +if not + echo ' skip no '^$src^', not checking the build' + echo '== rules: parsing' cat > $tmp/bad.ndb <<'!' |
