Commit Graph

284443 Commits

Author SHA1 Message Date
rillig
4ba4b93100 lint: rename ename to enumeration_constant 2021-01-09 13:12:13 +00:00
rillig
16d75acecd lint: align grammar rules with C99 2021-01-09 03:28:47 +00:00
rillig
1119ffe1ba lint: expand abbreviations in grammar rules
stmnt -> statement
comp -> compound

The abbreviation "stmnt" was non-standard, and "comp" was ambiguous
since it is used for "comparison" as well.
2021-01-09 03:08:54 +00:00
uki
1c2777d6b9 Fix "build.sh syspkgs" build error 2021-01-09 02:40:44 +00:00
rillig
e8115594bd lint: rename T_MULT to T_ASTERISK
In the early phase of lexical analysis, the '*' does not mean
multiplication, therefore its name should not suggest that.  It is only
an asterisk, and depending on the surrounding context, it will only
later turn into a pointer dereference or a multiplication.

The call operator(T_MULT, MULT) was misleading since the MULT was not
used at all.
2021-01-09 02:38:27 +00:00
sjg
336a7b2bd2 Ensure PrintOnError always reports 'stopped in' on first call.
We may still suppress the rest of the noise if shouldDieQuietly
says to, but the 'stopped in' output is too important to lose.
Avoid repeating it though in the same process.

For the case of aborting due to failure detected elsewhere,
exit 6 so we have a clue.

PR: 55578
Reviewed by:
2021-01-08 21:46:50 +00:00
rillig
af03d2a051 lint: add tests for several messages 2021-01-08 21:25:03 +00:00
christos
6fceff0a4e - Don't allocate memory dynamically on the stack (for SSP)
- Don't return errno as exit code
- Fold long lines
2021-01-08 15:16:04 +00:00
uki
4670c4d50e Rename man-util-* to comp-c-* 2021-01-08 09:41:24 +00:00
sjg
7b0d20a9e4 Set wantToken when none available.
PR: 53285
Reviewed by: gson
2021-01-08 04:36:44 +00:00
rillig
dbe5d068b4 lint: fix function as controlling expression (since 2020-12-31)
It's perfectly valid to directly use a function name as the controlling
expression of an if statement.  That function name is converted
implicitly to a pointer to that function, and that is a scalar value
then.

Spotted by christos in lib/libpthread/pthread.c:634.
2021-01-08 02:11:45 +00:00
rillig
91017b3441 lint: demonstrate wrong message 204 (since 2020-12-31)
In func.c 1.39 from 2020-12-31 18:51:28, the check that controlling
expressions are indeed scalar was extended from while and for loops to
if statements as well.  It just seemed to have been an oversight.

This revealed a bug in lint, which didn't accept the following valid
code snippet from lib/libpthread/pthread.c:634:

	void _malloc_thread_cleanup(void) __weak;
	...
	if (_malloc_thread_cleanup)
		_malloc_thread_cleanup();

Testing a function (instead of a function pointer) for truthiness is
probably rare since most functions are defined unconditionally.  For
weak functions it comes in handy though.

Clang-Tidy suggests to prefix the function with '&' to silence its
warning.  Doing that revealed a non-obvious behavior in build_ampersand,
which does not add the AMPER node to the expression even though it is
clearly mentioned in the code.  That is left for further research.

