If the environment variable TMPDIR is not set, make uses a default path
that includes a trailing '/'.
For extra correctness it always appended an extra '/', leading to paths
of the form '/tmp//makeXXXXXX'. This looked suspicious, as if there had
been a forgotten empty part between the two '/'. Avoid this ambiguity
by replacing '//' with '/'.
It's strange that GCC does not warn about the nonliteral format strings
in lint1/err.c, lint2/msg.c and lint2/read.c, despite -Wformat=2, but
Clang does.
The code generated by yacc already adheres to strict bool mode, in
default mode as well as in debug mode.
Running lint on the generated cgram.c as well avoids most of the
"declared but not used" warnings from lint2.
The code generated by lex does not adhere to strict bool mode though.
Suppressing the errors from strict bool mode works, but then lint1 runs
into an assertion failure:
assertion "tn != NULL || nerr != 0" failed
in expr at tree.c:3610 near scan.c:822
This leaves several warnings about "declared but not used" for the
functions from lex.c.
Even though the new test is quite large, it didn't find any bugs in the
code. The only thing I'm unsure about is why static functions are
exported as well, since they are supposed to be local to the translation
unit.
from what pmax GENERIC enables, but not nearly all of it:
- enable OVERLAY, UMAPFS, FDESC, LFS, UNION, PUFFS (and putter),
and add some more commented out entries
- enable DISKLABEL_EI and FFS_EI
- turn on GATEWAY and ppp(4) options
- add commented ALTQ section
into the section of code known as softint_fast_dispatch().
previous:
db> x/i softint_cleanup
netbsd:cpu_switchto+0xd4: ld t0,0(t8)
except that cpu_switchto() ends at cpu_switchto+0xd0.
now:
db> x/i softint_cleanup
netbsd:softint_fast_dispatch+0xa4: ld t0,0(t8)
tested on OCTEON.
At the end of a function definition (funcend), curr_pos was not
restored, probably because the very next action is to read the next
token, which will then set curr_pos.
Again, this may affect the location reported in assertion failures,
everything else is unchanged.
This one is already a little trickier since it does not restore the
original curr_pos. This function is only called in a few places, and
these either restore curr_pos themselves or only call functions
afterwards that immediately overwrite curr_pos.
Except for lint_assert, which may now report a different location.
The call to check_global_variable that is related to check_tag_usage was
the function that started this whole refactoring since its lint_assert
reported a completely wrong location when using a compound literal in an
initializer expression at block level 0.
Right now there are several places in the code that use the global
variable curr_pos for passing a parameter to the diagnostic functions.
That's not what global variables are for.
Make it easy for the code to migrate to the parameter-passing style.
No functional change.
A compound literal that occurs at block_level 0 does not have storage
class AUTO. Instead, its storage class is either EXTERN or STATIC.
While removing the temporary objects from the symbol table had prevented
the assertion, it did not properly fix the underlying problem, which was
that since C99 the initializers can contain references to unnamed
objects that are created on-the-fly. For C90 it was correct to always
use AUTO as the storage class of a temporary symbol.
log() takes a 'int level' first argument, that must be supplied.
add an inline wrapper that calls vlog() with LOG_INFO, and the
supplied va_list.
(not noticed because this macro is not used anywhere in src but
i have a use in some uncommited code, that now failed to compile.)