When indent runs in filter mode, it may output messages to stderr.
Allow tests with non-empty expected stderr.
In the ATF output, the filename 'output_file.parsed' was not helpful for
casual readers of diff output since they expect the filenames to be
meaningful. Embed the name of the test case in that filename.
Fix quoting of the shell variables.
Remove the repetition of the regular expression to clean up the test
files.
No functional change since neither rw_jump nor rw_inline_or_restrict is
mentioned in any switch statement, and lint didn't find any other
suspicious enum operations.
This reduces the magic numbers in the code. Most of these had their
designated constant name written in a nearby comment anyway.
The one instance where arithmetic was performed on this new enum type
(in indent.c) was a bit tricky to understand.
The combination rw_continue_or_inline_or_restrict looks strange, the
'continue' should intuitively belong to the other control flow keywords
in rw_break_or_goto_or_return.
No functional change.
It's a funny idea to do something like 'case a = 13:', but since any
compiler will reject this code, there is no point in lint supporting it.
No functional change since everywhere the grammar allows a constant
expression, there is no ambiguity where an assignment could be
interpreted differently.
C99 6.4.4 already defines a grammar rule named 'constant' for an number
literal or an enum constant, so don't use that name for something else.
No functional change.
According to the GCC documentation[1], the high end of the range is
inclusive as well, which makes sense since otherwise there would be no
way of specifying a range that includes the maximum representable
number.
Since the range is not used at all in the code, none of the tests could
possibly fail.
[1] https://gcc.gnu.org/onlinedocs/gcc/Case-Ranges.html
No functional change.
There was no point in having a separate grammar rule for the '3...' part
of a range expression, it just made the code more complicated than
necessary.
No functional change.
before: array of unsigned int[4]
now: array[4] of unsigned int
Listing the array dimension first keeps it in contact with the keyword
'array'. This reduces confusion, especially for nested arrays.
netinet6: Pick IPv6 fragment ids uniformly at random.
Expected number of packets before collision is ~2^16, about the same
as we get for IPv4 with alternating disjoint random cycles. Keep it
simple unless we determine we really need something much better for
IPv6 than what IPv4 can achieve anyway.
netinet6: Rip out now-unused IPv6 fragment id logic.
(from riastradh)