rillig
b60c67330a
lint: add assertions for aggregate initialization
...
No functional change.
2021-03-28 20:35:58 +00:00
rillig
af1032a21b
lint: add test for assertion failure in initialization
...
The 'cnt = level->bl_type->t_tspec == STRUCT ? 2 : 1;' in
initialization_push_struct_or_union is obviously wrong since not every
struct has exactly 1 remaining member after the first member that has an
initializer with designation.
This bug started its life in init.c 1.12 from 2002-10-21, a little over
18 years ago.
2021-03-28 19:53:58 +00:00
rillig
42f643d6d2
lint: split complicated function for looking up struct members
...
No functional change.
2021-03-28 19:30:08 +00:00
rillig
46e70dbb1a
tests/lint: add tests for initialization
2021-03-28 18:48:32 +00:00
rillig
43bbce9d8f
lint: inline variable in initialization_init_array_using_string
...
No functional change.
2021-03-28 18:33:27 +00:00
rillig
fe38660a11
lint: clean up initialization_init_array_using_string
...
No functional change.
2021-03-28 18:28:22 +00:00
rillig
6194e85bdd
lint: clean up initialization_expr
...
No functional change.
2021-03-28 18:21:28 +00:00
rillig
966105efc7
lint: extract duplicate code to is_string_array
...
No functional change.
2021-03-28 18:18:22 +00:00
rillig
ff8ca4b11c
lint: add is_struct_or_union
...
No functional change.
2021-03-28 18:01:57 +00:00
nia
b41a8b7b73
DRM
2021-03-28 17:52:09 +00:00
christos
0ca9a87c3a
yield so we can lose packets
2021-03-28 17:30:01 +00:00
christos
6d3e616a93
If we are running the test as an unprivileged user, hand ownership of the
...
test directory to that user.
2021-03-28 16:35:37 +00:00
rillig
ef0f1616fd
lint: extract brace_level_subtype
...
No functional change.
2021-03-28 16:28:15 +00:00
rillig
2a57740d57
lint: extract initialization_end_brace_level
...
No functional change.
2021-03-28 16:19:21 +00:00
rillig
17b8bb349c
lint: extract check_no_auto_aggregate
...
No functional change.
2021-03-28 15:39:25 +00:00
rillig
94f17677cf
lint: only define GCC builtins if -g is given
...
This removes 7 wrong warnings when running lint in -t mode.
Surprisingly, this added a warning that had not been there before in
msg_189.c. This is because check_variable_usage skips the checks when
an error occurred before. All diagnostics that happened were warnings,
but the -w option treats them as errors, see vwarning.
2021-03-28 15:36:37 +00:00
rillig
7261c8f667
tests/lint: add test for struct initialization in traditional C
2021-03-28 15:12:20 +00:00
christos
60c74c06b2
Clarify and explain the rationale for parentheses in sizeof and return as
...
discussed.
2021-03-28 14:28:56 +00:00
christos
7829d1021c
- EXIT_FAILURE instead of 1
...
- %j instead of PRI for *intmax_t
- != -1 instead of < 0 for syscalls
2021-03-28 14:16:16 +00:00
rillig
1ecca4fb87
lint: clean up type handling in initialization
...
No functional change.
2021-03-28 14:13:18 +00:00
rillig
034864b5d3
lint: remove wrong warning about wrong initializer type
...
The following code is valid:
int valid = {{{ 3 }}};
C90 3.5.7 and C99 6.7.8 both say that the "initializer for a scalar
shall be a single expression, optionally enclosed in braces". They
don't put any upper bound on the amount of braces, not even in the
"Translation limits" section.
2021-03-28 14:01:49 +00:00
christos
ba06fc1c94
Only unescape when we are quoting and don't add a space if we are quoting
...
(we already did) (Piotr Stefaniak)
2021-03-28 13:39:39 +00:00
christos
1740d9142b
document the flag
2021-03-28 13:38:10 +00:00
christos
b94551931c
Pass the unescaped filename the the append function so it has to do less work
...
(for example it can call stat(2) directly (Piotr Stefaniak)
2021-03-28 13:33:54 +00:00
rillig
3bd18ec06c
lint: sprinkle const on function declarations
...
No functional change.
2021-03-28 13:09:43 +00:00
jmcneill
665875b486
Disable 1ofN distribution of SPIs by default. This is a workaround for an
...
issue in the USB stack -- signaling transfer complete on multiple PEs can
cause transfer completions to be processed out of order.
2021-03-28 11:13:24 +00:00
rillig
a97ec4c8f0
lint: move code for extending an array of unknown size further up
...
No functional change.
2021-03-28 11:08:01 +00:00
rillig
21b415bd4d
lint: move code for checking init expressions further up
...
It did not make sense to have this code between the code for the
designation and the brace level. Since it is independent of all these
types, move it to the top.
No functional change.
2021-03-28 10:58:18 +00:00
rillig
ab203ec18a
lint: group functions according to their main object
...
No functional change.
2021-03-28 10:52:41 +00:00
skrll
32889a98fd
fix a comment that has been c&p'ed around and not updated
2021-03-28 10:29:05 +00:00
rillig
bed16d6c94
lint: rename public designator functions
...
Their previous names were too similar to the actual implementation
functions, which was confusing.
No functional change.
2021-03-28 10:09:34 +00:00
rillig
8d56fa8a62
lint: inline initsym
...
No functional change.
2021-03-28 10:05:19 +00:00
rillig
9d93c87b1f
lint: replace initstack_push_array with brace_level_push_array
...
The designator is no longer logged at this point because it is
irrelevant.
No functional change.
2021-03-28 10:03:02 +00:00
rillig
efa03aa3f8
lint: clean up debug logging, use consistent variable names
...
No functional change.
2021-03-28 09:57:31 +00:00
rillig
113c2810b6
lint: omit unnecessary calls to current_init
...
No functional change.
2021-03-28 09:51:16 +00:00
rillig
d983f2b76b
lint: move brace level functions further up
...
No functional change.
2021-03-28 09:46:55 +00:00
rillig
77e6be55c1
lint: clean up debug logging for initialization
...
No functional change.
2021-03-28 09:43:28 +00:00
rillig
d868ac1eab
lint: inline initerr in code for handling initializations
...
No functional change.
2021-03-28 09:39:04 +00:00
rillig
f7466f5c66
lint: inline brace level in initialization
...
No functional change.
2021-03-28 09:34:45 +00:00
rillig
a67ebcf1f2
lint: replace global variables with function parameters
...
No functional change.
2021-03-28 09:20:51 +00:00
skrll
2aee461d79
Only target the boot cpu for real with SPI interrupts. I tried to do
...
this back in 2014, but somehow I missed a spot.
This is a quick-and-dirty fix for the USB stack which expects transfer
completions to be in-order. If interrupts happen across the CPUs then
this isn't guaranteed (yet).
kern/55243 panic at usb_transfer_complete() on raspberry pi 4
2021-03-28 09:11:38 +00:00
rillig
403d5c8a72
lint: move more functions to the global-variables-free section
...
No functional change.
2021-03-28 09:08:13 +00:00
martin
22e296c448
Enable a few more filesystems
2021-03-28 08:43:05 +00:00
martin
c665b2ca89
Remove makeoptions DEBUG="-g" - we have better ways to achieve the same
...
(build.sh kernel.gdb= or MKKDEBUG=yes)
2021-03-28 08:39:31 +00:00
martin
9096d3ad6e
Add siisata
2021-03-28 08:34:18 +00:00
rillig
8d7ac35e4f
lint: reorder code for handling initializations
...
First the primitives for debug logging, then the functions that do not
access any global variables, finally everything else.
No functional change.
2021-03-28 08:30:22 +00:00
rillig
18eeb7dffa
lint: move debug primitives to the top of the code
...
No functional change.
2021-03-28 07:59:09 +00:00
isaki
1b5c35427c
Update documents.
...
- query_format has been mandatory (since at least Feb 2020).
- set_params has been replaced to set_format (since May 2019).
2021-03-28 07:42:06 +00:00
dholland
2ab5b263a3
Document EINVAL for out of range socket address lengths.
...
This is what happens, but wasn't documented. Applies to bind(2),
connect(2), and send(2).
2021-03-28 03:29:31 +00:00
dholland
7ec5b82b08
In getvfsstat(2), clarify that the size argument is in bytes.
...
That the size argument is in bytes (not the count of structures) and
the return value is the count of structures (not bytes) is
counterintuitive.
2021-03-27 23:35:37 +00:00