Commit Graph

286221 Commits

Author SHA1 Message Date
rillig
6941825e93 tests/lint: add test for message 247 for pointer to unnamed struct 2021-03-14 21:44:35 +00:00
rillig
8699d6553b tests/make: document today's bug fixes in the test 2021-03-14 20:41:39 +00:00
rillig
3042e42091 make: fix documentation of VarFreeEnv
No functional change.
2021-03-14 20:23:29 +00:00
rillig
259019554f make: skip variable lookup for '::=' modifiers in parse-only mode
This is just to keep the code consistent among the various variable
modifiers.  The performance gain is negligible.

The actual assignment to the variable had already been skipped
previously.

No functional change.
2021-03-14 20:18:33 +00:00
rillig
96491d26ea make: separate parsing and evaluating for modifier '::='
No functional change.
2021-03-14 20:12:16 +00:00
rillig
d4faf73862 make: in parse-only mode, do not update the expression value in ':sh'
No functional change outside debug mode.  The other variable modifiers
behave in the same way.
2021-03-14 20:09:26 +00:00
rillig
96faeb06ee make: do not evaluate the ':O' modifiers in parse-only mode
No functional change in practical usage.  Theoretically this change can
be observed by looking at the generated random numbers for the ':Ox'
modifier, but the quality or exact sequence of these random numbers is
not guaranteed anyway.
2021-03-14 20:03:56 +00:00
rillig
f7a4d3a3e0 make: separate parsing and evaluating in the ':O' modifiers
No functional change.
2021-03-14 20:00:48 +00:00
rillig
812ef981d6 make: do not evaluate modifier ':[...]' in parse-only mode
In parse-only mode, variable expressions in the argument to that
modifier are not resolved.  This led to the error message about the 'Bad
modifier' in var-eval-short.mk.
2021-03-14 19:29:37 +00:00
rillig
ef2d559187 make: do not evaluate modifiers ':M' and ':N' in parse-only mode
No functional change outside debug mode (-dv for ModifyWord_Match).
2021-03-14 19:25:05 +00:00
rillig
aaaf8460b3 make: do not return unevaluated 'else' part from the ':?' modifier
No functional change outside debug mode.
2021-03-14 19:21:28 +00:00
rillig
91f10d43f6 tests/make: add test for the ':?' modifier in parse-only mode
The debug output for this scenario will change a bit in an upcoming
commit, but that will not affect anything outside the debug log.
2021-03-14 19:16:41 +00:00
rillig
c8091d0b16 make: do not evaluate ':gmtime' and ':localtime' in parse-only mode
No functional change.
2021-03-14 18:30:24 +00:00
rillig
99e5bcf513 make: don't evaluate several simple modifiers in parse-only mode
This affects the modifiers ':E', ':H', ':P', ':Q', ':R', ':T', ':hash',
':q', ':range', ':tl', ':ts', ':tu', and ':u'.  All these modifiers are
side-effect free.

Skipping the evaluation for these modifiers is purely for code
consistency and performance.

No functional change.
2021-03-14 18:23:44 +00:00
rillig
a1837566a4 make: skip strdup when parsing an irrelevant ':L' modifier
No functional change.
2021-03-14 18:10:57 +00:00
rillig
ae0a762a50 make: skip memcpy when parsing but not evaluating ':D' and ':U'
No functional change, just a tiny bit of performance improvement,
probably not even measurable.  Having the code nevertheless serves as a
copy-and-paste template for implementing other modifiers that might
perform more costly tasks.
2021-03-14 18:08:25 +00:00
rillig
a1747f17a6 make: only evaluate the ':@' modifier if the result is actually used
The test 'var-eval-short' had produced the output 'unexpected' before,
on stderr.  It had been generated by '${:Uword:@${FAIL}@expr@}' by
combining the following obscure "features" of make:

1.  the ':@' modifier loops over the words of the variable.  This
    modifier is not really obscure, it still takes some time to get used
    to it.

