Commit Graph

286371 Commits

Author SHA1 Message Date
rillig
4baf940241 lint: rename d_nedecl to d_nonempty_decl
No functional change.
2021-03-21 10:25:40 +00:00
rillig
b7e78ec23d lint: rename d_rdcsym to d_redeclared_symbol
No functional change.
2021-03-21 10:21:07 +00:00
rillig
94e7a0615e lint: inline local variable in declarator_1_struct_union
No functional change.
2021-03-21 10:16:12 +00:00
rillig
c509e4baa5 lint: rename clst to case_labels
No functional change.
2021-03-21 10:08:01 +00:00
rillig
7dc34efc1f lint: rename declspecs to declaration_specifiers, just as in C99
No functional change.
2021-03-21 09:54:02 +00:00
rillig
7e6909cce4 lint: rename grammar rule 'data_def' to 'top_level_declaration'
No functional change.
2021-03-21 09:49:34 +00:00
rillig
6474e49f87 lint: remove redundant '%prec' declarations from the grammar
No change to the generated binary.
2021-03-21 09:22:35 +00:00
skrll
56c0734421 Fix a comment 2021-03-21 09:08:40 +00:00
skrll
ffb2f41da6 -DKERNEL_BASE_VOFFSET= has annoyed me for the last time...
Introduce KERNEL_VOFFSET_RUNTIME which prevents the addition of
-DKERNEL_BASE_VOFFSET= to the command line and use it on the
__HAVE_GENERIC_START kernels which do runtime calculation of the
offset.
2021-03-21 09:00:55 +00:00
rillig
4629487630 lint: rename token T_XOR to T_BITXOR
For symmetry with the operator, which is named BITXOR.

No functional change.
2021-03-21 08:55:59 +00:00
rillig
63f810f095 lint: in debug output, use uniform file location references
This makes it easy to click on the location in the IDE instead of having
to manually parse the location and navigate to it.

No functional change outside debug mode.
2021-03-21 08:52:05 +00:00
rillig
389a384e79 lint: remove redundant operator information from the grammar
Several tokens can only ever map to a single operator and thus do not
need to encode the operator.  Indeed, they already encoded it as NOOP,
and it was not used by any grammar rule.

No functional change.
2021-03-21 08:46:26 +00:00
skrll
01099b443f Adjust the kernel virtual address space so that KASAN will map the kernel
seperately from managed kernel virtual memory and not map the unused space
between the two.
2021-03-21 07:32:44 +00:00
skrll
ea4fbb3f9f Tweak a comment 2021-03-21 07:17:12 +00:00
skrll
cbef7ae258 Remove the unnecessary invalidation code in arm_efirt_md_map_range.
pmapboot_enter will panic if any overlapping mappings existed before and
a full TLB invalidate was done as part of turning the MMU on in locore.
2021-03-21 07:09:54 +00:00
cheusov
d7beb5fa1a seq.c: replace non-standard \e with standard compliant \x1B 2021-03-20 22:10:17 +00:00
rillig
b48597d41d lint: clean up new_name_node
No functional change.
2021-03-20 21:08:09 +00:00
rillig
440cc62809 lint: move getopname over to tree.c
Except for the one use in print_tnode, the name of the operator is only
used in tree.c.

No functional change.
2021-03-20 20:56:58 +00:00
rillig
ea582d3e24 lint: remove redundant operator properties table
It's enough to have modtab, which describes the properties of the
various operators.  There is no need to have a second table imods that
holds the same content.  Rather make modtab constant as well.

The only possible functional change is that the names of the internal
operators 'no-op', '++', '--', 'real', 'imag' and 'case' may appear in
diagnostics, where previously lint invoked undefined behavior by passing
a null pointer for a '%s' conversion specifier.
2021-03-20 20:39:35 +00:00
rillig
d6f490fd83 lint: fix argument names and table headings for operator definitions
The abbreviations in the table of operator properties had been wrong
since ops.def 1.10 from 2021-01-12, when strict bool mode was added.  In
an earlier working draft, I had named that column 'takes_others' instead
of 'requires_bool', that's where the 'o' came from.

The names of the macro arguments had been wrong since op.h 1.11 from
2021-01-09, when the order of the columns changed and the macros were
not adjusted accordingly.  Since all the properties of the operator
table are uniform, this didn't result in any bugs, it was just confusing
for human readers.

Clang-tidy suggests to enclose the macro arguments in oper.c in
parentheses but that is not possible since the arguments are either
empty or 1, and the syntactical ambiguity of the '+ 0' being either a
unary or a binary operator is needed here.

No change to the resulting binary.
2021-03-20 20:15:37 +00:00
rillig
5019ab66ba lint: make lint's own code pass the strict bool mode
No functional change.
2021-03-20 19:33:25 +00:00
rillig
7ccd7b1468 lint: use macro for initializing keywords table
Since today, lint's strict bool mode requires initializers to have the
correct type.  The flags in kwtab are of type bool and were initialized
with an int, for brevity.  Keep the brevity and do the conversion from
int to bool in a macro.

By defining several macros for the different kinds of keywords, reduce
the clutter of having 2 additional zeroes per line.  The macros also
remove the redundancy and thereby the possible inconsistency of filling
the wrong fields since these depend on the token type.

No functional change.  The only change to the binary is due to the
changed line numbers in the calls to lint_assert.
2021-03-20 19:24:56 +00:00
rillig
e18860fa07 lint: use macro for encoding type information
In lint's strict bool mode, initialization must be of the correct type.
This affects the bool fields in ttab_t, which are initialized with int.
To keep the code brief, preserve these ints and let a macro do the
actual work of converting them to bool.

