Commit Graph

287585 Commits

Author SHA1 Message Date
khorben
c4e02ad6ec prekern: do not choke on bad entropy files
As submitted on port-amd64@ (part 2/3)

Tested on NetBSD/amd64.
2021-05-04 21:10:25 +00:00
khorben
dadf0eef45 prekern: add support for warning messages
As submitted on port-amd64@ (part 1/3)

Tested on NetBSD/amd64.
2021-05-04 21:09:16 +00:00
rillig
d16694fc52 tests/lint: make test for message 118 platform-independent 2021-05-04 19:57:56 +00:00
jmcneill
facc67ca98 Set VERSIONMACHINE to ${MACHINE} instead of evbarm (oops) 2021-05-04 19:07:19 +00:00
christos
88ec8e1e1c Fix code example (from RVP) 2021-05-04 17:51:55 +00:00
christos
87874d0971 Fix incorrect structure name (Rocky Hotas) 2021-05-04 17:47:51 +00:00
rillig
77a04ba4f7 libXaw: fix Clang build
--- Pixmap.pico ---
error: unknown warning option '-Wno-discarded-qualifiers'; did you mean
'-Wno-ignored-qualifiers'? [-Werror,-Wunknown-warning-option]
2021-05-04 17:47:05 +00:00
rillig
9b7284c255 compiler_rt: build .a.syms files as part of dependall
The previous target 'all' is a top-level target intended to be specified
by the user.  During the regular build, 'dependall' is used instead of
'all'.  The target 'realall' is common to those two.
2021-05-04 17:23:53 +00:00
rillig
2ef2b36bb5 bind: remove unnecessary CONSTCOND
Lint does not need this anymore, since 2021-01-31.
2021-05-04 13:40:34 +00:00
rillig
b640b0e245 bind: fix Clang build
I had already fixed this on 2021-03-27, but the fix was accidentally
reverted on 2021-04-29 when updating to bind 9.16.15.
2021-05-04 13:16:06 +00:00
skrll
ff9dfaecc9 Always expose pmap_tlb_update_addr now that all current PMAP_HWPAGEWALKERs
(arm) users provide the required functions.
2021-05-04 09:05:34 +00:00
skrll
45c27783d3 Provide pte_{value,valid_p} 2021-05-04 09:02:21 +00:00
rillig
8d96908096 lint: fix assertion failure when promoting a bit-field larger than int 2021-05-04 05:40:10 +00:00
rillig
249bb67fed tests/lint: demonstrate assertion failure "len == size_in_bits(INT)"
Seen on sparc64 in hdtoa.c:341 since sparc64 is one of the platforms
that has 128-bit long double and defines struct ieee_ext.ext_frach:48
based on uint64_t, which is a GCC extension.  Plain C99 only allows
_Bool, signed int and unsigned int as base type for bit-fields.
2021-05-04 05:32:52 +00:00
skrll
034e13e3b5 Sort __HAVE_ #defines. NFCI. 2021-05-03 20:07:57 +00:00
skrll
e57b205ea8 Remove unnecssary brackets. Same binary before and after. 2021-05-03 19:33:09 +00:00
tnn
c10b316a83 bcm2838_pcie: match brcm,bcm2711-pcie 2021-05-03 18:56:38 +00:00
simonb
e85380d6f9 Add links for the other functions documented in arc4random(3). 2021-05-03 11:07:55 +00:00
rin
6bcd046821 genet(4): Add support for rnd(9). 2021-05-03 10:28:26 +00:00
fcambus
e8311a17cd Remove duplicate #ifdef block. 2021-05-03 10:25:14 +00:00
nakayama
ed748a1dd8 Remove duplicate lines. 2021-05-03 08:44:05 +00:00
simonb
0cdd944264 Whitespace police. 2021-05-03 08:30:30 +00:00
rillig
2bdae3c73f lint: undefine macros for defining keywords after use
No functional change.
2021-05-03 08:03:45 +00:00
rillig
fd5ea9b204 if_wm: do not return a void value from a void function
This is a GCC extension.
2021-05-03 07:43:31 +00:00
rillig
d6845656c5 lint: remove redundancy when defining classic keywords
No functional change.
2021-05-03 07:30:19 +00:00
rillig
f34b241711 lint: reduce redundancy when defining GCC attributes
This macro would have prevented the unintended inconsistency in the
attribute 'pcs' (for ARM).

No functional change.  The generated code is the same, except for the
line numbers in lint_assert.
2021-05-03 07:25:08 +00:00
rillig
58cf05d8c5 lint: allow variables to be named 'pcs' 2021-05-03 07:08:54 +00:00
rillig
5615754a21 tests/lint: demonstrate bug in the lexer for GCC attributes 2021-05-03 06:24:18 +00:00
rillig
944c465b9d lint: fix parsing of __typeof__ after statement in ({ ... })
Since C99, declarations and statements can be freely mixed, and GCC
supported this even before 1999.
2021-05-03 05:24:44 +00:00
rillig
413a9598ba tests/lint: remove outdated comment
The test d_gcc_extension is already activated in line 121.
2021-05-03 03:50:43 +00:00
rillig
fd32325145 lint: fix compiler warning about signedness mismatch
No functional change.
2021-05-03 03:46:55 +00:00
rillig
9491476953 lint: allow large integer types for bit-fields in GCC mode
These types are explicitly allowed by GCC.