Once the original bug is fixed, it probably doesn't matter whether the
AMPER is discarded or retained since check_controlling_expression would
add it back.  There's probably a reason though to sometimes discard the
AMPER and sometimes retain it.
2021-01-08 01:40:03 +00:00
uwe
8069f9bdc8 bc(1): Consistently use "parentheses" in plural. 2021-01-08 01:17:55 +00:00
uwe
ed2762c7cc bc(1): Prettify PostScript output some more.
Don't set BNF in all bold .Ic, instead use .Ar for "expr" and "var" so
that only the literal stuff that is being defined is bold.  Arrange
for subscripts to actually be subscripted in PostScript.  Make sure
meta-syntactic [] are set differently than literal (). Etc...
2021-01-08 01:17:03 +00:00
macallan
733b7a159f shut up a clang warning about snprintf() called with a variable as format
string
NFCI
2021-01-08 00:13:20 +00:00
uwe
21e98dc7f4 bc(1): Replace one last missed \f with semantic markup. 2021-01-07 23:57:25 +00:00
uwe
d36d23f262 bc(1): Use more .Ql, misc related fixes. 2021-01-07 21:21:35 +00:00
uwe
8659a71dd2 bc(1): Use .Fn and .Fa for functions and their arguments. 2021-01-07 20:37:33 +00:00
uwe
ac2e48a91d bc(1): Indent displays with code examples. 2021-01-07 20:22:34 +00:00
uwe
55e91dd140 bc(1): Misc fixes in the DIFFERENCES section.
Make "last" an item, as intended.
Make operators literal.
2021-01-07 20:12:59 +00:00
uwe
f308096576 bc(1): small mdoc fixes to improve PostScript output.
The length/scale example at the beginning is not all literal.
Fix remaining "quoted" words to use .Dq
Fix a few small inline code snippets to be literal.
2021-01-07 19:49:13 +00:00
rillig
09a916ab1d lint: revert test for message 11
That test only produced other messages, but not message 11.
2021-01-07 19:11:58 +00:00
rillig
d8ecd506c6 lint: add tests for some messages 2021-01-07 18:37:41 +00:00
sjg
3abd1687f2 Remove .MAKE from nested target which is not a sub-make
This does not fix the issue, just makes the unit-test more accurate.

PR: 55578
Reviewed by: rillig
2021-01-07 18:11:23 +00:00
skrll
73ce770b75 Fix build for non-_MIPS_NEED_BUS_DMA_BOUNCE platforms 2021-01-07 17:28:20 +00:00
joerg
7c219dd6db Optimize nbperf
- add fudge mode which gives a slightly slower hash function, but works
  almost always in the first iteration by avoiding degenerate edges
- avoid keeping incidence lists around reducing the memory foot print by
  30%
- split edge processing from hashing as in the non-fudge case it is a
  reasonable costly part that often gets thrown away
- merge graph2 and graph3 routines now that they are mostly the same
2021-01-07 16:03:08 +00:00
joerg
bb682c3920 Optimize CPU and memory use of cdbw(3)
Reduce memory footprint and processing time by dropping the vertex parts
of the edges kept during the peeling. Hook up the
division-by-multiplication logic to help older platforms.
2021-01-07 14:41:50 +00:00
skrll
6bcc22484e More converstion from usbd_status to int for function error reporting.
This time it's the turn of usb_allocmem.

(missed in previous commit)
2021-01-07 13:25:51 +00:00
lukem
0de2ffcfac progress: handle EINTR in writes. PR/55914 2021-01-07 12:02:52 +00:00
nakayama
268efe53aa The "available" property requires a variable length buffer, so
leave free(9) until prom_getprop is changed to use kmem_alloc(9)
instead of malloc(9).
2021-01-07 07:40:39 +00:00
rillig
7d8d33cba8 lint: add tests for messages 93, 94, 95, 96, 97, 98, 99 2021-01-07 00:38:46 +00:00
ginsbach
4b5ddda496 df: bump man page date 2021-01-06 20:38:09 +00:00
palle
d4df58243d psycho: explicit allocation of memory using kmem(9) instead of using the buffer indirectly allocted in the prom_getprop() function (which is still using malloc(9) for memory allocation 2021-01-06 20:04:30 +00:00
wiz
2e256d9d5b Simplify macro usage. 2021-01-06 18:05:58 +00:00
pgoyette
386ae5b46e Grammar fix for the grammer fix. Plural subject needs plural verb. :) 2021-01-06 17:22:36 +00:00
kre
f9167198aa Minor grammar fix, more markup, and update date (Dd). 2021-01-06 17:13:23 +00:00
wiz
f77ed54857 Add some paragraph breaks. 2021-01-06 14:07:43 +00:00
jandberg
b614bd0aac Implement the WSDISPLAYIO_GET_FBINFO ioctl, needed by X wsfb driver. 2021-01-06 13:00:51 +00:00
wiz
99fedf3d5f Markup improvements and typo fixes. 2021-01-06 10:19:27 +00:00
rillig
1aa2d3570d lint: fix test for message 324 on i386
i386 is an ILP32 platform (arch/i386/targparam.h).  On these platforms,
int and long have the same size, and even with the -p option for
portability checks, INT_RSIZE in inittyp.c is defined to 4, not 3.