No change to the generated binary.
2021-03-20 18:59:00 +00:00
rillig
6a451d6268 lint: inline access to type properties in check_bad_enum_operation
No functional change.
2021-03-20 18:38:25 +00:00
rillig
10736dfe07 lint: in strict bool mode, check initialization as well
C99 6.7.8p11 says for initialization that "the same type constraints and
conversions as for simple assignments apply", so actually apply them.
(I had just forgotten this "operator" when I first implemented strict
bool mode.)
2021-03-20 17:18:50 +00:00
rillig
f6312109e2 tests/lint: test initialization in strict bool mode
I somehow forgot to list INIT as one of the operators in
is_assignment_bool_or_other.
2021-03-20 17:08:08 +00:00
rillig
87876a2355 lint: rename ftflg to seen_fallthrough
One less abbreviation to remember when reading the code.

No functional change.
2021-03-20 16:16:32 +00:00
rillig
73790b7671 lint: make the calls to clear_warning_flags stand out less
Even though clear_warning_flags and its companions are implemented as
macros, they act like ordinary functions.  Do not distract the reader by
using uppercase names for them.

No functional change.
2021-03-20 16:11:12 +00:00
rillig
f5c815bc77 lint: clean up grammar for declaration after statement
No functional change.
2021-03-20 15:30:58 +00:00
rillig
fb9b10bc8d lint: fix check for declaration after statement in pre-C99 mode
The new code may not be the most beautiful, but it fixes all bugs that
occurred while testing message 327.  The grammar rules are taken from
C99 6.8.2, so it's no surprise they work well.
2021-03-20 15:28:07 +00:00
skrll
fe42ab4b72 Make pmapboot_enter panic if anything goes wrong and any mappings overlap
rather than only doing it in locore.S
2021-03-20 14:30:50 +00:00
cheusov
736f809ed1 cmp.c: use C99 strtoll(3) instead of legacy strtoq(3) 2021-03-20 14:27:47 +00:00
rillig
daef7ea921 lint: properly name C99 in message about declaration after statement
Now that C99 has been released and published, there is no reason anymore
to refer to it as C9X.
2021-03-20 14:17:56 +00:00
rillig
363ba317d3 tests/lint: add test for declaration after statement 2021-03-20 14:13:51 +00:00
rillig
b925668ec9 lint: use proper boolean literals instead of 0/1
The code in the C grammar is generated by yacc and is not checked by
lint's strict bool mode, therefore the replacement was done manually.

No change to the resulting change.
2021-03-20 13:53:28 +00:00
rillig
e4fa7e61a5 lint: update comment on setasm for C99
No functional change.
2021-03-20 13:25:31 +00:00
rillig
4f4415984d lint: reduce indentation and braces in merge_type_specifiers
No functional change.
2021-03-20 13:22:06 +00:00
rillig
e305d7be33 lint: extract adjusting of the storage class into separate function
No functional change.
2021-03-20 13:06:05 +00:00
rillig
1cf2c45884 lint: document the struct for declarations more precisely
No functional change.
2021-03-20 13:00:43 +00:00
rillig
d37415b4e9 lint: remove unnecessary '%prec T_COMMA' from grammar
My previous commit message was wrong in saying that the '%prec' was
necessary.  It is not necessary.

Most probably I misspelled the name of the grammar rule as opt_comma
instead of comma_opt, which would lead to the same number of conflicts
in the grammar plus a warning, but no build failure.
2021-03-20 11:33:50 +00:00
rillig
941875ba2d lint: join grammar rules for initialization
The '%prec T_COMMA' is necessary to avoid lots of parse errors in the
lint1 unit tests.  Curiously, further down in the grammar, for compound
literals, the '%prec T_COMMA' is not necessary, even though the context
looks very similar.

No functional change.
2021-03-20 11:24:49 +00:00
rillig
5f7e254669 lint: fix grammar for initialization
Previously, the grammar syntactically accepted the following code:

	int var = .member = 12345;

The designation '.member =' can only be used with brace-enclosed
initializers.
2021-03-20 11:05:16 +00:00
rillig
b61f069794 lint: align rule names in grammar with C99
No functional change.
2021-03-20 10:32:43 +00:00
rillig
a11859207b tests/lint: add more tests for initialization, based on C99 6.7.8 2021-03-20 08:59:46 +00:00
rillig
80b7b20b36 lint: fix assertion failure after error in designation
In d_c99_init.c, the initialization of array_with_designator failed.
The designator '.member' from that initialization was not cleaned up
before starting the next initialization.
2021-03-20 08:54:27 +00:00
rillig
88e315e145 lint: replace segmentation fault with assertion failure 2021-03-20 08:16:30 +00:00
skrll
d312f2c65b Don't mark EFI runtime pages LX_BLKPAG_OS_READ | LX_BLKPAG_OS_WRITE as
these bits are only used by the current pmap fault code and these are
wired pages which will never fault.
2021-03-20 06:48:23 +00:00
skrll
ea0b29cd75 Apply the
earlyconsgetc: return -1 instead of 0 because we will never produce input

fix to all copies.
2021-03-20 05:58:22 +00:00
isaki
7a7ca36496 Fix and improve the buffer length calculation to avoid zero length
even if blk_ms is small.
This fixes PR kern/56059.
2021-03-20 04:56:52 +00:00
rillig
1a007aec0b lint: improve debug loggin for initialization 2021-03-19 18:17:46 +00:00