structures:
- alpha_shared_intr_alloc() no longer takes a "string length" argument,
and just uses kmem_asprintf() to create an "irq %u" string by default.
This is suitable for nearly every caller.
- Add a alpha_shared_intr_set_string() that allows callers to override
the default IRQ description string.
- Related: make alpha_shared_intr_string() return a const char *, since
no callers should need to modify the string directly now.
- Re-factor PCI shared interrupt structure allocation / initialization
into a new alpha_pci_intr_alloc(), which is suitable for nearly every
Alpha PCI platform. Callers are expected to first have initialized
the interrupt hardware to the quiescent state.
Adjust various call sites of above functions to account for changes,
even if they are not able to use the newly re-factored code.
In namespace.h 1.102 from 2005-07-16, the #ifndef was added to fix the
broken lint2 pass. Somewhere between 2005 and now, lint has been
changed so that it does not need this workaround anymore.
After usr.bin/xlint/lint1/tree.c 1.303 from 2021-06-30, the #ifndef in
namespace.h caused the only warning about an implicit function
declaration in the whole NetBSD tree, in lib/libc/gen/sysconf.c:149,
where _getpagesize was not defined, but only getpagesize.
I originally intended to type ASCII DEL as an example of a nonprintable
character code. The actual character that landed in the code was
instead U+2303 "house", which looks similar to the typical
representation of the DEL character. The UTF-8 byte sequence for that
code point started with \xE2, or in octal \342.
This theoretically enables strict bool mode for the few remaining code
in scan.l. Since scan.l is not yet detected as generated code, all
interesting errors have to be suppressed though.
Since err.c 1.12 from 2000-07-06, lint allows to suppress individual
error messages. Suppressed error messages do not increment nerr.
Keeping nerr at 0 had triggered the assertion.
If a controlling expression is not of type bool but of any other scalar
type, keep the expression. Its value is still useful for control flow
analysis.
This prevents an assertion failure when running lint on the generated
scan.c, which contains a "while (1)" that does not stem from a system
header. If it did, lint would accept it, see tn_from_system_header. But
"scan.c" is not considered a system header. Maybe lint's definition of
a system header needs to be revisited.
After fixing this, there is another assertion failure though, so scan.c
is not yet ready to be inspected by lint.
Previously, the test dependend on implementation details of the system's
printf command.
Thank you sjg for the detailed analysis on macOS, FreeBSD and Linux.
On macppc, char == unsigned, which generated the following unintended
warnings:
d_cast_init.c(18): warning: initialization of unsigned with negative
constant [221]
d_cast_init.c(18): warning: initialization of unsigned with negative
constant [221]
d_cast_init.c(18): warning: initialization of unsigned with negative
constant [221]
d_cast_init.c(18): warning: initialization of unsigned with negative
constant [221]
This is a tiny change in an edge case that does not occur in practice,
which is that the left-hand side of the '&' is explicitly cast to an
enum type. The apparent "loss of information" from the deleted comment
has already been explained in the previous commit.