Commit Graph

289179 Commits

Author SHA1 Message Date
rillig 2116d9a5d9 lint: fix parse error in conditional expression (since 2021-07-15) 2021-07-26 18:10:14 +00:00
rillig 3120116ed3 tests/lint: show bug in conditional expression (since 2021-07-15)
Since cgram.y 1.325 from 2021-07-15, conditional expressions did not
accept a comma-expression in the then-branch anymore.  In practice, this
is an edge case though since comma expressions are rare.
2021-07-26 18:06:43 +00:00
rillig 51b2be3c67 lint: fix parsing of chained assignments (since 2021-07-15)
The grammar rule for assignment_expression is quite different from those
of the other expressions, for 2 reasons: first, its precedence is
right-to-left.  Second, its left-hand side must be an lvalue, which
rules out all binary operators.  K&R C even had a grammar rule named
'lvalue' for this purpose.  Later C standards made the kinds of
expressions more fine-grained and used 'unary_expression' in this place.
2021-07-26 17:27:22 +00:00
rillig d382492611 lint: remove redundant associativity declarations
Since cgram.y 1.325 from 2021-07-15, these are not needed anymore.
Strangely, neither yacc nor Bison warned about this redundancy.

No functional change, the grammar rules are the same as before.
2021-07-26 17:15:24 +00:00
rillig 036149f3ba tests/lint: demonstrate bug in chained assignment (since 2021-07-15)
Since cgram.y 1.325 from 2021-07-15, lint has been parsing assignment
expressions correctly.  It got the associativity wrong.
2021-07-26 17:09:46 +00:00
thorpej e145d99d7c - Type hygiene.
- Rename ahb_ecb::hashkey to ahb_ecb::ecb_dma_addr, and use that value
  rather than recomputing it all the time.
2021-07-26 16:45:56 +00:00
rillig b9b3a7d957 lint: make typeok_scalar_strict_bool simpler
No functional change.
2021-07-26 16:22:24 +00:00
rin 76020b2c7d Improve previous:
- Add suffix ``d'' for mkdep(1).
- Improve comment a little...
2021-07-26 12:49:13 +00:00
rillig 52d0684901 lint: split is_ctype_function into separate parts
This reduces the number of string comparisons for function names that
start with 'is' or 'to'.

The tests now cover function names that start with 'is' or 'to' but are
not one of the well-known functions from ctype.h.  This removes the '*'
in the output from gcov.

No functional change.
2021-07-25 22:43:08 +00:00
rillig 7ed694cb89 tests/lint: cover code in ckctype.c 2021-07-25 22:31:22 +00:00
rillig 45912390fd lint: move scl_name from print.c to decl.c
It is only needed there.
2021-07-25 22:14:36 +00:00
rillig a3535e9c45 tests/lint: cover every code line in the grammar 2021-07-25 22:03:42 +00:00
rillig 3708cf68a2 lint: revert previous commit; it didn't improve readability
No functional change.
2021-07-25 21:31:01 +00:00
rillig f28112cf7c lint: merge duplicate code for abstract_declaration
No functional change; same code coverage outside of cgram.y.
2021-07-25 19:57:22 +00:00
rillig 111da90bc0 tests/lint: explain where the second __attribute__ comes from 2021-07-25 19:41:33 +00:00
rillig 1f9033885a lint: resolve conflicts in begin_type_specifier_qualifier_list
The 9 shift/reduce conflicts were all internal to the grammar rule
begin_type_specifier_qualifier_list.  Previously, there were two
possible ways to parse '__attribute__(()) const int':

1. '__attribute__(())' 'const int'
2. '__attribute__(()) const' 'int'

Both ways would produce the same result since __attribute__ has almost
no observable effects on the resulting type.

No functional change.
2021-07-25 19:27:26 +00:00
rillig f9d007a49c tests/lint: fix unintended line breaks 2021-07-25 19:22:08 +00:00
rillig bd81849e6f lint: reorder grammar rules
First the base cases, then the extensions, like in most other rules in
this file.

No functional change.
2021-07-25 19:05:27 +00:00
rillig 5aebc23c2b lint: fix parsing of enumerators with __attribute__ 2021-07-25 18:48:47 +00:00
rillig b48b63239e lint: fix parsing of __attribute__ before enum tag
The __attribute__ after the enumerators will be fixed in a follow-up
commit since lint exits after the 5th syntax error in a translation
unit, which up to now shadowed the error messages about the enumerators.
2021-07-25 18:44:21 +00:00
rillig b538fc2d6a tests/lint: test __attribute__ with enum 2021-07-25 18:34:44 +00:00
rillig 11238664ef lint: add citations for a few grammar rules
No functional change.
2021-07-25 18:01:03 +00:00
rillig c127a42574 lint: fix parsing of GNU __attribute__ after __asm
GCC only accepts them in the order __asm __attribute__, not the other
way round.  So should lint.
2021-07-25 17:40:04 +00:00
rillig b51ebfa06f tests/lint: test declarators with attributes 2021-07-25 17:27:07 +00:00
rillig 66181cb792 lint: wrap overly long lines
No functional change.
2021-07-25 16:57:23 +00:00
rillig 75b7761af5 lint: do not parse 'typeof(0)(void)' as function call
Previously, lint tried to parse 'typeof(0)(void)' as 'typeof'
'(0)(void)', which tries to call 0 as a function.
2021-07-25 15:58:24 +00:00
gson 47974badd1 Only expect failure on ARM 2021-07-25 15:51:32 +00:00
rillig 9cd1116e41 lint: fix parsing of 'typeof(double(typeof(0.0)))'
By removing the misplaced grammar rule 'abstract_declarator: T_TYPEOF',
the type expression 'typeof(double(typeof(0.0)))' is no longer
interpreted as a declarator, but rather as a type specifier, just as in
the GCC parser.