2.  the ':@' modifier allows a '$' sign in the variable name, which is
    useless in practice.

3.  the ':@' modifier creates a temporary loop variable in the global
    namespace.  Luckily there are only few collisions with other
    variable names since their naming conventions differ.

4.  after looping over the words of the expression, the temporary global
    loop variable is deleted, and at that point the '$' is expanded,
    being interpreted as the start of a variable expression.

5.  The ':@' modifier deleted the global variable even when it was
    called in parse-only mode (without VARE_WANTRES).

When the modifier ':@' was initially added to make in var.c 1.40 from
2000-04-29, Var_Delete didn't expand the variable name.  That feature
was added in var.c 1.174 from 2013-05-18, probably without thinking of
this very edge-casey combination of features.

This commit fixes item 5 from the above list.  The other obscurities
remain for now.
2021-03-14 18:02:44 +00:00
rillig
9ac0661025 make: eliminate common subexpression in ApplyModifier_Remember
No functional change.
2021-03-14 17:38:24 +00:00
rillig
71128ca3aa make: merge duplicate code in ApplyModifier_Remember
This way, parsing and evaluating the modifier is only written once in
the code.  The downside is that the variable name is allocated even if
VARE_WANTRES is not set, but since this modifier is so obscure and
seldom used this doesn't matter in practice.
2021-03-14 17:34:50 +00:00
rillig
0fc517c113 make: do not expand the variable name in the ':_' modifier
This edge case had been so obscure that even discovering this takes
quite some time and requires reading the source code of make.

The manual page doesn't document whether the variable name is expanded
or not, it doesn't even give an example.  When this obscure modifier was
initially added in var.c 1.210 from 2017-01-30, Var_Set always expanded
the variable name once, and there was no way around it.  Therefore this
expansion has probably been unintentional.
2021-03-14 17:27:27 +00:00
rillig
a442584d73 tests/make: demonstrate unintended edge case for the ':_' modifier 2021-03-14 17:14:15 +00:00
rillig
d905f14720 tests/make: convert test for ':_' modifier to parse time 2021-03-14 17:07:11 +00:00
rillig
64a393d8af make: only evaluate the ':_' modifier if the expression is needed
See var-eval-short.mk:46 for the test demonstrating this change.
Previously, the expression ${:Uword:_=VAR} was evaluated including all
its side effects even though it was in an irrelevant branch of the
condition.
2021-03-14 16:43:30 +00:00
rillig
c361e1ef2f make: return failure in TryParseIntBase0 for empty string
No functional change since the only caller of TryParseIntBase0 already
handles all possible parse errors.  Without this check, the code just
looked wrong though.
2021-03-14 16:03:04 +00:00
rillig
f3e066bf1b make: add test for edge case in modifier ':[...]'
TryParseIntBase0 wrongly returns successful for a string that does not
start with a number at all.  Its only caller, ApplyModifier_Words,
already handles all error cases properly.

No functional change.
2021-03-14 16:00:07 +00:00
rillig
c9c8cb6d43 make: separate parsing from evaluating for several modifiers
This aligns the implementation of these modifiers with the requirements
in the long comment starting with 'The ApplyModifier functions'.

No functional change.
2021-03-14 15:43:31 +00:00
rillig
54f9178de3 make: reduce indentation in ApplyModifier_SunShell
No functional change.
2021-03-14 15:24:37 +00:00
rillig
5367d2f7c6 make: separate parsing and evaluating for modifier ':u'
No functional change.
2021-03-14 15:22:21 +00:00
rillig
a0706d9698 make: separate parsing and evaluating for modifiers ':Q' and ':q'
No functional change.
2021-03-14 15:19:15 +00:00
rillig
d74102acf0 make: extract duplicate code for parsing ':S' and ':C'
No functional change.
2021-03-14 15:15:28 +00:00
rillig
3e9e13f502 make: extract duplicate code for detecting a modifier's end
No functional change.
2021-03-14 15:06:19 +00:00
rillig
115656881d make: document how error handling should be done correctly
Right now, when a variable expression cannot be parsed, the result of
calling Var_Subst is a string containing garbage, and no error is
reported.  In addition, there are some silent errors that are not
reported at all.  This combination makes it difficult to change the
error handling without introducing subtle breakage in some edge cases.

