Commit Graph

302000 Commits

Author SHA1 Message Date
rillig 353545ac36 lint: consistently use portable type size in integer constraints
Since tree.c 1.546 from 2023-07-03, lint no longer warned about possible
loss of accuracy when converting from 'long' to 'int' on an ILP32
platform that uses 'unsigned long' for size_t, when run in portable mode
(-p), which is enabled by default in the NetBSD build.

The integer constraints avoid false-positive warnings by looking at the
actual values an expression can take.  The function can_represent is
guarded by a condition that uses the portable_size_in_bits, but then
internally used the opposite size_in_bits, which led to inconsistent
results.

The warning looks confusing though, as on an ILP32 platform, 'int' and
'long' have the same size and representation, therefore there cannot be
an actual loss of accuracy.  The warning may need to be reworded to
explicitly mention the portability mode, in which sizeof(int) is assumed
to be 3 instead of 4, to catch possible loss of accuracy on other
platforms.
2023-07-03 21:36:16 +00:00
christos 53d5df7bf7 PR/57500: Palle Lyckegaard: include missing tools/compat/regex.h for
__{BEGIN,END}_DECLS.
2023-07-03 18:50:42 +00:00
jakllsch a2ccae7922 Enable MEMORY_DISK_DYNAMIC & co. to match std.generic64
Allows loading of ramdisk.fs via u-boot initrd (to run sysinst)
2023-07-03 17:05:10 +00:00
rillig 2bb36c1110 tests/lint: move platform-specific query tests to separate files
This fixes the tests on 'unsigned char' platforms.

Thanks martin@ for the notification.
2023-07-03 15:29:42 +00:00
rillig 946e5f868e lint: sync usage messages with reality 2023-07-03 11:16:32 +00:00
rillig 00176afffd lint: invert the -u, -v and -z flags
Now they behave the same as in the manual page.

No functional change.
2023-07-03 10:23:12 +00:00
rillig 9f9de93598 lint: remove redundant comments for command line flags 2023-07-03 10:14:31 +00:00
rillig e5eea854b3 tests/lint: clean up tests for C99 bool 2023-07-03 09:37:14 +00:00
rillig 10bd4ec804 lint: fix C11 mode to not allow C23 features (since yesterday) 2023-07-03 09:33:07 +00:00
rillig b3f3a1755e lint: clean up redundant casts 2023-07-03 07:19:57 +00:00
rillig 4f51279e58 lint: rename uppercase QUAD to LLONG
No binary change.
2023-07-03 07:03:19 +00:00
rillig ed46a22553 dri.old: disable lint again 2023-07-02 23:56:12 +00:00
rillig a615f06cd9 tests/lint: add C23 tests 2023-07-02 23:45:10 +00:00
rillig 29b0195f9b lint: add initial support for C23
Required by xsrc/external/mit/MesaLib.old, brw_eu_validate.c, which
initializes a struct using empty braces: 'return (struct string){};'.
2023-07-02 23:40:23 +00:00
rillig e16f398bf1 lint: allow empty statements in GCC statement expressions 2023-07-02 22:56:13 +00:00
rillig 6ab24c0b4d tests/lint: demonstrate empty statement in GCC statement expression
Seen in external/mit/xorg/lib/dri.old.
2023-07-02 22:50:18 +00:00
rillig 1936c0797e lint: eliminate redundant conditions 2023-07-02 21:37:49 +00:00
rillig d30bb84cc7 lint: clean up variable names relating to structure padding 2023-07-02 18:28:15 +00:00
rillig ad4700f62b lint: rename 'quad' to 'signed int' or 'unsigned int'
No functional change.
2023-07-02 18:14:44 +00:00
rillig 63cd7c27d4 lint: use unsigned int for struct alignment
This gets rid of 'unsigned short', which saved a few bytes of memory but
was inconvenient to deal with.

No functional change.
2023-07-02 17:41:30 +00:00
riastradh 437cf891b2 getrandom(2): Reduce editorializing tone in man page.
XXX pullup-10
2023-07-02 13:25:52 +00:00
nia 3e3774f9ae Fix typo in comment. 2023-07-02 12:39:05 +00:00
rillig e2bd7ab59b lint: extend debug logging for declaration levels
Indent the debug logging according to the declaration level.