This resolves 7 shift/reduce conflicts.
2021-07-25 15:48:57 +00:00
rillig 3428e1076e tests/lint: document parse error for GCC typeof 2021-07-25 11:19:51 +00:00
jmcneill 6b8843d4a4 rockchip: edp: Force VOPB as CRTC for eDP.
Fixes display init on Pinebook Pro w/ U-Boot 2021.07.
2021-07-25 11:14:15 +00:00
rillig 8c0cb28db5 tests/lint: demonstrate missing support for GCC typeof 2021-07-25 10:57:38 +00:00
rillig 42ed7d4230 lint: add type information to message about invalid cast
This probably doesn't matter in practice since the compiler is supposed
to catch this kind of error.  Adding the type information mainly ensures
that parsing abstract type names works as specified.
2021-07-25 10:39:10 +00:00
rillig 945ef5c297 tests/lint: test function types and pointer arithmetic 2021-07-25 10:26:46 +00:00
gson 0f3fd1afc4 Remove "pkill -9 execsnoop". It's wrong on so many levels: first of
all, it does not actually kill anything because the process executing
the execsnoop script is called "sh", not "execsnoop".  And even if it
would somehow kill the shell running the execsnoop script, it still
would not kill the dtrace child process.  On the other hand, if there
happened to be an unrelated process actually called "execsnoop", it
would kill that.

The actual killing of the execsnoop sh and dtrace processes happens in
the ATF cleanup stage (as it always has).
2021-07-25 10:21:44 +00:00
gson 00195ad3b0 Increase sleep waiting for execsnoop to start; one second is not sufficient
on a Dell Latitude D400 i386 laptop.
2021-07-25 10:11:32 +00:00
rillig f95f6dd911 tests/lint: try harder to reduce 'abstract_declarator: T_TYPEOF'
At the top level of a type_name, declaration-specifiers take precedence,
but these cannot look inside the parentheses of a
direct-abstract-declarator.
2021-07-25 09:53:01 +00:00
rillig cac4d3f74a tests/lint: document unreachable 'abstract_declarator: T_TYPEOF' 2021-07-25 09:47:08 +00:00
rillig f450420d6f tests/lint: test parse errors in statements
These errors are really unrealistic.  Most parse errors that occur in
statements are already handled elsewhere and continue with the next
semicolon.

The tests had to be split into two separate files because lint assumes
that after the 5th parse error, it does not make sense to continue this
translation unit.
2021-07-25 09:29:20 +00:00
simonb 1045db0b2f Update to reflect current reality for template characters - the process
ID is not longer used and we replace each "X" with one of 64 values not
26 values.
2021-07-25 08:52:03 +00:00
rillig 6201c2aa16 tests/lint: test parsing of type_name 2021-07-25 08:42:28 +00:00
nia 92e19c2b10 Add a man page for amdccp(4) 2021-07-25 07:35:55 +00:00
skrll 3024ad7e65 #include <sys/param.h> for COHERENCY_UNIT (and KNF) 2021-07-25 06:10:01 +00:00
skrll 7f8c58afc7 KNF 2021-07-25 06:07:42 +00:00
simonb 6947b62866 If we're only doing a count-only kern.buf sysctl, just return the number
of active members in the pool cache (plus some slop) instead of looking
in all the free buffer list.  Should reduce CPU usage for "systat vm"
to << 1% especially for machines with a larger number of buffers.
2021-07-25 06:06:40 +00:00
rillig ccad6aa52f tests/lint: demonstrate internal error in parsing a declaration 2021-07-25 06:04:40 +00:00
simonb b80cba6a3c Add accessor functions to get the number of gets and puts on pools and
pool caches.
2021-07-25 06:00:31 +00:00
dholland 06bcde7934 Flush input to EOL correctly in games/fish.
PR 54885 from Mouse, with a somewhat different patch.
2021-07-25 02:00:42 +00:00
jmcneill c211f59c20 acpi_timer: use ACPI-Fast if WAET timer one read flag is set
The Windows ACPI Emulated Devices Table (WAET) has a hint to inform the OS
that a single read of the PM timer is reliable. Honour this flag.
2021-07-25 01:43:08 +00:00
macallan f83944e0d2 don't put CPUs in separate zones, turns out there really isn't much that
keeps the airflow apart around them
2021-07-25 00:11:43 +00:00
jmcneill b761bc7ba5 aarch64: Remove empty source file and references to it. 2021-07-24 23:38:40 +00:00