Commit Graph

286596 Commits

Author SHA1 Message Date
rillig
a0407258e3 tests/lint: test initialization using string literals
The errors in line 74 and 75 of the test are wrong.  Everything is fine
there.  The bug lies in init_array_using_string, try to see if you can
spot it, neither GCC 9.3.0 nor Clang 8.0.1 could.
2021-03-23 21:19:08 +00:00
christos
adb6523077 Consistently comment out code that lint can't handle (yet?) 2021-03-23 20:59:02 +00:00
christos
cf91e4bb2b Add _Alignas() 2021-03-23 20:57:40 +00:00
christos
f089647658 We have _Alignas now 2021-03-23 20:57:10 +00:00
christos
1cab48c7ca remove extra ;'s 2021-03-23 20:56:25 +00:00
rillig
c40f4a5057 lint: extract init_using_assign from init_using_expr
No functional change.
2021-03-23 20:21:07 +00:00
rillig
7c67467864 lint: merge duplicate code in init_using_expr
No functional change.
2021-03-23 20:14:55 +00:00
palle
7f9e0d13bd sun4v: update TODO with findings related to crashes in user processes (pcbspill) 2021-03-23 19:13:46 +00:00
rillig
49b3d03d05 lint: fix documentation about optional braces in initializers 2021-03-23 18:51:43 +00:00
rillig
886197979c bind: remove the workaround for a bug in lint for compound literals
This bug has been fixed in init.c 1.111 from a few minutes ago.
2021-03-23 18:46:07 +00:00
rillig
131c7001fe lint: fix wrong error message about type mismatch in compound literal
Now that the code contains explicit markers for starting and ending an
initialization, and having the guarantee that an assertion fails
whenever some code accesses the state of the "current initialization"
even though there is no ongoing initialization gives me much more
confidence in the correctness of the code.  The calls to
begin_initialization and end_initialization always appear in pairs,
enclosing the minimal amount of code necessary for initialization.

In a nutshell, global modifiable state is error-prone and hard to
understand.

A nice side effect is that the grammar no longer needs a special rule
for the outermost initializer since the functions for the debug logging
are now called explicitly.

The code that misuses the initialization state just because it needs to
temporarily store a sym_t somewhere is now clearly marked as such.  A
GCC statement expression can appear anywhere and is therefore
independent of the initialization.  Most probably the code can simply
refer to the local variable in the grammar rule itself, or this variable
needs to be encoded in the grammar %union.  For sure there is a better
way to handle this.

There is no longer a need that the function 'declare' initializes the
initialization state, it was just the wrong place to do this.
2021-03-23 18:40:50 +00:00
christos
eacf04d89a print function names as %s: not <%s> everywhere for consistency. 2021-03-23 18:16:53 +00:00
christos
d4aba2dbef interface indexes are unsigned 2021-03-23 18:16:21 +00:00
christos
7b76707a70 call tzset() before chroot so we initialize our timezone data 2021-03-23 18:13:07 +00:00
christos
b4e13c3078 fix misplaced paren, add missing va_end() 2021-03-23 18:06:19 +00:00
rillig
19b0e62cf4 lint: add indirection for accessing the current initialization
This indirection will be needed to handle nested initializations, which
are a new feature of C99.  These are currently not handled correctly,
see msg_171.c.