Because of this, in check_integer_conversion, psize(nt) was not greater
than psize(ot), and the warning was not issued.

To make the test behave the same on all platforms, changed the long
variables to long long, since long long is 64-bit on all platforms, and
int is 32-bit.
2021-01-06 09:23:04 +00:00
lukem
5650392b38 ftp(1): fix description of "debug"
"debug" command and documentation got accidentally renamed
to "ftp_debug" 13 years ago, and was only partially fixed.
2021-01-06 09:15:59 +00:00
rin
7f00a9aa4e Drop unused headers. No functional changes intended. 2021-01-06 08:17:46 +00:00
rin
a07603df51 Switch DDB for powerpc/booke into SOFTWARE_SSTEP.
SR_SINGLESTEP aka PSL_SE bit in MSR is only available for oea, and HW
debug facilities for booke are significantly different from oea.
2021-01-06 08:14:34 +00:00
rin
04d12c4699 Sort headers. No functional changes intended. 2021-01-06 08:07:36 +00:00
rin
c0ef0c79a0 Sort headers. Also, use <ddb/ddb.h> instead of db_interface.h and
db_machdep.h in order not to be bothered by subtle include order.

No functional changes intended.
2021-01-06 08:04:57 +00:00
rin
8ef35a2e18 Fix pmap_procwr() for powerpc/booke:
- Use PAGE_MASK, not PAGE_SIZE, to calculate page offset.
- Do not drop page offset of target address.
2021-01-06 07:56:19 +00:00
lukem
920389c199 ftp: don't use restartable signals
Refactor to not rely upon restartable signals (SA_RESTART),
possibly fixing intermittent failures with -q QUITTIME.

ftp transfers: handle EINTR/EAGAIN in copy_bytes(),
instead of relying upon restartable signals.

http/https transfers: Explicitly print an error similar to
progressmeter() when timing-out for -Q QUITTIME in fetch_wait(),
and set errno to ETIMEDOUT so that the warn() in fetch_url()
prints a more accurate error message.

PR/55857
2021-01-06 04:43:14 +00:00
rillig
bd9b719c88 lint: clean up generation of the operator tables
Instead of running a shell program that runs an AWK program that
generates the two files ops.c and ops.h, just define the operator tables
once in ops.def and use these definitions flexibly in ops.c and op.h.
2021-01-05 23:50:29 +00:00
rillig
15275571de lint: remove redundant symbolic operator names
These symbolic names for INCBEF, INCAFT, DECBEF and DECAFT were
non-standard and thus confusing.  All other operators were as expected.
Now that the operator names from ops.def are very similar, there is no
need to keep to almost identical lists around.

No change to the user-visible messages since the only place where these
operator names were used was in 324, and that message was restricted to
PLUS, MINUS, MULT and SHL.
2021-01-05 23:20:53 +00:00
rillig
b8104292aa lint: clean up symbolic operator names that are used in the messages
Including the "p" in the symbolic operator names was questionable, for
several reasons:

1.  The "p" could be taken to mean an actual variable name, which is
    confusing if the function doesn't have such a variable, or even more
    so if the line contains an unrelated variable called "p".

2.  For the binary operators, having the "p" mentioned on both sides of
    the operator (such as in "p + p") wrongly suggested that both
    operands of the expression were the same.

3.  The name "p" often stands for a pointer.  Most of the operators
    don't accept pointers, therefore the name was misleading.

For these reasons, the "p" was removed from the symbolic name of all
operators.  This makes several pairs of operators indistinguishable:

    INCBEF == INCAFT
    DECBEF == DECAFT
    UPLUS == PLUS
    UMINUS == MINUS
    STAR == MULT
    AMPER == AND

This is not expected to create any confusion since C programmers are
expected to know these double meanings.

The symbolic names for SHLASS and SHRASS were missing the '=' before.
This was added since omitting it was probably an oversight.
2021-01-05 23:07:49 +00:00