Since there are a few cases where the enclosing declaration levels are
modified, log the whole declaration level stack whenever a level begins
or ends.
2023-07-02 10:20:45 +00:00
mlelstv cee41877f8 Fix HTTPS through Proxy.
While a regular HTTP Proxy, requires the absolute URL with protocol
and host part, yyou must only send the relative URL through a
CONNECT tunnel (you are talking to the target server).
2023-07-02 10:02:09 +00:00
rillig 29d2bd0ac5 lint: initialize unnamed member like an unnamed bit-field
See set_bit_field_width.
2023-07-02 09:40:25 +00:00
rillig 96c82f9f2d lint: clean up variable names 2023-07-02 08:16:19 +00:00
dholland 4d2a6699db libc/shlib_version: note that *rand48* should be punted to libcompat 2023-07-02 00:52:04 +00:00
rillig 600fe2a7c7 tests/lint: rework tests for type names 2023-07-01 20:57:37 +00:00
rillig 78dcf2d1b7 dri.old: only disable lint for a single file 2023-07-01 15:16:46 +00:00
nia f2a3b5a95e regen 2023-07-01 13:37:48 +00:00
nia 186bf727f6 Add Realtek ALC671 to hdaudiodevs, seen on Fujitsu Futro S720 thin client 2023-07-01 13:37:36 +00:00
mlelstv d3f564cbbf Don't call UP script when an IP address becomes deprecated. 2023-07-01 12:36:10 +00:00
nia d92552c3ea tetris(6): Support the informal standard of allowing setting NO_COLOR
in the environment to disable the use of color. (no-color.org)
2023-07-01 10:51:35 +00:00
nia d644da2ee9 Use ENVIRONMENT section 2023-07-01 10:47:12 +00:00
rillig 6aee6dcfa0 lint: constify, reduce indentation
No functional change.
2023-07-01 10:04:27 +00:00
rillig 5eadae9e5a lint: clean up comments in lint1.h 2023-07-01 09:59:51 +00:00
rillig 52f3b73d82 lint: clean up duplicate and dead code for integer constants
No functional change.
2023-07-01 09:31:55 +00:00
rillig b1cae80086 doc/CHANGES: fix typos 2023-07-01 09:21:47 +00:00
rillig c6d4ed97fd lint: clean up typos 2023-07-01 09:21:31 +00:00
rillig 102b73ba9b tests/make: show how to use indirect conditions in the '?:' modifier 2023-07-01 09:06:34 +00:00
skrll 9d814dceba Fix build when KERNHIST defined, but not UVMHIST 2023-07-01 07:10:13 +00:00
rillig ed2a91d216 jemalloc: enable lint again, it is no longer broken
Since today, lint handles unnamed struct/union correctly.
2023-07-01 06:29:14 +00:00
rillig 130b20d8de lint: fix initialization of unnamed union member 2023-07-01 06:09:24 +00:00
gutteridge 7408a707bd audioplay.1: fix sentence punctuation 2023-06-30 23:36:47 +00:00
rillig 91f591a176 tests/lint: test initializing an unnamed union 2023-06-30 22:27:47 +00:00
uwe 31f1ed95bf getentropy(3): use .Sx to xref CAVEATS 2023-06-30 22:15:14 +00:00
christos 498dfa02ae new OpenPAM. 2023-06-30 21:48:15 +00:00
christos 0d9d0fd8a3 merge openpam ximenia 2023-06-30 21:46:20 +00:00
riastradh b36d83c44f getrandom(2), getentropy(3): Rework man pages.
Make supportable promises.  Omit needless verbiage.  Give caveats
with cross-references to entropy(7).  Emphasize that security is
necessarily relative to system configuration.

XXX pullup-10
2023-06-30 21:44:22 +00:00
riastradh e857694c31 rc.conf(5): Set entropy=wait by default.
We no longer block indefinitely -- if nothing else, the hardclock
timer should yield enough samples to unblock /dev/random on all but
the most severely deterministic machines -- so it should be generally
safe for availability to set entropy=wait.

This doesn't guarantee that HWRNG/seed has been provided before you
run ssh-keygen or call getentropy(3) in a user application, but it
does raise the security above netbsd<=9.

PR security/55659
PR lib/56905

XXX pullup-10
2023-06-30 21:44:09 +00:00