No functional change.
2021-03-23 17:36:55 +00:00
simonb
5f1014a3da Work in progress for MIPS modules. Only tested on mipseb64, not yet
enabled anywhere.
2021-03-23 13:22:40 +00:00
simonb
9303afaaec Add some \n's to the end of some printf()s. 2021-03-23 13:19:09 +00:00
simonb
f8433012b0 Remove addition of -msym32 to CFLAGS. Hinders rather than helps build
MIPS modules.
2021-03-23 11:56:55 +00:00
simonb
4422f1e5e9 Remove duplicate out-of-place comment. 2021-03-23 11:41:53 +00:00
skrll
cc0ef9cef5 Another missing kpreempt_enable 2021-03-23 10:21:49 +00:00
skrll
724ed304b4 KNF 2021-03-23 08:07:23 +00:00
rin
6a271b6a79 Make this compile with -DDEBUG. 2021-03-23 07:21:40 +00:00
rin
7309fe20af Make sure not to run kernel if fdloadfile() fails;
it returns *non-zero* value on error.
2021-03-23 07:21:15 +00:00
skrll
5a90db8f6c Re-enable kpreemption in an error path. Spotted by nat@ 2021-03-23 06:35:24 +00:00
christos
3b02207a1b Fix the shuttle rules by defining a new EXEC_TARGET instead of re-using
OBJECT_TARGET which adds an extra .o sometimes. Noticed by Greg A. Woods
2021-03-22 21:52:26 +00:00
rillig
a2e7847c63 lint: reduce visibility of variables for initializations
No functional change.
2021-03-22 19:29:43 +00:00
rillig
cb3c7a45cf lint: reduce visibility of global variable for getopt check
No functional change.
2021-03-22 19:25:08 +00:00
christos
b3ffdf360d - remove extra \n from stderr logging
- add string message types
- sprinkle const
2021-03-22 18:41:11 +00:00
christos
f19451d962 Add a list of names 2021-03-22 18:40:18 +00:00
rillig
56f5eec48a tests/lint: explain wrong type mismatch in compound literal
When a pointer to a compound literal is used as an initializer, lint
reports a wrong type mismatch.  The details of what happens are now
documented, which allows this problem to be fixed properly.
2021-03-22 16:51:24 +00:00
rillig
771299944e lint: use precise type information in message about type mismatch
While here, reword the message, avoiding operators and parentheses.

Since 2021-01-02, providing the precise type name is as easy as the
broad type classification (just replace tspec_name with type_name), and
it's definitely more useful to the human readers.
2021-03-22 15:29:43 +00:00
rillig
22b59a10f3 bind: fix workaround for bug in lint
The previous attempt resulted in a 'syntax error'.
2021-03-22 15:12:24 +00:00
rillig
9e1bfe0e24 lint: demonstrate bug in assignment of compound literal
Seen in external/mpl/bind/dist/lib/dns/rbtdb.c, update_rrsetstats.
2021-03-22 15:05:00 +00:00
tsutsui
c1dc1a169a Remove -DHAVE_STRCASECMP from CPPFLAGS that is defined in dix-config.h. 2021-03-22 14:11:02 +00:00
christos
5eb26e7317 Avoid memory leak on empty lines (https://reviews.freebsd.org/D29370) 2021-03-22 03:28:55 +00:00
rin
ebb772824e Brush up previous, or make things more similar to x86:
- Prevent pic_name from appearing vmstat(1) twice.
- Restore "irq" in interrupt id fields of intrctl(8).

For these purposes,

- Add is_evname member to struct intr_source.
- Bump size of is_source to INTRIDBUF, and rename it to is_intrid for clarity.

Now, outputs from vmstat(1) and intrctl(8) are like:

----
$ vmstat -ev
...
openpic irq 39                                 3967   26 intr
...
$ intrctl list
interrupt id   CPU0  device name(s)
...
openpic irq 39 3967* wdc1
...
----
2021-03-22 01:36:10 +00:00
wiz
4df5d7619b New sentence, new line. 2021-03-22 00:09:06 +00:00
rin
8770a23fd8 Fix copy-paste. 2021-03-21 23:41:52 +00:00
mrg
f96996de73 note that ttyaction.[35] first appeared in netbsd 1.3. 2021-03-21 23:29:36 +00:00
rillig
490538eb4d make: fix typos in documentation of ModChain 2021-03-21 23:03:33 +00:00
wiz
2c99edc276 Use standard section names, sort, use more macros. 2021-03-21 21:26:00 +00:00
rillig
ab16413a62 lint: prefix error messages with 'error:'
This makes it easier to find these errors in the build logs.
2021-03-21 20:44:59 +00:00
rillig
494aa35c5b lint: remove redundant prototypes
No functional change.
2021-03-21 20:30:19 +00:00
rillig
f838b057fa lint: adjust type in documentation of add_array
No functional change.
2021-03-21 20:18:45 +00:00
rillig
a23b8b6d6f tests/lint: test reachability of goto and named labels 2021-03-21 20:08:21 +00:00
rillig
0676c13cad tests/lint: add test for reachability of non-constant conditions 2021-03-21 19:39:01 +00:00
rillig
cd0f66fe16 tests/lint: add test for reachability of nested 'if' statements 2021-03-21 19:18:37 +00:00
rillig
ac846d67c2 lint: warn about unreachable statement after joining the 'if' branches 2021-03-21 19:14:40 +00:00
rillig
f32d16fd5a lint: invert 'rchflag', call it warn_about_unreachable instead
No functional change.
2021-03-21 19:08:10 +00:00