The example code for triggering these grammar rules looks completely
contrived. Even if lint had not implemented these cases, hopefully
nobody would have ever noticed.
the string it points to, it is never passed to a function not taking a
const char * arg, and this allows "" (or other literal strings if ever
needed) to be assigned to it - which should fix the build.
Special thanks to Anders Gustafsson, the author of "HPDisk"
(GPIB disk emulator) http://www.dalton.ax/hpdisk/
for providing bare boards and improving firmwares for NetBSD/hp300.
interface, we don't have sufficient information to find the device using
the bus/slot scheme that we do with a PCI network interface. However, in
these cases, some versions of the SRM console supply the MAC address of
the interface in the booted_dev environment variable, like so:
BOOTP 1 1 0 0 0 5 0 08-00-2B-xx-xx-xx 1
So, if we weren't able to find the booted device by the usual means,
check for this and, if we find a MAC address, try to find the network
interface by the MAC address.
When compiling the grammar with Bison, it complains:
error: $$ for the midrule at $2 of 'struct' has no declared type
Yacc does not complain, instead it assumes that a midrule has the same
type as the rule itself.
The assignment '$$ = $1' in the midrule action does not influence the $$
of the whole rule, it only assigns to $2. The assignment to $$ was done
via the default action, therefore everything worked as expected. Any
missing assignment in this rule would have been caught quickly by the
strict assertion in mktag.
No functional change.
Since cgram.y 1.270 from today (a "cleanup" commit), the enum constants
were only registered in the symbol table, but they were not added to the
enum type (en_first_enumerator). That information is used for
validating switch statements on enum types.
The actual bug is an off-by-one error in the grammar, in the grammar
rule 'enum_declaration'. Yacc does not notice this obvious error.
Bison does, but it is not involved in building lint.
In the grammar rule 'enum_declaration', the intended $3 contains the
first enumeration constant of the type, while $2, which yacc interprets
as a symbol, contains a null pointer, at least on x86_64.
The existing tests did not cover this scenario, so the bug went
unnoticed.
case count on the tp-start line of the output match the number of test
cases actually executed (one) so that the atf-run output is valid
input to atf-report.
not return 0, the synthetic writes from funopen/fmemopen could. This avoids
infinite loops in >= test19 in fmemopen, but the tests still fail, perhaps
because they assume the previous behavior, where flush does not adjust the
stdio pointers on error.
Since type attributes (and GCC attributes as well) often modify the
preceding identifier, without referring to $$, the easiest way to
integrate them into the grammar is to define a separate grammar rule
that can be placed wherever these attributes are allowed. This avoids
duplicate actions like in direct_param_decl.
No functional change.
enum_decl_lbrace was only used once and was small enough to be inlined.
Renamed expr_statement and added block_item_list_opt to match the
wording from C99.
Added references to C99.
No functional change.
ixgbe_rxeof() has an optimization "RX_COPY" to reduce costs of
bus_dmamap_load_mbuf() and bus_dmamap_unload() by copying a mbuf cluster's
memory to a newly allocated mbuf's MH_databuf[] and recycle the original map.
The optimization is used when a length of a packet is smaller than a specific
value. The value is calculated based on MHLEN. The size of MHLEN is
architecture specific. It's 256 or 512. Make the threshold controllable by
adding a new sysctl.
ixgbe_setup_receive_ring() fully allocates rx buffers. When a
descriptor ring is full, rxr->next_to_refresh should point to
rxr_next_to_check -1. Before this change, rxr->next_to_refresh
is set to 0 and ixgbe_refresh_mbufs() wastefully loops in
ixgbe_refresh_mbufs() because it means the ring is empty.
branches (which will be predicted as not-taken), and that the likely cases
are fall-through, with the exception of the loop branch (which is a backward
branch, and thus will be predicted as taken).
These cannot be resolved as easily as those from the previous commit.
Anyway, the relevant code from the grammar is not yet covered by the
tests, this needs to be done first.
There is no need for extra rules for '__real__(term)' since that is
already handled by the simpler '__real__ term', just a few lines further
up in the grammar. Likewise for __imag__.
The GCC manual does not mention anything about parentheses either.