An example for garbage output is in varmod-subst-regex.mk, in target
mod-regex-compile-error.

No functional change.
2021-03-14 15:04:13 +00:00
rin
8b206140eb Build rump for PPC_OEA64 on evbppc64. 2021-03-14 13:11:59 +00:00
rillig
63e8f1e660 tests/make: add test for short-circuit evaluation of modifiers 2021-03-14 11:49:37 +00:00
rillig
58e152bdc2 make: sort modifiers in ApplyModifier alphabetically
No functional change.
2021-03-14 11:15:37 +00:00
rillig
8902b05acf make: fix wrong expression evaluation in -dL mode
The modifier ':C' now only compiles the regular expression if the result
of the expression is actually needed.

Several other modifiers have the same bug of evaluating the expression
in cases where this is not needed.  It just doesn't show up because they
don't have any noticeable side effects, other than wasting CPU time.
This affects irrelevant conditions as well.
2021-03-14 10:57:12 +00:00
rillig
0ed436993c make: demonstrate wrong expression evaluation in -dL mode 2021-03-14 10:45:51 +00:00
skrll
4cfcc99482 Sprinkle kpreempt_{dis,en}able ready for when preemption gets turned on. 2021-03-14 10:36:46 +00:00
skrll
34ee086f83 Use fdtbus_intr_establish_xname 2021-03-14 08:16:57 +00:00
skrll
7fb67d6ed3 No need to have an MD #ifdef in an MI file, so remove it. 2021-03-14 08:13:58 +00:00
skrll
41a3438ddf Remoave an extra space from a comment 2021-03-14 08:10:23 +00:00
skrll
f4ee76b184 Remove an unnecessary if statement in gic_v2m_msi_alloc when finding a
'count' that fits the available.
2021-03-14 08:09:20 +00:00
rillig
de1cec24a0 indent: clean up check_size_comment
The additional parameter last_bl_ptr was only necessary because the last
blank was stored as a pointer into the buffer.  By storing the index in
the buffer instead, it doesn't need to be updated all the time.

No functional change.
2021-03-14 05:26:42 +00:00
rillig
a8e5d6abb4 indent: remove trailing whitespace 2021-03-14 04:52:10 +00:00
rillig
f21f69f749 indent: clean up target column computation in process_comment
No functional change.
2021-03-14 04:42:17 +00:00
rin
485b8b3cff Enable NFS_BOOT_UDP; on-board NIC seems to be too slow for overhead due to
NFS over TCP. Some scores of pkgsrc/benchmarks/bonnie improve nearly x2.
2021-03-14 03:35:39 +00:00
rin
eb13d3e4ac Fix DJMEMCMAX option for Quadra/Centris 650/800.
- Use jeq instead of jra for conditional branch.
- Use cmpl instead of cmp (= cmpw) for int variables.

Now, my Quadra 800 recognizes full 520MB memory!
2021-03-14 03:25:01 +00:00
rin
482f9a49eb Initialize dp->rd_cmap_{red,green,blue} in radeonfb_init_palette() for 8bpp,
so that color map can be obtained by WSDISPLAYIO_GETCMAP ioctl(2).

Now, mlterm-fb from pkgsrc/x11/mlterm works just fine on radeonfb(4).
2021-03-14 03:14:42 +00:00
rin
623d9b5490 Fix typo: s/--r/-r/ 2021-03-14 02:56:51 +00:00
rin
35a048da19 Document NFS_BOOT_UDP instead of NFS_BOOT_TCP; We've switched to
NFS over TCP by default.

Bump date.
2021-03-14 02:56:07 +00:00