I'm not sure which of the flags -g and -p should be stronger.  That is,
if both -g and -p are given, should 'unsigned char' be allowed as a
bit-field type since -g would allow it, or should it be warned about
since -p warns about it?  For now, continue to warn about these.
2021-05-02 22:07:49 +00:00
rillig
46bc06fdbe lint: extract check_bit_field_type from declare_bit_field
No functional change.
2021-05-02 21:48:53 +00:00
rillig
b0f8c816d4 tests/lint: fix test for GCC bit-field types
The whole purpose of this test is to try the message about invalid
bit-field types in GCC mode.  Therefore, use the default lint1-flags
that include -g.
2021-05-02 21:47:28 +00:00
nia
9bf7704373 audio: Only score hardware formats by channel count at count<=2
Scoring by channel count makes sense when you are using hardware that
supports mono and stereo formats. However, if your hardware also supports
surround formats, defaulting to those might be confusing. So, don't
prefer them.

Problem reported and fix tested by tcmart14 with a 2015 model Macbook Pro.
2021-05-02 21:37:32 +00:00
rillig
c29d5e341f tests/lint: add test for bit-field types in GCC mode 2021-05-02 21:22:09 +00:00
rillig
8e6f3338ac lint: on request, keep the preprocessor output
Previously, the simplest way of getting the preprocessed translation
unit was to run lint with the additional flag -V, which outputs the
command line of the C preprocessor, among other things.  That command
line does not include the proper quoting though, so it cannot be used
verbatim as a shell command if the command line contains spaces such as
in -Du64="unsigned long long".

In the common situation where lint is run via a Makefile, the option -V
had to be added in the Makefile itself since there is no make variable
for additional user-settable lint flags.  This is not straight-forward
enough.

Adding another command line option for this purpose would reduce the
remaining namespace for options.  Most of the 52 letters are already
used up.

To make this situation as simple as possible, preserve the output of the
C preprocessor depending on an environment variable.
2021-05-02 21:05:42 +00:00
rillig
f090e42deb lint: sort GCC attributes alphabetically in the grammar
No functional change.
2021-05-02 20:53:13 +00:00
rillig
ed02aca188 tests/lint: demonstrate missing support for __packed __aligned 2021-05-02 20:44:46 +00:00
rillig
f0bd455f32 sys/conf/lint.mk: fix order of command line options
The option -o must come before the first filename.

Now it is possible to lint kern_exec.c at least.  The next failure is in
netbsd32_machdep.c:

	netbsd32_machdep.c(395): error: illegal bit-field size: 255 [36]

That line in netbsd32_process_read_fpregs reads:

	__CTASSERT(sizeof(*regs) == sizeof(struct save87));

This is probably a bug in lint.  The struct save87 contains 3 uint16_t,
followed by a union containing a uint64_t, followed by a packed struct
with size 10.  The combination of packed and padding is suspicious.
2021-05-02 20:11:43 +00:00
rillig
0286d007d2 sys/conf/lint.mk: allow GCC extensions in the kernel
The syntax errors due to the __asm statements are now gone.  The file
kern_exec.c only produces a few warnings now.  But after running that
file through lint1, the main lint complains about wrong usage.  This is
due to this call:

	${LINT} ... -i $< -o $@

The main lint has never supported -o after the first filename, so it
complains.  It would have been helpful if lint had given any hint as to
which option was invalid.  Anyway, the next step is to reorder the
arguments.  As it is now, the code can never have worked.
2021-05-02 19:51:57 +00:00
rillig
09e420f981 sys/conf/lint.mk: a small step for linting the kernel
Due to the missing path, the following commands had failed:

	$ cd src/sys/arch/amd64/compile/GENERIC
	$ nbmake-amd64-lint kern_exec.ln
	nbmake: don't know how to make kern/kern_exec.c. Stop

After fixing the path, "make kern_exec.ln" fails with:

	sys/kern/kern_exec.c(65): error: syntax error '"' [249]

The affected line contains:

	__KERNEL_RCSID(0, "...");

The macro __KERNEL_RCSID expands to __asm("some strings").  Since
KERNLINTFLAGS is missing the -g, lint does not recognize __asm as
keyword and tries to parse it as an identifier instead, expecting a
variable or function declaration.
2021-05-02 19:29:30 +00:00
jdolecek
e010d49ce8 implement fo_restart hook for kqueue descriptors, so that close(2)
on the descriptor won't block indefinitely if other thread is currently
blocked on the same kqueue in kevent(2)

done similarily to pipes and sockets, i.e. using flag on the potentially
shared kqueue structure hooked off file_t - this is somewhat suboptimal
if the application dup(2)ped the descriptor, but this should be rare
enough to not really matter

usually this causes the kevent(2) to end up returning EBADF since
on the syscall restart the descriptor is not there anymore; if
dup(2)ped the kevent(2) call can continue successfully if the closed
kqueue descriptor was other than the one used for the kevent(2)
call

PR kern/46248 by Julian Fagir
2021-05-02 19:13:43 +00:00
jmcneill
06e5adc04e Add RISC-V 64-bit support. 2021-05-02 15:22:27 +00:00
rillig
2caa24ffff countmail: remove outdated comments
Using the shell builtin 'read' command was necessarily slow because it
is specified to read a single byte at a time.
2021-05-02 13:10:36 +00:00
rillig
1182a44c59 games: remove trailing whitespace in *.c and *.h 2021-05-02 12:50:43 +00:00
rillig
0527d6d12b fish: remove trailing whitespace 2021-05-02 12:25:55 +00:00
rillig
4dbccc6d68 fish: use arc4random_uniform for drawing random numbers
Thanks nia@ for the hint.
2021-05-02 12:24:59 +00:00
martin
3e0848b4f6 Add test for POSIX_SPAWN_RESETIDS flag 2021-05-02 11:18:11 +00:00
martin
2bec2479f8 Fix copy&pasto in handling of POSIX_SPAWN_RESETIDS in posix_spawn(3) 2021-05-02 10:23:55 +00:00