CVS log for src/usr.bin/make/var.c
Up to [cvs.NetBSD.org] / src / usr.bin / make
Request diff between arbitrary revisions
Keyword substitution: kv
Default branch: MAIN
Revision 1.1141: download - view: text, markup, annotated - select for diffs
Sat Nov 23 22:59:51 2024 UTC (2 weeks, 4 days ago) by rillig
Branches: MAIN
CVS tags: HEAD
Diff to: previous 1.1140: preferred, colored
Changes since revision 1.1140: +10 -3
lines
make: fix confusing error message when overriding a read-only variable
Revision 1.1140: download - view: text, markup, annotated - select for diffs
Sat Aug 31 06:21:27 2024 UTC (3 months, 1 week ago) by rillig
Branches: MAIN
Diff to: previous 1.1139: preferred, colored
Changes since revision 1.1139: +9 -16
lines
make: simplify printing of an evaluation stack element
Revision 1.1139: download - view: text, markup, annotated - select for diffs
Thu Aug 29 20:20:35 2024 UTC (3 months, 1 week ago) by rillig
Branches: MAIN
Diff to: previous 1.1138: preferred, colored
Changes since revision 1.1138: +10 -11
lines
make: reduce line length in error messages
The error messages for deeply nested parse errors were hard to decipher,
due to the large amount of text. Split these messages into individual
lines, just as in the backtrace for .include files and .for loops. This
unified backtrace makes the output more uniform.
Revision 1.1138: download - view: text, markup, annotated - select for diffs
Tue Aug 27 04:52:14 2024 UTC (3 months, 2 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.1137: preferred, colored
Changes since revision 1.1137: +7 -10
lines
make: treat recursive variables non-fatally
A recursive variable is no worse than an unknown modifier, so treat them
in the same way by continuing parsing until the end of the makefile.
Revision 1.1137: download - view: text, markup, annotated - select for diffs
Sun Aug 25 20:44:31 2024 UTC (3 months, 2 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.1136: preferred, colored
Changes since revision 1.1136: +9 -3
lines
make: add more context to error message about recursive variables
Revision 1.1136: download - view: text, markup, annotated - select for diffs
Sat Jul 20 08:54:19 2024 UTC (4 months, 3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.1135: preferred, colored
Changes since revision 1.1135: +6 -34
lines
make: remove wrong error message about an undefined variable
Revision 1.1135: download - view: text, markup, annotated - select for diffs
Tue Jul 9 17:07:23 2024 UTC (5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1134: preferred, colored
Changes since revision 1.1134: +3 -3
lines
make: error out on syntax errors in ':M' and ':N' modifiers
More than a year ago, the warning has been added. Now it has been
promoted to an error.
Revision 1.1134: download - view: text, markup, annotated - select for diffs
Sun Jul 7 09:54:12 2024 UTC (5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1133: preferred, colored
Changes since revision 1.1133: +2 -22
lines
make: move initialization of variable scopes to targ.c
The variable scopes are freed by Targ_End, so initialize them there as
well. Separate printing statistics and freeing memory, which makes
Var_End unnecessary.
Revision 1.1133: download - view: text, markup, annotated - select for diffs
Fri Jul 5 20:01:52 2024 UTC (5 months, 1 week ago) by rillig
Branches: MAIN
Diff to: previous 1.1132: preferred, colored
Changes since revision 1.1132: +8 -4
lines
make: in error messages, distinguish parsing from evaluating
Revision 1.1132: download - view: text, markup, annotated - select for diffs
Fri Jul 5 19:47:22 2024 UTC (5 months, 1 week ago) by rillig
Branches: MAIN
Diff to: previous 1.1131: preferred, colored
Changes since revision 1.1131: +7 -5
lines
make: in error messages for anonymous variables, log the value
Revision 1.1131: download - view: text, markup, annotated - select for diffs
Fri Jul 5 18:59:33 2024 UTC (5 months, 1 week ago) by rillig
Branches: MAIN
Diff to: previous 1.1130: preferred, colored
Changes since revision 1.1130: +11 -13
lines
make: error out on unclosed expressions during parse time
In exchange, this adds location information.
For unnamed expressions, the value is no longer printed. This will be
added back in a follow-up commit.
Revision 1.1130: download - view: text, markup, annotated - select for diffs
Fri Jul 5 05:11:25 2024 UTC (5 months, 1 week ago) by rillig
Branches: MAIN
Diff to: previous 1.1129: preferred, colored
Changes since revision 1.1129: +2 -8
lines
make: reduce lint-specific comments about ARGSUSED
Revision 1.1129: download - view: text, markup, annotated - select for diffs
Thu Jul 4 18:53:37 2024 UTC (5 months, 1 week ago) by rillig
Branches: MAIN
Diff to: previous 1.1128: preferred, colored
Changes since revision 1.1128: +7 -9
lines
make: error out on the "Bad modifier" error message
Previously, the "Bad modifier" error message did not affect make's exit
status. As a side effect, this kind of error now gets more context
information.
Revision 1.1128: download - view: text, markup, annotated - select for diffs
Thu Jul 4 17:47:53 2024 UTC (5 months, 1 week ago) by rillig
Branches: MAIN
Diff to: previous 1.1127: preferred, colored
Changes since revision 1.1127: +12 -6
lines
make: add more context information to error messages
In case of a parse error or evaluation error, print the variable value
in addition to the variable name, to see the effects of previous
expression modifiers.
In nested make calls, print the current directory at the bottom of a
stack trace, as that information is otherwise hard to get in a parallel
build spanning multiple directories.
Revision 1.1127: download - view: text, markup, annotated - select for diffs
Tue Jul 2 20:10:45 2024 UTC (5 months, 1 week ago) by rillig
Branches: MAIN
Diff to: previous 1.1126: preferred, colored
Changes since revision 1.1126: +3 -3
lines
make: trim trailing whitespace
Revision 1.1126: download - view: text, markup, annotated - select for diffs
Mon Jul 1 21:02:26 2024 UTC (5 months, 1 week ago) by sjg
Branches: MAIN
Diff to: previous 1.1125: preferred, colored
Changes since revision 1.1125: +24 -2
lines
make: add :tc to capitalize first letter of each word
This is very hard to do without :tc
Reviewed by: rillig
Revision 1.1121.2.1: download - view: text, markup, annotated - select for diffs
Mon Jul 1 01:01:15 2024 UTC (5 months, 1 week ago) by perseant
Branches: perseant-exfatfs
Diff to: previous 1.1121: preferred, colored; next MAIN 1.1122: preferred, colored
Changes since revision 1.1121: +31 -22
lines
Sync with HEAD.
Revision 1.1125: download - view: text, markup, annotated - select for diffs
Sun Jun 30 15:21:23 2024 UTC (5 months, 1 week ago) by rillig
Branches: MAIN
CVS tags: perseant-exfatfs-base-20240630
Diff to: previous 1.1124: preferred, colored
Changes since revision 1.1124: +10 -8
lines
make: error out on some more syntax errors
Previously, these errors only produced a message on stderr. They only
affected make's exit status when they were evaluated at parse time, but
not when evaluating the commands for a specific target right before
executing them.
The affected syntax errors are:
* invalid regular expressions in the ':C' modifier
* out-of-range references to regex groups in the ':C' modifier
* unfinished modifiers
Revision 1.1124: download - view: text, markup, annotated - select for diffs
Sun Jun 30 13:01:01 2024 UTC (5 months, 1 week ago) by rillig
Branches: MAIN
Diff to: previous 1.1123: preferred, colored
Changes since revision 1.1123: +20 -12
lines
make: error out on syntax error in conditions in ':?then:else' modifier
The 'Error' function only reports errors but does not affect the exit
status, the 'Parse_Error' function does, while providing more details to
find the cause of the syntax error.
Revision 1.1123: download - view: text, markup, annotated - select for diffs
Sun Jun 30 11:44:14 2024 UTC (5 months, 1 week ago) by rillig
Branches: MAIN
Diff to: previous 1.1122: preferred, colored
Changes since revision 1.1122: +3 -3
lines
make: sync error handling between '!=' assignment and '::!=' modifier
Revision 1.1122: download - view: text, markup, annotated - select for diffs
Sun Jun 30 11:00:06 2024 UTC (5 months, 1 week ago) by rillig
Branches: MAIN
Diff to: previous 1.1121: preferred, colored
Changes since revision 1.1121: +4 -5
lines
make: add more context to "returned non-zero status" message
Previously, this message was an "error" but had no influence on the exit
status, so make it a warning instead. In the seldom used -W mode that
treats warnings as errors, this change influences the exit status.
Revision 1.1121: download - view: text, markup, annotated - select for diffs
Sat Jun 15 22:06:30 2024 UTC (5 months, 3 weeks ago) by rillig
Branches: MAIN
CVS tags: perseant-exfatfs-base
Branch point for: perseant-exfatfs
Diff to: previous 1.1120: preferred, colored
Changes since revision 1.1120: +27 -3
lines
make: error out if an internal read-only variable is overwritten
The affected variables are:
* .newline
* .MAKE.OS
* .MAKE.JOBS.C
* .MAKE.LEVEL.ENV
* .MAKE.PID
* .MAKE.PPID
* .MAKE.UID
* .MAKE.GID
This change does not affect the .SHELL and .SUFFIXES variables, as well
as variables that are manually turned read-only by the special .READONLY
target.
Revision 1.1120: download - view: text, markup, annotated - select for diffs
Sat Jun 15 20:02:45 2024 UTC (5 months, 3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.1119: preferred, colored
Changes since revision 1.1119: +33 -28
lines
make: clean up collection of context information for error messages
Revision 1.1119: download - view: text, markup, annotated - select for diffs
Sun Jun 2 15:31:26 2024 UTC (6 months, 1 week ago) by rillig
Branches: MAIN
Diff to: previous 1.1118: preferred, colored
Changes since revision 1.1118: +36 -36
lines
make: sync VarEvalMode constant names with their debug log names
Revision 1.1118: download - view: text, markup, annotated - select for diffs
Sun Jun 2 11:25:03 2024 UTC (6 months, 1 week ago) by rillig
Branches: MAIN
Diff to: previous 1.1117: preferred, colored
Changes since revision 1.1117: +3 -3
lines
make: fix out-of-bounds read when parsing indirect modifiers
Revision 1.1117: download - view: text, markup, annotated - select for diffs
Sat Jun 1 06:26:36 2024 UTC (6 months, 1 week ago) by sjg
Branches: MAIN
Diff to: previous 1.1116: preferred, colored
Changes since revision 1.1116: +6 -3
lines
make: add .export-all
An explicit syntax for exporting all global variables is much safer
than allowing .export with no argument to do the same.
Add .export-all and have .export with no argument throw a warning saying
to use .export-all
Reviewed by: rillig
Revision 1.1116: download - view: text, markup, annotated - select for diffs
Sat Jun 1 05:08:48 2024 UTC (6 months, 1 week ago) by rillig
Branches: MAIN
Diff to: previous 1.1115: preferred, colored
Changes since revision 1.1115: +4 -10
lines
make: remove unused VARE_EVAL_KEEP_DOLLAR
Revision 1.1115: download - view: text, markup, annotated - select for diffs
Fri May 31 20:21:34 2024 UTC (6 months, 1 week ago) by rillig
Branches: MAIN
Diff to: previous 1.1114: preferred, colored
Changes since revision 1.1114: +48 -61
lines
make: merge functions that parse modifier parts
This commit subtly changes the behavior for the :gmtime and :localtime
modifiers, but only in irrelevant cases since the time value must be an
integer, and neither '\' nor ':' nor '$' may occur in these values.
Revision 1.1114: download - view: text, markup, annotated - select for diffs
Fri May 31 05:50:11 2024 UTC (6 months, 1 week ago) by rillig
Branches: MAIN
Diff to: previous 1.1113: preferred, colored
Changes since revision 1.1113: +5 -5
lines
make: clean up API for iterating over hash tables
Revision 1.1113: download - view: text, markup, annotated - select for diffs
Thu May 30 21:50:34 2024 UTC (6 months, 1 week ago) by rillig
Branches: MAIN
Diff to: previous 1.1112: preferred, colored
Changes since revision 1.1112: +8 -9
lines
make: don't log anything when freeing memory
Revision 1.1112: download - view: text, markup, annotated - select for diffs
Sat May 25 08:03:19 2024 UTC (6 months, 2 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.1111: preferred, colored
Changes since revision 1.1111: +8 -4
lines
make: fix some more memory leaks
Revision 1.1111: download - view: text, markup, annotated - select for diffs
Sat May 25 00:00:25 2024 UTC (6 months, 2 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.1110: preferred, colored
Changes since revision 1.1110: +18 -23
lines
make: fix a few more memory leaks
Revision 1.1110: download - view: text, markup, annotated - select for diffs
Fri May 24 23:02:46 2024 UTC (6 months, 2 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.1109: preferred, colored
Changes since revision 1.1109: +23 -2
lines
make: in -DCLEANUP mode, free variables and their values
The variables in the 3 scopes must be freed before the scopes themselves
are freed by Targ_End.
The test opt-m-include-dir creates a directory of the form '*.tmp', thus
it must be removed before attempting to only remove regular files of
this name.
POSIX requires setenv to copy the passed name and value, so there is no
need to keep that memory allocated any longer.
Revision 1.1109: download - view: text, markup, annotated - select for diffs
Tue May 7 18:26:22 2024 UTC (7 months ago) by sjg
Branches: MAIN
Diff to: previous 1.1108: preferred, colored
Changes since revision 1.1108: +7 -10
lines
make: all command line overrides go in .MAKEOVERRIDES
Not all variables that start with '.' are internals,
and unless they are explicitly flagged as internal should go
into .MAKEOVERRIDES
Update varname-dot-makeoverrides to check this.
Also avoid using SCOPE_CMDLINE when ReadOnly will do.
Revision 1.1108: download - view: text, markup, annotated - select for diffs
Sun Apr 28 15:10:19 2024 UTC (7 months, 2 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.1107: preferred, colored
Changes since revision 1.1107: +3 -3
lines
make: don't reallocate memory after evaluating an expression
When an expression is evaluated, the resulting text is short-lived in
almost all cases. In particular, the compaction neither affects the
target names nor the global variable values, which are the prime
candidates for permanent memory usage.
Revision 1.1107: download - view: text, markup, annotated - select for diffs
Sat Apr 27 21:26:23 2024 UTC (7 months, 2 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.1106: preferred, colored
Changes since revision 1.1106: +3 -3
lines
make: fix comment about forcing a use-after-free
The previous expression didn't cause any bug, as the modifier
':@VAR@loop@' changed the value of the expression, thus making the
expression independent from the variable value.
Instead, the variable needs to be deleted from within an indirect
modifier, and that modifier needs to evaluate to an empty string, thus
doing nothing and preserving the original expression value.
Revision 1.1106: download - view: text, markup, annotated - select for diffs
Sat Apr 27 20:41:32 2024 UTC (7 months, 2 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.1105: preferred, colored
Changes since revision 1.1105: +13 -20
lines
make: clean up, test .NOPATH
Trim down the comments in the archive module, as they mainly repeated
the code. Trim down the binary code size in the archive module, as it
is rarely used.
In Var_Parse, delay two variable assignments until they are actually
needed.
Revision 1.1105: download - view: text, markup, annotated - select for diffs
Tue Apr 23 22:51:28 2024 UTC (7 months, 2 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.1104: preferred, colored
Changes since revision 1.1104: +15 -23
lines
make: clean up comments, code and tests
Revision 1.1104: download - view: text, markup, annotated - select for diffs
Sun Apr 21 21:59:48 2024 UTC (7 months, 3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.1103: preferred, colored
Changes since revision 1.1103: +9 -28
lines
make: trim down code for parsing the :gmtime and :localtime modifiers
The :gmtime and :localtime modifiers are not used often and thus are not
time-critical. Exchange the custom code that parses an integer from a
substring for an additional memory allocation.
Thanks sjg@ for suggesting to avoid the custom parsing code.
Revision 1.1103: download - view: text, markup, annotated - select for diffs
Sun Apr 21 08:56:49 2024 UTC (7 months, 3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.1102: preferred, colored
Changes since revision 1.1102: +23 -4
lines
make: fix out-of-bounds read when evaluating :gmtime and :localtime
The function TryParseTime takes a pointer to a string, but the LazyBuf
returns a Substring, which is not guaranteed to be null-terminated or
delimited. In TryParseTime, calling strtoul on the Substring read past
the end of the substring.
Noticed in the NetBSD build in libntp, where the :gmtime modifier is
used in two places with the same timestamp value, of which the first was
evaluated correctly and the second wasn't.
The bug was introduced in var.c 1.1050 from 2023-05-09, when the
argument of the :gmtime and :localtime modifiers was allowed to be an
expression instead of an integer constant.
Revision 1.1102: download - view: text, markup, annotated - select for diffs
Sat Apr 20 10:18:55 2024 UTC (7 months, 3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.1101: preferred, colored
Changes since revision 1.1101: +74 -4
lines
make: provide more context information for parse/evaluate errors
Revision 1.1101: download - view: text, markup, annotated - select for diffs
Fri Mar 1 17:53:30 2024 UTC (9 months, 1 week ago) by rillig
Branches: MAIN
Diff to: previous 1.1100: preferred, colored
Changes since revision 1.1100: +4 -4
lines
make: fix type mismatch in lint's strict bool mode (since today)
Revision 1.1100: download - view: text, markup, annotated - select for diffs
Fri Mar 1 16:41:42 2024 UTC (9 months, 1 week ago) by sjg
Branches: MAIN
Diff to: previous 1.1099: preferred, colored
Changes since revision 1.1099: +20 -12
lines
make: export target scope values
Pass target scope to Var_ReexportVars so that a target process
will see the correct values in its env.
We must then mark any Global scope variable as unexported
so targets without local value get the Global one.
Revision 1.1099: download - view: text, markup, annotated - select for diffs
Wed Feb 7 06:43:02 2024 UTC (10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1098: preferred, colored
Changes since revision 1.1098: +2 -22
lines
make: remove unneeded conditional-compilation toggles
The toggles INCLUDES, LIBRARIES, POSIX, SYSVINCLUDE, SYSVVARSUB,
GMAKEEXPORT and SUNSHCMD are no longer needed, they were unconditionally
set.
The toggle NO_REGEX was configurable from the command line, but
disabling it would result in various error messages about the unknown
':C' modifier.
OK sjg@.
Revision 1.1098: download - view: text, markup, annotated - select for diffs
Sun Feb 4 10:03:10 2024 UTC (10 months, 1 week ago) by rillig
Branches: MAIN
Diff to: previous 1.1097: preferred, colored
Changes since revision 1.1097: +3 -3
lines
make: do not evaluate indirect modifiers in parse-only mode
Discovered by sjg.
Revision 1.1097: download - view: text, markup, annotated - select for diffs
Sun Feb 4 09:56:24 2024 UTC (10 months, 1 week ago) by rillig
Branches: MAIN
Diff to: previous 1.1096: preferred, colored
Changes since revision 1.1096: +7 -6
lines
make: in parse-only mode, don't evaluate modifiers
Previously, the ':S', ':ts', ':tA' and ':from=to' modifiers were
evaluated in parse-only mode, unnecessarily. This is only noticeable
when an indirect modifier is evaluated in parse-only mode, which is
another bug that will be fixed in a follow-up commit.
Revision 1.1096: download - view: text, markup, annotated - select for diffs
Sat Feb 3 00:20:23 2024 UTC (10 months, 1 week ago) by sjg
Branches: MAIN
Diff to: previous 1.1095: preferred, colored
Changes since revision 1.1095: +4 -4
lines
make: state of save_dollars affects what is a parse error
When save_dollars is false it is not a parse error to
encounter $$ rather than \$.
Revision 1.1095: download - view: text, markup, annotated - select for diffs
Sun Jan 21 15:02:17 2024 UTC (10 months, 3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.1094: preferred, colored
Changes since revision 1.1094: +3 -3
lines
make: clean up redundant 'const' from automatic variables
No binary change.
Revision 1.1094: download - view: text, markup, annotated - select for diffs
Sun Jan 7 11:39:04 2024 UTC (11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1093: preferred, colored
Changes since revision 1.1093: +15 -15
lines
make: clean up comments, constify shell name
Revision 1.1093: download - view: text, markup, annotated - select for diffs
Fri Jan 5 23:22:06 2024 UTC (11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1092: preferred, colored
Changes since revision 1.1092: +9 -11
lines
make: miscellaneous cleanups
Revision 1.1092: download - view: text, markup, annotated - select for diffs
Fri Jan 5 21:56:55 2024 UTC (11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1091: preferred, colored
Changes since revision 1.1091: +4 -4
lines
make: clean up string functions
No binary change.
Revision 1.1091: download - view: text, markup, annotated - select for diffs
Fri Jan 5 21:51:27 2024 UTC (11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1090: preferred, colored
Changes since revision 1.1090: +4 -3
lines
make: inline Substring_Sub
Remove redundant assertions.
Revision 1.1090: download - view: text, markup, annotated - select for diffs
Fri Dec 29 14:57:00 2023 UTC (11 months, 2 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.1089: preferred, colored
Changes since revision 1.1089: +4 -5
lines
make: simplify debug message for the ':@var@...@' modifier
The previous variant was hard to understand.
Revision 1.1089: download - view: text, markup, annotated - select for diffs
Fri Dec 29 13:25:15 2023 UTC (11 months, 2 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.1088: preferred, colored
Changes since revision 1.1088: +19 -35
lines
make: clean up variable handling
All variables from the command line scope have the fromCmd flag set, so
there is no need to check for it.
Inline redundant local variables.
Variables from a scope cannot be short-lived, so there is no need to
call VarFreeShortLived.
No functional change.
Revision 1.1088: download - view: text, markup, annotated - select for diffs
Fri Dec 29 12:59:43 2023 UTC (11 months, 2 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.1087: preferred, colored
Changes since revision 1.1087: +17 -83
lines
make: clean up comments
No binary change, except for line numbers in assertions.
Revision 1.1087: download - view: text, markup, annotated - select for diffs
Fri Dec 29 12:20:55 2023 UTC (11 months, 2 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.1086: preferred, colored
Changes since revision 1.1086: +3 -3
lines
make: simplify memory allocation for string buffers
In edge cases and short-lived buffers, the initial buffer size is
irrelevant, so use the default.
No functional change.
Revision 1.1086: download - view: text, markup, annotated - select for diffs
Wed Dec 20 09:03:08 2023 UTC (11 months, 3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.1085: preferred, colored
Changes since revision 1.1085: +21 -17
lines
make: use consistent debug messages style when ignoring variables
When a variable is not modified or not deleted, clearly say so and state
the reason. Use the same style of debug messages everywhere, putting
the word 'ignoring' at the front. Previously, that word sticked out to
the right, but only in some cases.
Revision 1.1085: download - view: text, markup, annotated - select for diffs
Wed Dec 20 08:50:10 2023 UTC (11 months, 3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.1084: preferred, colored
Changes since revision 1.1084: +5 -5
lines
make: fix confusing debug logging when deleting a variable
Be clear when deleting a variable is ignored and state the reason,
instead of only providing a keyword as a hint for insiders.
Revision 1.1084: download - view: text, markup, annotated - select for diffs
Tue Dec 19 19:33:39 2023 UTC (11 months, 3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.1083: preferred, colored
Changes since revision 1.1083: +3 -7
lines
make: clean up comments
No binary change, except for line numbers in assertions.
Revision 1.1083: download - view: text, markup, annotated - select for diffs
Sun Dec 17 08:53:55 2023 UTC (11 months, 3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.1082: preferred, colored
Changes since revision 1.1082: +16 -16
lines
make: clean up names of local variables
No binary change.
Revision 1.1082: download - view: text, markup, annotated - select for diffs
Sun Dec 10 20:17:23 2023 UTC (12 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1081: preferred, colored
Changes since revision 1.1081: +5 -3
lines
make: explain in the debug log why a variable assignment is ignored
Revision 1.1081: download - view: text, markup, annotated - select for diffs
Sun Dec 10 20:12:28 2023 UTC (12 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1080: preferred, colored
Changes since revision 1.1080: +4 -4
lines
make: remove redundant text from diagnostic about bad '?:' modifier
Revision 1.1080: download - view: text, markup, annotated - select for diffs
Sun Dec 10 20:03:30 2023 UTC (12 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1079: preferred, colored
Changes since revision 1.1079: +9 -18
lines
make: clean up the check for command line variables
It looked suspicious that to check whether a variable was set via the
command line, the variable value would be needed. Moving the debug
diagnostic to the calling function resolved this smell.
A variable from the command line scope is never short-lived, so there's
no need to clean up after accessing the variable.
No functional change.
Revision 1.1079: download - view: text, markup, annotated - select for diffs
Sun Dec 10 19:56:53 2023 UTC (12 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1078: preferred, colored
Changes since revision 1.1078: +54 -67
lines
make: clean up comments and local identifiers
No binary change, except for line numbers in assertions.
Revision 1.1078: download - view: text, markup, annotated - select for diffs
Sun Dec 10 18:59:50 2023 UTC (12 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1077: preferred, colored
Changes since revision 1.1077: +13 -6
lines
make: document how to trigger a use-after-free bug
Since 2017-02-01.
Revision 1.1077: download - view: text, markup, annotated - select for diffs
Sun Dec 10 14:30:50 2023 UTC (12 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1076: preferred, colored
Changes since revision 1.1076: +4 -4
lines
make: fix crash in ':C' modifier on an empty expression
Since var.c 1.982 from 2021-12-13.
Revision 1.1076: download - view: text, markup, annotated - select for diffs
Sat Dec 9 00:13:38 2023 UTC (12 months ago) by sjg
Branches: MAIN
Diff to: previous 1.1075: preferred, colored
Changes since revision 1.1075: +20 -19
lines
make: Var_SetWithFlags set fromCmd for SCOPE_CMDLINE
Set fromCmd true for SCOPE_CMDLINE
regardless of the variable name.
Reviewed by: rillig
Revision 1.1075: download - view: text, markup, annotated - select for diffs
Sun Nov 19 22:50:11 2023 UTC (12 months, 3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.1074: preferred, colored
Changes since revision 1.1074: +24 -24
lines
make: replace 'variable expression' with 'expression' in comments
No binary change.
Revision 1.1074: download - view: text, markup, annotated - select for diffs
Sun Nov 19 22:06:15 2023 UTC (12 months, 3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.1073: preferred, colored
Changes since revision 1.1073: +6 -6
lines
make: replace 'variable expression' with 'expression' in diagnostics
Revision 1.1073: download - view: text, markup, annotated - select for diffs
Sun Nov 19 12:11:34 2023 UTC (12 months, 3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.1072: preferred, colored
Changes since revision 1.1072: +4 -5
lines
tests/make: cover all code paths for the ':mtime' modifier
Revision 1.1072: download - view: text, markup, annotated - select for diffs
Sun Nov 19 11:47:49 2023 UTC (12 months, 3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.1071: preferred, colored
Changes since revision 1.1071: +13 -10
lines
make: produce more accurate error message for invalid ':mtime' argument
Revision 1.1071: download - view: text, markup, annotated - select for diffs
Sun Nov 19 11:30:28 2023 UTC (12 months, 3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.1070: preferred, colored
Changes since revision 1.1070: +23 -21
lines
make: extract detection of ':from=to' to a separate function
No functional change.
Revision 1.1070: download - view: text, markup, annotated - select for diffs
Sun Nov 19 09:45:19 2023 UTC (12 months, 3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.1069: preferred, colored
Changes since revision 1.1069: +4 -9
lines
tests/make: test and explain exporting of variables
Revision 1.1069: download - view: text, markup, annotated - select for diffs
Sat Nov 18 20:19:08 2023 UTC (12 months, 3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.1068: preferred, colored
Changes since revision 1.1068: +18 -31
lines
make: clean up the modifier ':[...]'
No functional change.
Revision 1.1068: download - view: text, markup, annotated - select for diffs
Thu Nov 2 06:09:07 2023 UTC (13 months, 1 week ago) by rillig
Branches: MAIN
Diff to: previous 1.1067: preferred, colored
Changes since revision 1.1067: +13 -4
lines
make: when comparing substrings, don't read beyond the substring's end
Right now, Substring_Words terminates each word with a '\0', but that's
an implementation detail that is not required by the interface, so don't
rely on it.
Revision 1.1067: download - view: text, markup, annotated - select for diffs
Thu Nov 2 05:55:22 2023 UTC (13 months, 1 week ago) by rillig
Branches: MAIN
Diff to: previous 1.1066: preferred, colored
Changes since revision 1.1066: +10 -10
lines
make: miscellaneous cleanups
No functional change.
Revision 1.1066: download - view: text, markup, annotated - select for diffs
Thu Nov 2 05:40:49 2023 UTC (13 months, 1 week ago) by rillig
Branches: MAIN
Diff to: previous 1.1065: preferred, colored
Changes since revision 1.1065: +30 -35
lines
make: clean up comments
No functional change.
Revision 1.1065: download - view: text, markup, annotated - select for diffs
Thu Nov 2 05:14:58 2023 UTC (13 months, 1 week ago) by rillig
Branches: MAIN
Diff to: previous 1.1064: preferred, colored
Changes since revision 1.1064: +3 -3
lines
make: sync comments with the extracted ParseModifier_Match
No functional change.
Revision 1.1064: download - view: text, markup, annotated - select for diffs
Sat Aug 19 19:59:17 2023 UTC (15 months, 3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.1063: preferred, colored
Changes since revision 1.1063: +5 -5
lines
make: only work around wrong strftime if actually necessary
The workaround is only needed if the time format contains '%s', in all
other cases there is no need to preserve, set and restore the TZ
environment variable. Suggested by sjg@.
Only check for 's' in the format string, not for '%s', to allow for
optional modifiers of the conversion specifier.
Revision 1.1063: download - view: text, markup, annotated - select for diffs
Sat Aug 19 11:53:10 2023 UTC (15 months, 3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.1062: preferred, colored
Changes since revision 1.1062: +3 -7
lines
make: clean up comments regarding gmtime/strftime
These two functions are not supposed to be used together, thus it is not
a bug if combining them produces unexpected results.
Revision 1.1062: download - view: text, markup, annotated - select for diffs
Sat Aug 19 11:13:35 2023 UTC (15 months, 3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.1061: preferred, colored
Changes since revision 1.1061: +20 -3
lines
make: work around bugs in gmtime on several platforms
Revision 1.1061: download - view: text, markup, annotated - select for diffs
Thu Aug 17 19:06:51 2023 UTC (15 months, 3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.1060: preferred, colored
Changes since revision 1.1060: +10 -5
lines
make: be strict when parsing the argument of the ':mtime' modifier
Revision 1.1060: download - view: text, markup, annotated - select for diffs
Thu Aug 17 18:52:51 2023 UTC (15 months, 3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.1059: preferred, colored
Changes since revision 1.1059: +17 -18
lines
make: clean up variable names and indentation for the ':mtime' modifier
No functional change.
Revision 1.1059: download - view: text, markup, annotated - select for diffs
Fri Jun 23 05:21:10 2023 UTC (17 months, 3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.1058: preferred, colored
Changes since revision 1.1058: +11 -11
lines
make: clean up variable and function names
No functional change.
Revision 1.1058: download - view: text, markup, annotated - select for diffs
Fri Jun 23 04:56:54 2023 UTC (17 months, 3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.1057: preferred, colored
Changes since revision 1.1057: +13 -3
lines
make: warn about malformed patterns in ':M', ':N' and '.if make(...)'
These patterns shouldn't occur in practice, as their results are tricky
to predict. Generate a warning for now, and maybe an error later.
Reviewed by sjg@.
Revision 1.1057: download - view: text, markup, annotated - select for diffs
Thu Jun 22 08:55:33 2023 UTC (17 months, 3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.1056: preferred, colored
Changes since revision 1.1056: +20 -33
lines
make: merge common code for handling the ':M' and ':N' modifiers
No functional change.
Revision 1.1056: download - view: text, markup, annotated - select for diffs
Fri Jun 16 22:30:35 2023 UTC (17 months, 3 weeks ago) by sjg
Branches: MAIN
Diff to: previous 1.1055: preferred, colored
Changes since revision 1.1055: +7 -2
lines
make: do not allow delete of readOnly variable.
Sometimes we mark a variable readOnly to guard against .undef
Revision 1.1055: download - view: text, markup, annotated - select for diffs
Thu Jun 1 07:44:10 2023 UTC (18 months, 1 week ago) by rillig
Branches: MAIN
Diff to: previous 1.1054: preferred, colored
Changes since revision 1.1054: +16 -17
lines
make: shorten function names, clean up comments
No functional change.
Revision 1.1054: download - view: text, markup, annotated - select for diffs
Wed May 10 18:22:33 2023 UTC (19 months ago) by sjg
Branches: MAIN
Diff to: previous 1.1053: preferred, colored
Changes since revision 1.1053: +51 -31
lines
Make :mtime operate on each word in variable value.
Reviewed by: rillig
Revision 1.1053: download - view: text, markup, annotated - select for diffs
Tue May 9 21:24:56 2023 UTC (19 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1052: preferred, colored
Changes since revision 1.1052: +8 -4
lines
make: improve error message for failed stat in ':mtime'
Revision 1.1052: download - view: text, markup, annotated - select for diffs
Tue May 9 20:53:23 2023 UTC (19 months ago) by sjg
Branches: MAIN
Diff to: previous 1.1051: preferred, colored
Changes since revision 1.1051: +12 -4
lines
make: :mtime=error throw error on stat(2) failure
Sometimes we want fatal error if stat fails on the
presumed pathname.
Revision 1.1051: download - view: text, markup, annotated - select for diffs
Tue May 9 20:14:27 2023 UTC (19 months ago) by sjg
Branches: MAIN
Diff to: previous 1.1050: preferred, colored
Changes since revision 1.1050: +37 -2
lines
make: add :mtime to provide mtime of file
The value of the variable is passed to stat(2)
and st_mtime is new value.
An optional arg can be used if stat(2) fails, otherwise
the current time is used.
See varmod-mtime.mk for usage examples.
Revision 1.1050: download - view: text, markup, annotated - select for diffs
Tue May 9 16:26:59 2023 UTC (19 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1049: preferred, colored
Changes since revision 1.1049: +35 -17
lines
make: allow ':gmtime' and ':localtime' with dynamic argument
This allows ${%Y:L:gmtime=${mtime}} instead of the indirect
${%Y:L:${:Ugmtime=${mtime}}}.
The direct form also prevents any ':' from the nested expression to be
interpreted as a separator, which doesn't matter for the ':gmtime' and
':localtime' modifiers but will prove useful for other modifiers that
follow the same pattern.
Revision 1.1049: download - view: text, markup, annotated - select for diffs
Tue Mar 28 14:39:31 2023 UTC (20 months, 2 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.1048: preferred, colored
Changes since revision 1.1048: +2 -4
lines
make: declare all common symbols in headers, unexport others
No functional change.
Revision 1.1048: download - view: text, markup, annotated - select for diffs
Thu Mar 9 06:49:37 2023 UTC (21 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1047: preferred, colored
Changes since revision 1.1047: +3 -2
lines
make: fix memory leak when parsing ':from=to' modifiers
Since var.c 1.925 from 2021-04-12.
Revision 1.1047: download - view: text, markup, annotated - select for diffs
Sat Feb 18 11:16:09 2023 UTC (21 months, 3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.1046: preferred, colored
Changes since revision 1.1046: +17 -24
lines
make: fix parsing of unevaluated subexpressions with unbalanced '{}'
Since var.c 1.323 from 2020-07-26, modifiers containing unbalanced
braces or parentheses were parsed differently, depending on whether they
were relevant or not.
For example, the expression '${VAR:...}' is enclosed with braces. When
this expression has a modifier ':S,},}},g' that would double each '}' in
that expression, the parser got confused:
If the expression was relevant, the modifier was parsed as usual, taking
into account that the 3 '}' in the modifier are ordinary characters.
If the expression was irrelevant, the parser only counted the '{' and
the '}', without taking into account that a '}' might be escaped by a
'\' or be an ordinary character. Parsing therefore stopped at the first
'}', assuming it would finish the expression '${VAR:S,}'.
This parsing mode of only counting balanced '{' and '}' makes sense for
the modifier ':@var@...@', which expands each word of the expression
using the template from the '...'. These templates tend to be simple
enough that counting the '{' and '}' suffices.
Revision 1.1046: download - view: text, markup, annotated - select for diffs
Wed Feb 15 06:52:58 2023 UTC (21 months, 3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.1045: preferred, colored
Changes since revision 1.1045: +4 -4
lines
make: inline macros for variable names
The variable name '.MAKEOVERRIDES' was already used in the non-macro
form.
No binary change.
Revision 1.1045: download - view: text, markup, annotated - select for diffs
Wed Feb 15 06:31:51 2023 UTC (21 months, 3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.1044: preferred, colored
Changes since revision 1.1044: +9 -10
lines
make: inline macro for variable name ".MAKE.EXPORTED"
The variable name is distinctive enough to be searched directly in the
code instead of having a named constant for it.
No binary change.
Revision 1.1044: download - view: text, markup, annotated - select for diffs
Tue Feb 14 21:56:47 2023 UTC (21 months, 3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.1043: preferred, colored
Changes since revision 1.1043: +33 -65
lines
make: remove redundant type VarParseResult
No functional change.
Revision 1.1043: download - view: text, markup, annotated - select for diffs
Tue Feb 14 21:38:31 2023 UTC (21 months, 3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.1042: preferred, colored
Changes since revision 1.1042: +19 -25
lines
make: clean up calls to Var_Subst
None of the calls to Var_Subst used the return value, and the return
value was always VPR_OK.
No functional change.
Revision 1.1042: download - view: text, markup, annotated - select for diffs
Tue Feb 14 21:08:00 2023 UTC (21 months, 3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.1041: preferred, colored
Changes since revision 1.1041: +25 -52
lines
make: reduce complexity of evaluating expressions
No functional change.
Revision 1.1041: download - view: text, markup, annotated - select for diffs
Mon Feb 13 19:25:15 2023 UTC (21 months, 4 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.1040: preferred, colored
Changes since revision 1.1040: +16 -7
lines
make: extract the decision of using a specific log format
No functional change.
Revision 1.1040: download - view: text, markup, annotated - select for diffs
Thu Feb 9 07:34:15 2023 UTC (22 months ago) by sjg
Branches: MAIN
Diff to: previous 1.1039: preferred, colored
Changes since revision 1.1039: +3 -3
lines
make: ApplyModifier_Remember always use SCOPE_GLOBAL
Conditionals evaluate vars with SCOPE_CMDLINE, if :_
is used within a conditional expression and is thus
set in SCOPE_CMDLINE, it breaks any use of :_ in SCOPE_GLOBAL.
The simplest solution is for :_ to always use SCOPE_GLOBAL
Reviewed by: rillig
Revision 1.1039: download - view: text, markup, annotated - select for diffs
Thu Jan 26 20:48:17 2023 UTC (22 months, 2 weeks ago) by sjg
Branches: MAIN
Diff to: previous 1.1038: preferred, colored
Changes since revision 1.1038: +8 -2
lines
make: some variables should be read-only
Make variables like .newline and .MAKE.{GID,PID,PPID,UID} read-only.
Reviewed by: rillig
Revision 1.1038: download - view: text, markup, annotated - select for diffs
Tue Jan 24 00:19:14 2023 UTC (22 months, 2 weeks ago) by sjg
Branches: MAIN
Diff to: previous 1.1037: preferred, colored
Changes since revision 1.1037: +4 -2
lines
make: log adjustments of var.readOnly
Revision 1.1037: download - view: text, markup, annotated - select for diffs
Mon Jan 23 23:01:52 2023 UTC (22 months, 2 weeks ago) by sjg
Branches: MAIN
Diff to: previous 1.1036: preferred, colored
Changes since revision 1.1036: +18 -2
lines
make: .[NO]READONLY for control of read-only variables
Reviewed by: rillig
Revision 1.1036: download - view: text, markup, annotated - select for diffs
Mon Dec 5 23:41:24 2022 UTC (2 years ago) by rillig
Branches: MAIN
CVS tags: netbsd-10-base,
netbsd-10-0-RELEASE,
netbsd-10-0-RC6,
netbsd-10-0-RC5,
netbsd-10-0-RC4,
netbsd-10-0-RC3,
netbsd-10-0-RC2,
netbsd-10-0-RC1,
netbsd-10
Diff to: previous 1.1035: preferred, colored
Changes since revision 1.1035: +3 -3
lines
make: inline LazyBuf_AddBytesBetween
No binary change.
Revision 1.1035: download - view: text, markup, annotated - select for diffs
Sat Oct 1 09:27:45 2022 UTC (2 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1034: preferred, colored
Changes since revision 1.1034: +6 -6
lines
make: constify, fix comment indentation
No functional change.
Revision 1.1034: download - view: text, markup, annotated - select for diffs
Sat Oct 1 09:20:47 2022 UTC (2 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1033: preferred, colored
Changes since revision 1.1033: +5 -7
lines
make: merge duplicate code
No functional change.
Revision 1.1033: download - view: text, markup, annotated - select for diffs
Tue Sep 27 17:46:58 2022 UTC (2 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1032: preferred, colored
Changes since revision 1.1032: +3 -3
lines
make: set WARNS to 6, from the default 5
No binary change on x86_64.
Revision 1.1032: download - view: text, markup, annotated - select for diffs
Wed Aug 24 22:09:40 2022 UTC (2 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1031: preferred, colored
Changes since revision 1.1031: +11 -11
lines
make: prevent future out-of-bounds errors when parsing expressions
A modifier in an expression ends not only at the next ':' or at the
closing '}' or ')', but also at the end of the string.
Previously, testing for the end of the string had been done separately,
which was error-prone since 2006-05-11, when indirect modifiers were
introduced. Since then, it was possible that the string terminator '\0'
was accidentally skipped in cases where the loop condition only tested
for the ending character. When parsing indirect modifiers, the ending
character is indeed '\0', but when parsing direct modifiers, it is '}'
or ')'.
A welcome side effect is that in the case of unclosed expressions such
as '${VAR:Modifier', the amount of error messages is reduced from 2 or 3
to only 1. The removed error messages were wrong and thus confusing
anyway.
Revision 1.1031: download - view: text, markup, annotated - select for diffs
Wed Aug 24 21:03:57 2022 UTC (2 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1030: preferred, colored
Changes since revision 1.1030: +3 -3
lines
make: fix out-of-bounds read when parsing the ':M' modifier
Since at least 2009-01-17, probably already since 2006-02-18, when
modifiers were allowed to be nested expressions.
Revision 1.1030: download - view: text, markup, annotated - select for diffs
Wed Aug 24 20:22:10 2022 UTC (2 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1029: preferred, colored
Changes since revision 1.1029: +4 -3
lines
make: fix out-of-bounds read when parsing the ':D' modifier
Since 2000-04-29, when the ':D' and ':U' modifiers were added.
Revision 1.1029: download - view: text, markup, annotated - select for diffs
Tue Aug 23 19:22:01 2022 UTC (2 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1028: preferred, colored
Changes since revision 1.1028: +37 -21
lines
make: revert parsing of modifier parts (since 2022-08-08)
The modifier ':@var@body@' parses the body in parse-only mode and later
uses Var_Subst on it, in which each literal '$' must be written as '$$'.
Trying to parse the loop body using Var_Parse treated the text
'$${var:-0}' as a single '$' followed by the expression '${var:-0}',
wrongly complaining about the 'Unknown modifier "-0"'.
Found by sjg.
Revision 1.1028: download - view: text, markup, annotated - select for diffs
Mon Aug 8 18:23:30 2022 UTC (2 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1027: preferred, colored
Changes since revision 1.1027: +24 -32
lines
make: fix parsing of modifiers containing unbalanced subexpressions
Revision 1.1027: download - view: text, markup, annotated - select for diffs
Fri Aug 5 20:59:54 2022 UTC (2 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1026: preferred, colored
Changes since revision 1.1026: +19 -20
lines
make: when parsing ':D' or ':U', only copy text if necessary
When parsing the expression ${:D any ${uninterpreted} text}, parsing of
the ':D' modifier only needs to skip to the next delimiter, there is no
need to keep record of the text that has been skipped. In this
particular example, there had been an unnecessary memory allocation
since the nested expression was not copied to the result buffer. Due to
that, the resulting buffer contained " any text", which was not a
substring of the text passed to the parser, thereby forcing the memory
allocation.
No functional change.
Revision 1.1026: download - view: text, markup, annotated - select for diffs
Fri Aug 5 20:35:55 2022 UTC (2 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1025: preferred, colored
Changes since revision 1.1025: +26 -18
lines
make: extract parsing of ':D' and ':U' modifiers into separate function
No functional change.
Revision 1.1025: download - view: text, markup, annotated - select for diffs
Tue Jun 14 19:57:56 2022 UTC (2 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1024: preferred, colored
Changes since revision 1.1024: +5 -6
lines
make: document parsing of short variable names, such as $i
No binary change.
Revision 1.1024: download - view: text, markup, annotated - select for diffs
Tue Jun 14 19:43:02 2022 UTC (2 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1023: preferred, colored
Changes since revision 1.1023: +30 -30
lines
make: reduce indentation in ParseVarnameShort
No functional change.
Revision 1.1023: download - view: text, markup, annotated - select for diffs
Tue Jun 14 19:37:11 2022 UTC (2 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1022: preferred, colored
Changes since revision 1.1022: +9 -11
lines
make: simplify return type of IsShortVarnameValid
No functional change.
Revision 1.1022: download - view: text, markup, annotated - select for diffs
Sun Jun 12 13:37:32 2022 UTC (2 years, 6 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1021: preferred, colored
Changes since revision 1.1021: +3 -4
lines
make: reorganize Parse_Error
Determining the location where the error occurred is now done by
ParseVErrorInternal. This frees the remaining code from keeping the
filename and the line number together. It also makes Parse_Error short
enough that it might be worth providing a separate function for each of
the 3 log levels.
No functional change.
Revision 1.1021: download - view: text, markup, annotated - select for diffs
Sat May 14 12:25:16 2022 UTC (2 years, 6 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1020: preferred, colored
Changes since revision 1.1020: +15 -20
lines
make: clean up comments in Var_Parse
Revision 1.1020: download - view: text, markup, annotated - select for diffs
Mon May 9 21:24:42 2022 UTC (2 years, 7 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1019: preferred, colored
Changes since revision 1.1019: +2 -3
lines
make: remove obsolete comment
All instances of VarFind that could be replaced with VarFindSubstring
have been replaced.
Revision 1.1019: download - view: text, markup, annotated - select for diffs
Sun Mar 27 18:39:01 2022 UTC (2 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1018: preferred, colored
Changes since revision 1.1018: +4 -4
lines
make: fix spacing, and a typo in a test
Revision 1.1018: download - view: text, markup, annotated - select for diffs
Sat Mar 26 14:34:07 2022 UTC (2 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1017: preferred, colored
Changes since revision 1.1017: +18 -5
lines
make: avoid trailing whitespace in debug log for variables
Since trailing whitespace is invisible, describe the variable value in
words to make it visible.
Revision 1.1017: download - view: text, markup, annotated - select for diffs
Sat Mar 26 14:17:46 2022 UTC (2 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1016: preferred, colored
Changes since revision 1.1016: +7 -4
lines
make: add space after colon in debug logging for variables
These log messages are intended for human interpretation, so don't make
them unnecessarily hard to read.
Revision 1.1016: download - view: text, markup, annotated - select for diffs
Sat Mar 26 14:02:40 2022 UTC (2 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1015: preferred, colored
Changes since revision 1.1015: +3 -3
lines
make: prefer 'long long' over 'long' on 32-bit C99 platforms
When sorting the words of an expression numerically using the modifier
':On' (added on 2021-07-30), use 64-bit numbers even on 32-bit
platforms. A typical use case is comparing file sizes.
When tracing the execution of jobs, fix an integer overflow after 2038.
32-bit platforms that use a pre-C99 compiler still have this problem.
No change to the test suite since most tests simply skip any potential
differences between 32-bit platforms and 64-bit platforms (see
varmod-order-numeric.mk) or already account for both variants (see
varmod-localtime.mk).
Revision 1.1015: download - view: text, markup, annotated - select for diffs
Sat Mar 26 13:32:31 2022 UTC (2 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1014: preferred, colored
Changes since revision 1.1014: +7 -7
lines
make: clean up comments
Revision 1.1014: download - view: text, markup, annotated - select for diffs
Sat Mar 26 12:44:57 2022 UTC (2 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1013: preferred, colored
Changes since revision 1.1013: +9 -15
lines
make: fix crash on .undef of an environment variable (since 2020-10-06)
Revision 1.1013: download - view: text, markup, annotated - select for diffs
Thu Mar 3 19:52:41 2022 UTC (2 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1012: preferred, colored
Changes since revision 1.1012: +10 -7
lines
make: simplify ParseModifier_Match
No functional change.
Revision 1.1012: download - view: text, markup, annotated - select for diffs
Fri Feb 11 21:44:10 2022 UTC (2 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1011: preferred, colored
Changes since revision 1.1011: +2 -7
lines
make: remove comment about environment variable with empty name
At least on NetBSD, make cannot be fooled with an environment variable
having an empty name. When running '/usr/bin/env =undefined make', the
argument is parsed as a variable assignment, but putenv(3) refuses to
process an empty variable name. Calling execve(2) directly got a step
further, the kernel didn't filter '=undefined' from the environment
variables. But getenv(3) always returns NULL when querying the
environment variable with the empty name.
On other operating systems, things may be different. Trying to set an
environment variable with an empty name may cause errors in env(1),
putenv(3), execve(2), getenv(3) or other places, so don't add an
automatic test for now.
Revision 1.1011: download - view: text, markup, annotated - select for diffs
Wed Feb 9 21:32:38 2022 UTC (2 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1010: preferred, colored
Changes since revision 1.1010: +7 -10
lines
make: simplify control flow in ModifyWord_SysVSubst
No functional change.
Revision 1.1010: download - view: text, markup, annotated - select for diffs
Wed Feb 9 21:03:13 2022 UTC (2 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1009: preferred, colored
Changes since revision 1.1009: +5 -5
lines
make: clean up variable names
No binary change.
Revision 1.1009: download - view: text, markup, annotated - select for diffs
Fri Feb 4 23:43:10 2022 UTC (2 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1008: preferred, colored
Changes since revision 1.1008: +8 -4
lines
make: use fixed type for comparing numbers using the modifier ':On'
When the modifier ':On' was added on 2021-07-30, there were concerns
that pre-C99 environments would not have the type 'long long', therefore
the type was made configurable, but parsing such numbers was hard-coded
to using strtoll.
To improve compatibility with C90 environments, use 'long' and 'strtol'
in these environments. In C99 environments, use 'long long' and
'strtoll', to account for larger file sizes.
If the flexibility of choosing yet another type for these numbers should
ever arise, it can still be implemented. Until then, reduce the number
of possible build configurations.
Revision 1.1008: download - view: text, markup, annotated - select for diffs
Sat Jan 29 10:19:49 2022 UTC (2 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1007: preferred, colored
Changes since revision 1.1007: +9 -3
lines
make: for recursive variables in commands, print location
Print the approximate location based on the last command that has been
defined for the target. It would be possible to get more detailed
location information by counting the number of commands of the target,
but that would get messy due to .USEBEFORE, .USE and .DEFAULT, and
still, this is an edge case, so don't waste too much code for it now.
Having this hint about the location is more helpful than just a plain
"Variable X is recursive" without any further details.
Revision 1.1007: download - view: text, markup, annotated - select for diffs
Sat Jan 29 01:07:31 2022 UTC (2 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1006: preferred, colored
Changes since revision 1.1006: +18 -26
lines
make: inline functions that have a single call site
No functional change.
Revision 1.1006: download - view: text, markup, annotated - select for diffs
Thu Jan 27 06:02:59 2022 UTC (2 years, 10 months ago) by sjg
Branches: MAIN
Diff to: previous 1.1005: preferred, colored
Changes since revision 1.1005: +4 -3
lines
Allow local variable assignments in dependency lines
The variable is set in the context of the target.
This syntax has been supported by gmake for ~ever.
If necessary a makefile can set .MAKE.TARGET_LOCAL_VARIABLES=false
to disable this.
Expose GetBooleanExpr so parse.c can use it.
Revision 1.1005: download - view: text, markup, annotated - select for diffs
Mon Jan 24 22:59:49 2022 UTC (2 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1004: preferred, colored
Changes since revision 1.1004: +3 -3
lines
tests/make: demonstrate that the 'static' in Var_Parse has an effect
Revision 1.1004: download - view: text, markup, annotated - select for diffs
Mon Jan 24 20:54:54 2022 UTC (2 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1003: preferred, colored
Changes since revision 1.1003: +3 -3
lines
make: remove unsatisfiable condition in VarSubstExpr
At that point, emode can have only 2 values, none of which is
VARE_UNDEFERR.
No binary change since GCC had figured this out all the time, it just
didn't reveal this little secret.
Revision 1.1003: download - view: text, markup, annotated - select for diffs
Mon Jan 24 20:49:55 2022 UTC (2 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1002: preferred, colored
Changes since revision 1.1002: +4 -4
lines
make: when expanding nested variables, check simple things first
No functional change, just a little performance improvement for
expressions that are not evaluated anyway but only parsed.
Revision 1.1002: download - view: text, markup, annotated - select for diffs
Sat Jan 15 19:05:23 2022 UTC (2 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1001: preferred, colored
Changes since revision 1.1001: +2 -23
lines
make: remove unnecessary functions for expanding variable names
In meta mode, the affected variable patterns do not contain a '$'.
Outside of meta mode, Global_SetExpand was only called a single time, so
inline that call.
No functional change.
Revision 1.1001: download - view: text, markup, annotated - select for diffs
Sat Jan 15 18:34:41 2022 UTC (2 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1000: preferred, colored
Changes since revision 1.1000: +27 -45
lines
make: merge duplicate code for expanding variable expressions
No functional change.
Revision 1.1000: download - view: text, markup, annotated - select for diffs
Sun Jan 9 18:49:28 2022 UTC (2 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.999: preferred, colored
Changes since revision 1.999: +27 -21
lines
make: in Cmd_Exec, return error message instead of format string
This change leaves only literal format strings in parse.c. It allows
for more detailed error messages than the current "non-zero status" or
"exited on a signal".
No functional change.
Revision 1.999: download - view: text, markup, annotated - select for diffs
Sun Jan 9 16:56:08 2022 UTC (2 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.998: preferred, colored
Changes since revision 1.998: +8 -15
lines
make: shorten ApplyModifier_Assign
No functional change.
Revision 1.998: download - view: text, markup, annotated - select for diffs
Sat Jan 8 17:25:19 2022 UTC (2 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.997: preferred, colored
Changes since revision 1.997: +3 -3
lines
make: inline Buf_Clear
No functional change.
Revision 1.997: download - view: text, markup, annotated - select for diffs
Sat Jan 8 11:04:13 2022 UTC (2 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.996: preferred, colored
Changes since revision 1.996: +3 -3
lines
make: rename is_shell_metachar, fix character conversion warning
No binary change.
Revision 1.996: download - view: text, markup, annotated - select for diffs
Fri Jan 7 20:37:25 2022 UTC (2 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.995: preferred, colored
Changes since revision 1.995: +6 -6
lines
make: clean up comments, variable names, function names
The comment in ApplyDependencySourceOther repeated the code, its second
half didn't match any current code.
The comment above ParseDependencySourcesEmpty repeated the code.
No binary change, except for assertion line numbers.
Revision 1.995: download - view: text, markup, annotated - select for diffs
Fri Jan 7 12:44:57 2022 UTC (2 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.994: preferred, colored
Changes since revision 1.994: +7 -7
lines
make: merge calls to ApplyModifier_Time
This enables GCC 11 to inline ApplyModifier_Time, like all the other
modifiers. Similar pattern as for ':M' and ':N', as well as for ':D'
and ':U'.
No functional change.
Revision 1.994: download - view: text, markup, annotated - select for diffs
Fri Jan 7 12:37:27 2022 UTC (2 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.993: preferred, colored
Changes since revision 1.993: +13 -44
lines
make: merge duplicate code for modifiers 'gmtime' and 'localtime'
No functional change.
Revision 1.993: download - view: text, markup, annotated - select for diffs
Fri Jan 7 12:33:25 2022 UTC (2 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.992: preferred, colored
Changes since revision 1.992: +16 -16
lines
make: clean up variable modifiers 'gmtime' and 'localtime'
Use consistent wording (zulu -> gmt), make VarStrftime parameter order
consistent with strftime, rename confusing 'time_t utc' to 't',
eliminate common subexpression in error message.
No functional change.
Revision 1.992: download - view: text, markup, annotated - select for diffs
Thu Dec 30 23:56:34 2021 UTC (2 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.991: preferred, colored
Changes since revision 1.991: +7 -16
lines
make: condense code in ApplyModifier_Assign
List the assignment operators in the same order as in the manual page.
No functional change.
Revision 1.991: download - view: text, markup, annotated - select for diffs
Wed Dec 29 05:05:21 2021 UTC (2 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.990: preferred, colored
Changes since revision 1.990: +3 -3
lines
make: merge duplicate types CondEvalResult and CondResult
No binary change.
Revision 1.990: download - view: text, markup, annotated - select for diffs
Wed Dec 29 04:50:56 2021 UTC (2 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.989: preferred, colored
Changes since revision 1.989: +8 -9
lines
make: remove redundant parameter for evaluating conditions
No functional change.
Revision 1.989: download - view: text, markup, annotated - select for diffs
Wed Dec 15 13:03:33 2021 UTC (2 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.988: preferred, colored
Changes since revision 1.988: +4 -4
lines
make: amend leftover cleanups from the previous commits
No functional change.
Revision 1.988: download - view: text, markup, annotated - select for diffs
Wed Dec 15 12:58:01 2021 UTC (2 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.987: preferred, colored
Changes since revision 1.987: +45 -25
lines
make: format comments according to /usr/share/misc/style
Assisted by indent(1), with manual corrections due to its many remaining
bugs.
No functional change.
Revision 1.987: download - view: text, markup, annotated - select for diffs
Wed Dec 15 11:58:40 2021 UTC (2 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.986: preferred, colored
Changes since revision 1.986: +13 -13
lines
make: remove space after ':' in bit-field declarations
As seen in /usr/share/misc/style.
Revision 1.986: download - view: text, markup, annotated - select for diffs
Mon Dec 13 04:18:01 2021 UTC (3 years ago) by rillig
Branches: MAIN
Diff to: previous 1.985: preferred, colored
Changes since revision 1.985: +3 -2
lines
make: fix memory leak when parsing a variable name
To trigger the memory leak, the expanded variable name must not be a
prefix of the textual variable name.
textual name expanded name
ok: UNDEF.${undef} UNDEF.
leak: UNDEF.${undef}. UNDEF..
Revision 1.985: download - view: text, markup, annotated - select for diffs
Mon Dec 13 03:55:16 2021 UTC (3 years ago) by rillig
Branches: MAIN
Diff to: previous 1.984: preferred, colored
Changes since revision 1.984: +21 -19
lines
make: reduce memory allocation in modifier ':?'
The memory allocation was in LazyBuf_DoneGet. The substring for the
untaken branch had been allocated even though it was not necessary.
No functional change.
Revision 1.984: download - view: text, markup, annotated - select for diffs
Mon Dec 13 03:41:57 2021 UTC (3 years ago) by rillig
Branches: MAIN
Diff to: previous 1.983: preferred, colored
Changes since revision 1.983: +14 -13
lines
make: reduce memory allocations in modifier ':C'
The memory allocation was in the call to LazyBuf_DoneGet.
No functional change.
Revision 1.983: download - view: text, markup, annotated - select for diffs
Mon Dec 13 03:19:32 2021 UTC (3 years ago) by rillig
Branches: MAIN
Diff to: previous 1.982: preferred, colored
Changes since revision 1.982: +10 -20
lines
make: condense RegexReplace for the modifier ':C'
No functional change.
Revision 1.982: download - view: text, markup, annotated - select for diffs
Mon Dec 13 03:03:42 2021 UTC (3 years ago) by rillig
Branches: MAIN
Diff to: previous 1.981: preferred, colored
Changes since revision 1.981: +3 -3
lines
make: in the modifier ':C', don't call strlen unnecessarily
No functional change.
Revision 1.981: download - view: text, markup, annotated - select for diffs
Mon Dec 13 02:57:44 2021 UTC (3 years ago) by rillig
Branches: MAIN
Diff to: previous 1.980: preferred, colored
Changes since revision 1.980: +22 -17
lines
make: extract RegexReplaceBackref from RegexReplace
No functional change.
Revision 1.980: download - view: text, markup, annotated - select for diffs
Mon Dec 13 02:34:15 2021 UTC (3 years ago) by rillig
Branches: MAIN
Diff to: previous 1.979: preferred, colored
Changes since revision 1.979: +24 -41
lines
make: merge duplicate code for memory handling in Var_Parse
No functional change.
Revision 1.979: download - view: text, markup, annotated - select for diffs
Mon Dec 13 02:22:14 2021 UTC (3 years ago) by rillig
Branches: MAIN
Diff to: previous 1.978: preferred, colored
Changes since revision 1.978: +3 -4
lines
make: fix remaining memory leak for .SUFFIXES (since yesterday)
Revision 1.978: download - view: text, markup, annotated - select for diffs
Mon Dec 13 02:17:59 2021 UTC (3 years ago) by rillig
Branches: MAIN
Diff to: previous 1.977: preferred, colored
Changes since revision 1.977: +40 -25
lines
make: distinguish between short-lived and environment variables
No functional change.
Revision 1.977: download - view: text, markup, annotated - select for diffs
Mon Dec 13 02:07:58 2021 UTC (3 years ago) by rillig
Branches: MAIN
Diff to: previous 1.976: preferred, colored
Changes since revision 1.976: +14 -14
lines
make: rename VarFreeEnv to VarFreeShortLived
The newly added "variable" .SUFFIXES is short-lived as well, which makes
it necessary to distinguish between environment variables and
short-lived variables.
No binary change.
Revision 1.976: download - view: text, markup, annotated - select for diffs
Mon Dec 13 01:37:51 2021 UTC (3 years ago) by rillig
Branches: MAIN
Diff to: previous 1.975: preferred, colored
Changes since revision 1.975: +11 -13
lines
make: clean up code for freeing short-lived variables
Since yesterday's addition of the short-lived "variable" named
.SUFFIXES, not only environment variables are short-lived. Clean up the
code to prepare for fixing the remaining memory leaks.
No functional change.
Revision 1.975: download - view: text, markup, annotated - select for diffs
Mon Dec 13 01:00:10 2021 UTC (3 years ago) by rillig
Branches: MAIN
Diff to: previous 1.974: preferred, colored
Changes since revision 1.974: +4 -3
lines
make: fix memory leak when evaluating ${.SUFFIXES} (since yesterday)
perl -e '
printf(".SUFFIXES: %s\n", "x" x 224);
printf("_:=\${.SUFFIXES}\n" x 100_000);
printf("all:\n");
' \
| MALLOC_CONF=stats_print:true \
./make -r -f - 2>&1 \
| awk '/bins:/,/^ *256/ { print $1 "\t" $4}'
Roughly 100000 less allocations for bin size 16, for the variable name.
Revision 1.974: download - view: text, markup, annotated - select for diffs
Mon Dec 13 00:33:33 2021 UTC (3 years ago) by rillig
Branches: MAIN
Diff to: previous 1.973: preferred, colored
Changes since revision 1.973: +8 -10
lines
make: fix memory leak when evaluating ${.SUFFIX} (since yesterday)
Revision 1.973: download - view: text, markup, annotated - select for diffs
Sun Dec 12 20:45:48 2021 UTC (3 years ago) by sjg
Branches: MAIN
Diff to: previous 1.972: preferred, colored
Changes since revision 1.972: +14 -4
lines
Add .SUFFIXES as read-only variable.
References to ${.SUFFIXES} are handled dynamically in
ParseVarnameLong by calling Suff_NamesStr.
The variable cannot be set normally.
Reviewed by: rillig
Revision 1.972: download - view: text, markup, annotated - select for diffs
Sun Dec 12 16:41:39 2021 UTC (3 years ago) by sjg
Branches: MAIN
Diff to: previous 1.971: preferred, colored
Changes since revision 1.971: +8 -7
lines
ParseVarnameLong: minimize calls to LazyBuf_Get
Reviewed by: rillig
Revision 1.971: download - view: text, markup, annotated - select for diffs
Sat Dec 11 10:41:31 2021 UTC (3 years ago) by rillig
Branches: MAIN
Diff to: previous 1.970: preferred, colored
Changes since revision 1.970: +5 -5
lines
make: inline ParseEmptyArg into CondParser_FuncCallEmpty
No functional change.
Revision 1.970: download - view: text, markup, annotated - select for diffs
Thu Dec 9 20:27:01 2021 UTC (3 years ago) by rillig
Branches: MAIN
Diff to: previous 1.969: preferred, colored
Changes since revision 1.969: +5 -5
lines
make: in parse errors, mark whitespace more clearly
This prevents any trailing whitespace from going unnoticed. It also
marks leading whitespace more clearly, as in the examples with the time
value " 1".
Revision 1.969: download - view: text, markup, annotated - select for diffs
Thu Dec 9 20:13:10 2021 UTC (3 years ago) by rillig
Branches: MAIN
Diff to: previous 1.968: preferred, colored
Changes since revision 1.968: +4 -4
lines
make: remove period from end of error messages and warnings
The majority of the existing error messages and warnings does not
include a period at the end. Follow this style consistently.
Revision 1.968: download - view: text, markup, annotated - select for diffs
Tue Dec 7 21:47:21 2021 UTC (3 years ago) by rillig
Branches: MAIN
Diff to: previous 1.967: preferred, colored
Changes since revision 1.967: +3 -4
lines
make: merge branches for modifiers ':D' and ':U'
These branches have the exact same code, without involving any macros,
nevertheless GCC 10 doesn't merge them. Further, GCC thinks that the
function ApplyModifier_Defined were called from two different places,
thus creating an actual function definition. Merging the case labels
inlines the function, saving a few instructions and a few hundred bytes
in the binary.
No functional change.
Revision 1.967: download - view: text, markup, annotated - select for diffs
Tue Dec 7 21:30:11 2021 UTC (3 years ago) by rillig
Branches: MAIN
Diff to: previous 1.966: preferred, colored
Changes since revision 1.966: +12 -8
lines
make: extract common code into Expr_Words
No functional change.
Revision 1.966: download - view: text, markup, annotated - select for diffs
Mon Dec 6 22:07:53 2021 UTC (3 years ago) by rillig
Branches: MAIN
Diff to: previous 1.965: preferred, colored
Changes since revision 1.965: +9 -9
lines
make: move low-level implementation details out of Var_Parse
No functional change.
Revision 1.965: download - view: text, markup, annotated - select for diffs
Mon Dec 6 21:24:07 2021 UTC (3 years ago) by rillig
Branches: MAIN
Diff to: previous 1.964: preferred, colored
Changes since revision 1.964: +31 -25
lines
make: extract common code into Expr_Str
This change turns Expr into a more abstract data type.
No functional change.
Revision 1.964: download - view: text, markup, annotated - select for diffs
Sun Dec 5 17:00:02 2021 UTC (3 years ago) by rillig
Branches: MAIN
Diff to: previous 1.963: preferred, colored
Changes since revision 1.963: +31 -20
lines
make: fix types for modifier ':O' (since today)
In var.c 1.962 from 2021-12-05, the type of the array to be sorted
changed from 'const char *' to 'Substring'. The code still worked since
the first member of Substring is 'const char *start', but that was pure
luck.
Fix the type assumptions in the comparison functions.
Add an assertion that the words must be null-terminated since the
comparison functions currently assume this.
This kind of inconsistency may be possible to detect using static
analysis, but NetBSD's lint is currently too limited for that. To
detect this, it would have to analyze each possible comparison function
and remember the assumed type. This type could then be compared to the
argument type of a function call to qsort or bsearch.
No functional change.
Revision 1.963: download - view: text, markup, annotated - select for diffs
Sun Dec 5 15:20:13 2021 UTC (3 years ago) by rillig
Branches: MAIN
Diff to: previous 1.962: preferred, colored
Changes since revision 1.962: +8 -2
lines
make: fix use-after-free in modifier ':@'
Without memory allocator debugging, the newly added test doesn't show
any obvious failure.
With memory allocator debugging enabled, all make versions since
2016.02.27.16.20.06 crash with a segmentation fault.
Revision 1.962: download - view: text, markup, annotated - select for diffs
Sun Dec 5 12:17:49 2021 UTC (3 years ago) by rillig
Branches: MAIN
Diff to: previous 1.961: preferred, colored
Changes since revision 1.961: +16 -15
lines
make: save a memory allocation in each modifier ':O' and ':u'
No functional change.
Revision 1.961: download - view: text, markup, annotated - select for diffs
Sun Dec 5 12:10:28 2021 UTC (3 years ago) by rillig
Branches: MAIN
Diff to: previous 1.960: preferred, colored
Changes since revision 1.960: +8 -6
lines
make: save a memory allocation in the modifier ':[...]'
No functional change.
Revision 1.960: download - view: text, markup, annotated - select for diffs
Sun Dec 5 12:06:23 2021 UTC (3 years ago) by rillig
Branches: MAIN
Diff to: previous 1.959: preferred, colored
Changes since revision 1.959: +10 -12
lines
make: save a memory allocation in the modifier ':[...]'
No functional change.
Revision 1.959: download - view: text, markup, annotated - select for diffs
Sun Dec 5 11:57:18 2021 UTC (3 years ago) by rillig
Branches: MAIN
Diff to: previous 1.958: preferred, colored
Changes since revision 1.958: +13 -13
lines
make: in UnexportVars, replace Str_Words with Substring_Words
This skips an allocation and a bit of memory copying.
No functional change.
Revision 1.958: download - view: text, markup, annotated - select for diffs
Fri Dec 3 18:29:35 2021 UTC (3 years ago) by rillig
Branches: MAIN
Diff to: previous 1.957: preferred, colored
Changes since revision 1.957: +5 -19
lines
make: condense ParseModifierPartSubst
No functional change.
Revision 1.957: download - view: text, markup, annotated - select for diffs
Fri Dec 3 18:23:03 2021 UTC (3 years ago) by rillig
Branches: MAIN
Diff to: previous 1.956: preferred, colored
Changes since revision 1.956: +24 -17
lines
make: extract ParseModifierPartExpr from ParseModifierPartSubst
No functional change.
Revision 1.956: download - view: text, markup, annotated - select for diffs
Fri Dec 3 18:08:51 2021 UTC (3 years ago) by rillig
Branches: MAIN
Diff to: previous 1.955: preferred, colored
Changes since revision 1.955: +42 -40
lines
make: extract ParseModifierPartDollar from ParseModifierPartSubst
No functional change.
Revision 1.955: download - view: text, markup, annotated - select for diffs
Sun Nov 28 22:58:55 2021 UTC (3 years ago) by rillig
Branches: MAIN
Diff to: previous 1.954: preferred, colored
Changes since revision 1.954: +3 -3
lines
make: fix type of variable in ApplyModifier_IfElse
No functional change.
Revision 1.954: download - view: text, markup, annotated - select for diffs
Sat Nov 20 17:51:48 2021 UTC (3 years ago) by rillig
Branches: MAIN
Diff to: previous 1.953: preferred, colored
Changes since revision 1.953: +4 -4
lines
make: use correct plural form in debug message
Revision 1.953: download - view: text, markup, annotated - select for diffs
Sun Oct 17 18:40:14 2021 UTC (3 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.952: preferred, colored
Changes since revision 1.952: +7 -7
lines
make: fix order of parameters in function comments
No functional change.
Revision 1.952: download - view: text, markup, annotated - select for diffs
Thu Sep 23 22:54:09 2021 UTC (3 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.951: preferred, colored
Changes since revision 1.951: +4 -2
lines
make: fix memory leak in error case of the ':?' modifier
Revision 1.951: download - view: text, markup, annotated - select for diffs
Tue Sep 21 23:06:18 2021 UTC (3 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.950: preferred, colored
Changes since revision 1.950: +4 -4
lines
make: reduce relocations, thereby reducing .text size
No functional change.
Revision 1.950: download - view: text, markup, annotated - select for diffs
Sat Sep 11 09:16:14 2021 UTC (3 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.949: preferred, colored
Changes since revision 1.949: +16 -12
lines
make: eliminate a few common subexpressions
This commit contains only changes that don't increase the code size on
x86_64. Replacing the remaining instance of ModChain_ShouldEval would
either increase the code size or make the code harder to understand.
No functional change.
Revision 1.949: download - view: text, markup, annotated - select for diffs
Mon Sep 6 19:38:30 2021 UTC (3 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.948: preferred, colored
Changes since revision 1.948: +3 -3
lines
make: fix typos in comments
Revision 1.948: download - view: text, markup, annotated - select for diffs
Wed Aug 25 22:14:38 2021 UTC (3 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.947: preferred, colored
Changes since revision 1.947: +7 -5
lines
make: fix lint warnings on ilp32 platforms
The warnings in arch.c were about conversions from int to long.
The warnings in var.c were about conversions from long long to
ptrdiff_t.
No functional change.
Revision 1.947: download - view: text, markup, annotated - select for diffs
Sat Aug 14 13:11:33 2021 UTC (3 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.946: preferred, colored
Changes since revision 1.946: +2 -4
lines
make: remove workaround for initialization bug in lint
The bug has been fixed in init.c 1.208 from 2021-08-14.
Revision 1.946: download - view: text, markup, annotated - select for diffs
Sun Aug 8 12:00:30 2021 UTC (3 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.945: preferred, colored
Changes since revision 1.945: +3 -3
lines
make: remove redundant initialization in ApplyModifier_Order
No functional change.
Revision 1.945: download - view: text, markup, annotated - select for diffs
Sat Jul 31 09:30:17 2021 UTC (3 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.944: preferred, colored
Changes since revision 1.944: +4 -2
lines
make: fix lint warnings
The string functions from str.h are declared as 'static __unused' when
compiled with GCC, but lint explicitly undefines __GCC__ during
preprocessing. Therefore, make those functions inline, to prevent
warnings that they are unused.
The macro UNCONST is used in a few places, and (again) since lint
undefines __GCC__, that macro expanded to a simple type cast, which lint
warned about. To prevent this warning, implement UNCONST as a function
that works everywhere and hides the type cast.
In filemon_open, the code for closing F->in was obviously unreachable.
No functional change.
Revision 1.944: download - view: text, markup, annotated - select for diffs
Sat Jul 31 00:17:04 2021 UTC (3 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.943: preferred, colored
Changes since revision 1.943: +12 -22
lines
make: clean up ApplyModifier_Order
No functional change.
Revision 1.943: download - view: text, markup, annotated - select for diffs
Fri Jul 30 23:35:38 2021 UTC (3 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.942: preferred, colored
Changes since revision 1.942: +8 -4
lines
make: reword comment for ApplyModifier_Order
Revision 1.942: download - view: text, markup, annotated - select for diffs
Fri Jul 30 23:28:04 2021 UTC (3 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.941: preferred, colored
Changes since revision 1.941: +39 -27
lines
make: handle parse errors in ':O' uniformly
Previously, the error handling for the variable modifier ':O' differed
depending on the exact variant and in some cases led to misleading
or missing diagnostics.
Revision 1.941: download - view: text, markup, annotated - select for diffs
Fri Jul 30 22:19:51 2021 UTC (3 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.940: preferred, colored
Changes since revision 1.940: +4 -8
lines
make: merge duplicate code for sorting strings and numbers
No functional change.
Revision 1.940: download - view: text, markup, annotated - select for diffs
Fri Jul 30 22:16:09 2021 UTC (3 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.939: preferred, colored
Changes since revision 1.939: +4 -4
lines
make: fix typo in manual page, add more tests for the new ':On'
Revision 1.939: download - view: text, markup, annotated - select for diffs
Fri Jul 30 19:55:22 2021 UTC (3 years, 4 months ago) by sjg
Branches: MAIN
Diff to: previous 1.938: preferred, colored
Changes since revision 1.938: +70 -4
lines
Add :On for numeric sort
Reviewed by: christos rillig
Revision 1.938: download - view: text, markup, annotated - select for diffs
Mon Jun 21 18:25:20 2021 UTC (3 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.937: preferred, colored
Changes since revision 1.937: +6 -7
lines
make: use more practical data type in RegexReplace
While size_t is most appropriate for array indexes, make needs to be
compatible with C90, which does not support the %zu printf conversion.
To avoid type casts, use a simple unsigned int here, which is more than
enough for storing a single decimal digit.
No functional change.
Revision 1.937: download - view: text, markup, annotated - select for diffs
Mon Jun 21 18:12:49 2021 UTC (3 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.936: preferred, colored
Changes since revision 1.936: +50 -43
lines
make: extract RegexReplace from ModifyWord_SubstRegex
No functional change.
Revision 1.936: download - view: text, markup, annotated - select for diffs
Mon Jun 21 17:52:33 2021 UTC (3 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.935: preferred, colored
Changes since revision 1.935: +7 -8
lines
make: move all labels in ModifyWord_SubstRegex to the same level
No functional change.
Revision 1.935: download - view: text, markup, annotated - select for diffs
Mon Jun 21 17:21:37 2021 UTC (3 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.934: preferred, colored
Changes since revision 1.934: +59 -63
lines
make: reduce indentation in ModifyWord_SubstRegex for ':C'
No functional change.
Revision 1.934: download - view: text, markup, annotated - select for diffs
Mon Jun 21 08:40:44 2021 UTC (3 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.933: preferred, colored
Changes since revision 1.933: +8 -9
lines
make: fix documentation for ParseModifierPart
Revision 1.933: download - view: text, markup, annotated - select for diffs
Mon Jun 21 04:24:17 2021 UTC (3 years, 5 months ago) by sjg
Branches: MAIN
Diff to: previous 1.932: preferred, colored
Changes since revision 1.932: +7 -5
lines
Do not report unmatched regex subexpressions
It is not always an error for a subexpression to have not matched,
since the regex library can/does not convey how many matches are
expected, only report an error if opts.strict (-dL)
Reviewed by: christos
Revision 1.930.2.1: download - view: text, markup, annotated - select for diffs
Mon May 31 22:15:25 2021 UTC (3 years, 6 months ago) by cjep
Branches: cjep_staticlib_x
Diff to: previous 1.930: preferred, colored; next MAIN 1.931: preferred, colored
Changes since revision 1.930: +25 -22
lines
sync with head
Revision 1.932: download - view: text, markup, annotated - select for diffs
Sun May 30 20:41:34 2021 UTC (3 years, 6 months ago) by rillig
Branches: MAIN
CVS tags: cjep_sun2x-base1,
cjep_sun2x-base,
cjep_sun2x,
cjep_staticlib_x-base1
Diff to: previous 1.931: preferred, colored
Changes since revision 1.931: +13 -8
lines
make: uncompress code in ApplyModifier_Unique
The algorithm is easier to understand when each line of code only
focuses on a single topic.
No change to the resulting binary, except for line numbers in assertion
messages.
Revision 1.931: download - view: text, markup, annotated - select for diffs
Sun May 30 20:31:03 2021 UTC (3 years, 6 months ago) by rillig
Branches: MAIN
Diff to: previous 1.930: preferred, colored
Changes since revision 1.930: +20 -22
lines
make: inline VarUniq into ApplyModifier_Unique
No functional change.
Revision 1.930: download - view: text, markup, annotated - select for diffs
Mon Apr 19 22:22:27 2021 UTC (3 years, 7 months ago) by rillig
Branches: MAIN
CVS tags: cjep_staticlib_x-base
Branch point for: cjep_staticlib_x
Diff to: previous 1.929: preferred, colored
Changes since revision 1.929: +3 -3
lines
make: use straight quotes for error 'Bad conditional expression'
This diagnostic was supposed to be an error, see ApplyModifier_IfElse.
When such an error occurs while the makefiles are read, make stops with
an error, as can be expected. But when such an error occurs later,
after all makefiles have been read, the message is printed but make does
not stop.
In lint mode (-dL), make stops in such a case. I didn't dare to make
this the default behavior, out of fear of breaking existing build
infrastructure, not only in NetBSD or pkgsrc, but also FreeBSD and other
operating systems that use the bmake distribution, generated from the
same source code.
Revision 1.929: download - view: text, markup, annotated - select for diffs
Wed Apr 14 16:59:34 2021 UTC (3 years, 7 months ago) by rillig
Branches: MAIN
Diff to: previous 1.928: preferred, colored
Changes since revision 1.928: +9 -9
lines
make: reduce memory allocations in the modifiers ':D' and ':U'
Revision 1.928: download - view: text, markup, annotated - select for diffs
Wed Apr 14 16:12:26 2021 UTC (3 years, 7 months ago) by rillig
Branches: MAIN
Diff to: previous 1.927: preferred, colored
Changes since revision 1.927: +13 -13
lines
make: rename members of ModifyWord_LoopArgs
No functional change.
Revision 1.927: download - view: text, markup, annotated - select for diffs
Wed Apr 14 15:41:08 2021 UTC (3 years, 7 months ago) by rillig
Branches: MAIN
Diff to: previous 1.926: preferred, colored
Changes since revision 1.926: +13 -17
lines
make: clean up pattern flags for the modifiers ':S' and ':C'
No special handling is necessary for C90 since none of the struct
members is a const_member.
The prefix 'Var' is not necessary since this type does not apply to a
variable but only to a modifier.
No functional change.
Revision 1.926: download - view: text, markup, annotated - select for diffs
Mon Apr 12 18:53:51 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.925: preferred, colored
Changes since revision 1.925: +7 -7
lines
make: spell SysV in mixed case
No functional change.
Revision 1.925: download - view: text, markup, annotated - select for diffs
Mon Apr 12 18:48:00 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.924: preferred, colored
Changes since revision 1.924: +57 -110
lines
make: reduce memory allocation and strlen calls in modifier ':from=to'
Previously, SysVMatch was quite verbose and felt like hand-optimized
assembler code, which made it difficult to discover the underlying idea
of the code.
All this code was replaced with two simple calls to Substring_HasPrefix
and Substring_HasSuffix. Now that the operands of that modifier are no
longer passed as C strings, there is no need to collect all information
in a single scan through the word and the pattern.
It was not necessary to call Var_Subst unconditionally. Calling it only
when the string contains a '$' saves another memory allocation and two
string copies (because of the Buf_DoneDataCompact).
No functional change.
Revision 1.924: download - view: text, markup, annotated - select for diffs
Mon Apr 12 13:28:35 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.923: preferred, colored
Changes since revision 1.923: +26 -20
lines
make: in the ':Q' modifier, only allocate memory if necessary
Revision 1.923: download - view: text, markup, annotated - select for diffs
Sun Apr 11 22:53:45 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.922: preferred, colored
Changes since revision 1.922: +4 -4
lines
make: improve performance for LazyBuf
The previous O(n^2) time complexity for parsing a long string with many
variable expressions was not meant to last for long. I had hoped to fix
it within a few minutes, but that will take more time.
For now, make LazyBuf simpler by using a traditional C string for the
expected part instead of a Substring. This avoids a strlen call per
Var_Parse.
No functional change, only performance.
Revision 1.922: download - view: text, markup, annotated - select for diffs
Sun Apr 11 21:29:57 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.921: preferred, colored
Changes since revision 1.921: +7 -7
lines
make: remove redundant parameter from ParseVarnameLong
No functional change.
Revision 1.921: download - view: text, markup, annotated - select for diffs
Sun Apr 11 20:38:43 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.920: preferred, colored
Changes since revision 1.920: +129 -96
lines
make: migrate ParseModifierPart to use Substring
This will reduce memory allocation for modifier parts without the escape
characters '$' or '\'.
No functional change.
Revision 1.920: download - view: text, markup, annotated - select for diffs
Sun Apr 11 19:05:06 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.919: preferred, colored
Changes since revision 1.919: +6 -8
lines
make: avoid unnecessary calls to strlen when evaluating modifiers
No functional change.
Revision 1.919: download - view: text, markup, annotated - select for diffs
Sun Apr 11 18:44:57 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.918: preferred, colored
Changes since revision 1.918: +82 -58
lines
make: migrate ModifyWord functions to use Substring
This benefits the modifiers ':T' and ':H' since these scan the word from
the end. The SysV modifier '.c=.o' does not benefit yet, this will be
done in a follow-up commit.
Currently ModifyWords calls strlen for each single word, which degrades
performance. This will be cleaned up in a follow-up commit as well.
No functional change.
Revision 1.918: download - view: text, markup, annotated - select for diffs
Sun Apr 11 17:48:01 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.917: preferred, colored
Changes since revision 1.917: +48 -38
lines
make: migrate handling of the modifier ':S,from,to,' to Substring
Right now this does not gain any performance, it only makes the code in
ModifyWord_Subst a little simpler since it only uses
Buf_AddBytesBetween, not a mixture with Buf_AddBytes.
When the word passed to the ModifyWord functions is converted to
Substring as well, the call to strlen will become redundant.
No functional change.
Revision 1.917: download - view: text, markup, annotated - select for diffs
Sun Apr 11 13:35:56 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.916: preferred, colored
Changes since revision 1.916: +13 -13
lines
make: clean up remaining references to VarEvalFlags
VarEvalFlags has been replaced with VarEvalMode. There were some
comments and tests that still referred to the old names.
No functional change.
Revision 1.916: download - view: text, markup, annotated - select for diffs
Sun Apr 11 12:46:54 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.915: preferred, colored
Changes since revision 1.915: +87 -103
lines
make: avoid allocating memory for simple variable names
The main change is in ParseVarname, where a Buffer is replaced with the
newly introduced LazyBuf. LazyBuf is inspired by
https://golang.org/src/path/path.go.
In CanonicalVarname, the pre-comparison of the first letter of the
variable name is no longer necessary. GCC 9 optimizes a fixed-length
memcmp so well that the code can finally be written to target human
readers, leaving the optimization to the compiler.
Revision 1.915: download - view: text, markup, annotated - select for diffs
Sat Apr 10 22:40:34 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.914: preferred, colored
Changes since revision 1.914: +4 -3
lines
make: fix out-of-bounds read in Var_Parse_FastLane (since 30 minutes)
This bug made the test varmod-edge.mk fail sometimes with varying error
messages, as can be expected for an out-of-bounds read.
Revision 1.914: download - view: text, markup, annotated - select for diffs
Sat Apr 10 22:35:02 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.913: preferred, colored
Changes since revision 1.913: +8 -7
lines
make: reword debug log message for empty variable name
The function names did not match anymore, after one of the many
refactorings in the last few months.
Revision 1.913: download - view: text, markup, annotated - select for diffs
Sat Apr 10 22:09:53 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.912: preferred, colored
Changes since revision 1.912: +38 -2
lines
make: reduce debug logging and memory allocation for ${:U...}
Expressions of the form ${:U...} are often generated by .for loops.
Since these expressions are not generated knowingly by the make user, do
not fill the debug log with them since that would interrupt the normal
reading flow of the -dv log for nested expressions.
Revision 1.912: download - view: text, markup, annotated - select for diffs
Tue Apr 6 01:38:39 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.911: preferred, colored
Changes since revision 1.911: +11 -2
lines
make: reduce verbosity of the -dv debug logging for standard cases
The verbosity was already removed from LogBeforeApply, now it is
consistent between LogBeforeApply and LogAfterApply.
Revision 1.911: download - view: text, markup, annotated - select for diffs
Mon Apr 5 13:35:41 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.910: preferred, colored
Changes since revision 1.910: +7 -7
lines
make: in debug log, add space between scope and variable name
Without this space, the debug log looked more like line noise, even
though the only punctuation was a single innocent ':'. From a make
user's perspective, the variable name is a word of its own and should
not be visually glued to its namespace.
Revision 1.910: download - view: text, markup, annotated - select for diffs
Mon Apr 5 13:27:30 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.909: preferred, colored
Changes since revision 1.909: +12 -4
lines
make: omit unnecessary details from -dv debug log
When an expression is based on a defined variable, it does not matter
whether the evaluation mode is "eval" or "eval-defined", therefore omit
these details to reduce confusion.
Revision 1.909: download - view: text, markup, annotated - select for diffs
Mon Apr 5 13:14:54 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.908: preferred, colored
Changes since revision 1.908: +16 -7
lines
make: be more verbose in -dv debug logging
The previous log output was too brief to be understandable. Give more
hints by describing each part of the expression when evaluating a
modifier. Distinguish between parse-only mode and eval mode since in
parse-only mode most of the details are irrelevant.
Revision 1.908: download - view: text, markup, annotated - select for diffs
Mon Apr 5 12:51:35 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.907: preferred, colored
Changes since revision 1.907: +5 -5
lines
make: clean up debug logging for ':M' and ':N'
Using square brackets as quotes was confusing since patterns can contain
square brackets themselves.
The debug logging for VarMatch was a bit too detailed. Having the
"before" and "after" states is enough for all practically relevant
cases.
Revision 1.907: download - view: text, markup, annotated - select for diffs
Sun Apr 4 13:35:25 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.906: preferred, colored
Changes since revision 1.906: +5 -11
lines
make: disallow '$' in the variable name of the modifier ':@'
If this restriction should break any existing makefile, the author of
that makefile was probably heading for the IOMCC.
Revision 1.906: download - view: text, markup, annotated - select for diffs
Sun Apr 4 11:56:43 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.905: preferred, colored
Changes since revision 1.905: +112 -95
lines
make: convert VarEvalFlags back into an enum, but not a bit-set
As was apparent in VarEvalFlags_ToString, a bit-set was not the best
data type since most of the flags were not freely combinable. The two
flags that could be combined were keepDollar and keepUndef, but even
these have distinguished names in the debug log.
The downside of struct bit-fields is that they need extra helper
functions in C90 (see nonints.h). Exchange these for a few helper
functions in var.c, to keep the code outside var.c simple.
No functional change.
Revision 1.905: download - view: text, markup, annotated - select for diffs
Sun Apr 4 11:47:54 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.904: preferred, colored
Changes since revision 1.904: +44 -24
lines
make: extract decision for evaluating an expression
No functional change.
Revision 1.904: download - view: text, markup, annotated - select for diffs
Sat Apr 3 23:24:06 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.903: preferred, colored
Changes since revision 1.903: +23 -22
lines
make: move VarEvalFlags_ToString down to the other functions
No functional change.
Revision 1.903: download - view: text, markup, annotated - select for diffs
Sat Apr 3 23:19:08 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.902: preferred, colored
Changes since revision 1.902: +6 -11
lines
make: condense definition of VarPatternFlags
No functional change.
Revision 1.902: download - view: text, markup, annotated - select for diffs
Sat Apr 3 23:15:52 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.901: preferred, colored
Changes since revision 1.901: +74 -76
lines
make: inline VarFlags into Var
No functional change.
Revision 1.901: download - view: text, markup, annotated - select for diffs
Sat Apr 3 23:08:30 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.900: preferred, colored
Changes since revision 1.900: +44 -42
lines
make: replace enum bit-set with struct bit-fields
This makes the code easier to read, especially when setting one of the
flags to false.
No functional change.
Revision 1.900: download - view: text, markup, annotated - select for diffs
Sat Apr 3 22:06:23 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.899: preferred, colored
Changes since revision 1.899: +6 -13
lines
make: remove unused Expr.varFlags
No functional change.
Revision 1.899: download - view: text, markup, annotated - select for diffs
Sat Apr 3 22:02:59 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.898: preferred, colored
Changes since revision 1.898: +4 -8
lines
make: remove VarFlags from debug logging
Before the introduction of ExprDefined, VarFlags contained whether the
expression was defined or not, which was useful to know since the final
value of the expression depends on this information. The other VarFlags
do not influence the evaluation, so there is no point logging them.
Revision 1.898: download - view: text, markup, annotated - select for diffs
Sat Apr 3 21:55:27 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.897: preferred, colored
Changes since revision 1.897: +38 -35
lines
make: simplify access to the name of an expression during evaluation
During the evaluation, the flags of the variable don't change, except
for VFL_IN_USE, but in such a case make exits immediately anyway.
Logging the variable flags does not provide any useful information, so
it will be removed soon. Logging the variable flags made sense when the
definedness of the expression was still encoded in the variable flags,
instead of in the separate ExprDefined.
No functional change.
Revision 1.897: download - view: text, markup, annotated - select for diffs
Sat Apr 3 14:39:02 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.896: preferred, colored
Changes since revision 1.896: +74 -28
lines
make: backport to C90
In the past few months I had accidentally used C99 features in the make
code. According to tools/README, tools that are used in the build
system should restrict themselves to C90.
This allows make to build with GCC's options "-pedantic
-Wno-system-headers -Dinline= -Wno-error=cast-qual".
I didn't notice anyone actively complaining though, I just wanted to see
how much work this backporting would be. The identifier __func__ is
still used, as in other tools.
No functional change.
Revision 1.896: download - view: text, markup, annotated - select for diffs
Sat Apr 3 14:31:44 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.895: preferred, colored
Changes since revision 1.895: +35 -35
lines
make: rename function parameters to match boolean constants
No functional change.
Revision 1.895: download - view: text, markup, annotated - select for diffs
Sat Apr 3 11:08:40 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.894: preferred, colored
Changes since revision 1.894: +173 -173
lines
make: use C99 bool type instead of defining its own
No functional change.
Revision 1.894: download - view: text, markup, annotated - select for diffs
Tue Mar 30 14:58:17 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.893: preferred, colored
Changes since revision 1.893: +2 -7
lines
make: remove workaround for bug in lint
The bug has been fixed in lint.
No functional change.
Revision 1.893: download - view: text, markup, annotated - select for diffs
Sun Mar 21 23:03:33 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.892: preferred, colored
Changes since revision 1.892: +4 -4
lines
make: fix typos in documentation of ModChain
Revision 1.892: download - view: text, markup, annotated - select for diffs
Tue Mar 16 16:21:27 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.891: preferred, colored
Changes since revision 1.891: +14 -9
lines
make: fix documentation for ModChain
The outer ModChain can be interrupted by an inner ModChain, but it
continues to exist.
No functional change.
Revision 1.891: download - view: text, markup, annotated - select for diffs
Mon Mar 15 20:00:50 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.890: preferred, colored
Changes since revision 1.890: +207 -207
lines
make: rename ApplyModifiersState to ModChain
The new name accurately describes the structural element that holds such
properties as the separator character and whether the expression value
is considered a single word. The old name ApplyModifiersState was too
long and was meant as a placeholder anyway, when I introduced it in
var.c 1.236 from 2020-07-03.
Revision 1.890: download - view: text, markup, annotated - select for diffs
Mon Mar 15 19:15:04 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.889: preferred, colored
Changes since revision 1.889: +13 -10
lines
make: improve documentation of ApplyModifiersState
No functional change.
Revision 1.889: download - view: text, markup, annotated - select for diffs
Mon Mar 15 19:02:57 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.888: preferred, colored
Changes since revision 1.888: +10 -2
lines
make: document an example for a 'chain of modifiers'
No functional change.
Revision 1.888: download - view: text, markup, annotated - select for diffs
Mon Mar 15 18:56:37 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.887: preferred, colored
Changes since revision 1.887: +5 -6
lines
make: fix double varname expansion in the variable modifier '::='
This is an edge case that doesn't occur in practice since pretty much
nobody dares to use variable names that contain an actual '$' in their
name. This is not about the fairly common VAR.${param} (as written in
the makefile), but instead about the variable whose name is literally
'VAR.${param}'.
The test demonstrates that after the fix, the variable name is taken
exactly as-is for the simple assignment modifier '::='. There are no
such tests for the modifiers '::+=', '::!=' and '::?=', but that's ok.
The code in ApplyModifier_Assign would look assymetrical and suspicious
enough if one of these modifiers would expand its variable name and the
others wouldn't.
Revision 1.887: download - view: text, markup, annotated - select for diffs
Mon Mar 15 16:51:14 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.886: preferred, colored
Changes since revision 1.886: +6 -7
lines
make: clean up documentation of ApplyModifiersState
No functional change.
Revision 1.886: download - view: text, markup, annotated - select for diffs
Mon Mar 15 15:39:13 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.885: preferred, colored
Changes since revision 1.885: +21 -36
lines
make: change debug log for variable evaluation flags to lowercase
This makes them easier distinguishable from variable names since the
latter are usually uppercase.
No functional change outside debug mode.
Revision 1.885: download - view: text, markup, annotated - select for diffs
Mon Mar 15 12:15:03 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.884: preferred, colored
Changes since revision 1.884: +84 -56
lines
make: replace enum bit-field with struct bit-field for VarEvalFlags
This makes the code easier to read, especially in var.c. It also makes
debugging sessions easier since some debuggers don't show enum
bit-fields symbolically as soon as more than one bit is set.
The code outside var.c is basically unchanged, except that instead of
passing the individual flags, there are 4 predefined evaluation modes.
These suffice for all practical use cases. Only in the implementation
deep inside var.c, the value of the flags keepDollar and keepUndef
differs.
There is no way of passing the struct to EnumFlags_ToString, which means
the ToString function has to be spelled out explicitly. This allows for
fine-tuning the representation in the debug log, to reduce the amount of
uppercae letters.
No functional change.
Revision 1.884: download - view: text, markup, annotated - select for diffs
Mon Mar 15 11:41:07 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.883: preferred, colored
Changes since revision 1.883: +7 -7
lines
make: rename VARE_NONE to VARE_PARSE_ONLY
The name 'NONE' described the bit pattern, which was not useful to
understand its meaning. Omitting VARE_WANTRES only parses the
expression, without evaluating any part of it.
No functional change, not even in debug mode since Enum_FlagsToString
always returns "none" for all-bits-unset.
Revision 1.883: download - view: text, markup, annotated - select for diffs
Sun Mar 14 20:23:29 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.882: preferred, colored
Changes since revision 1.882: +3 -9
lines
make: fix documentation of VarFreeEnv
No functional change.
Revision 1.882: download - view: text, markup, annotated - select for diffs
Sun Mar 14 20:18:33 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.881: preferred, colored
Changes since revision 1.881: +28 -26
lines
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.
Revision 1.881: download - view: text, markup, annotated - select for diffs
Sun Mar 14 20:12:16 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.880: preferred, colored
Changes since revision 1.880: +11 -13
lines
make: separate parsing and evaluating for modifier '::='
No functional change.
Revision 1.880: download - view: text, markup, annotated - select for diffs
Sun Mar 14 20:09:26 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.879: preferred, colored
Changes since revision 1.879: +2 -11
lines
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.
Revision 1.879: download - view: text, markup, annotated - select for diffs
Sun Mar 14 20:03:56 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.878: preferred, colored
Changes since revision 1.878: +5 -2
lines
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.
Revision 1.878: download - view: text, markup, annotated - select for diffs
Sun Mar 14 20:00:48 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.877: preferred, colored
Changes since revision 1.877: +16 -19
lines
make: separate parsing and evaluating in the ':O' modifiers
No functional change.
Revision 1.877: download - view: text, markup, annotated - select for diffs
Sun Mar 14 19:29:37 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.876: preferred, colored
Changes since revision 1.876: +5 -2
lines
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.
Revision 1.876: download - view: text, markup, annotated - select for diffs
Sun Mar 14 19:25:05 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.875: preferred, colored
Changes since revision 1.875: +9 -6
lines
make: do not evaluate modifiers ':M' and ':N' in parse-only mode
No functional change outside debug mode (-dv for ModifyWord_Match).
Revision 1.875: download - view: text, markup, annotated - select for diffs
Sun Mar 14 19:21:28 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.874: preferred, colored
Changes since revision 1.874: +6 -3
lines
make: do not return unevaluated 'else' part from the ':?' modifier
No functional change outside debug mode.
Revision 1.874: download - view: text, markup, annotated - select for diffs
Sun Mar 14 18:30:24 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.873: preferred, colored
Changes since revision 1.873: +8 -6
lines
make: do not evaluate ':gmtime' and ':localtime' in parse-only mode
No functional change.
Revision 1.873: download - view: text, markup, annotated - select for diffs
Sun Mar 14 18:23:44 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.872: preferred, colored
Changes since revision 1.872: +28 -8
lines
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.
Revision 1.872: download - view: text, markup, annotated - select for diffs
Sun Mar 14 18:10:57 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.871: preferred, colored
Changes since revision 1.871: +6 -4
lines
make: skip strdup when parsing an irrelevant ':L' modifier
No functional change.
Revision 1.871: download - view: text, markup, annotated - select for diffs
Sun Mar 14 18:08:25 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.870: preferred, colored
Changes since revision 1.870: +4 -3
lines
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.
Revision 1.870: download - view: text, markup, annotated - select for diffs
Sun Mar 14 18:02:44 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.869: preferred, colored
Changes since revision 1.869: +7 -2
lines
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.
Revision 1.869: download - view: text, markup, annotated - select for diffs
Sun Mar 14 17:38:24 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.868: preferred, colored
Changes since revision 1.868: +6 -5
lines
make: eliminate common subexpression in ApplyModifier_Remember
No functional change.
Revision 1.868: download - view: text, markup, annotated - select for diffs
Sun Mar 14 17:34:50 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.867: preferred, colored
Changes since revision 1.867: +10 -12
lines
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.
Revision 1.867: download - view: text, markup, annotated - select for diffs
Sun Mar 14 17:27:27 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.866: preferred, colored
Changes since revision 1.866: +3 -9
lines
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.
Revision 1.866: download - view: text, markup, annotated - select for diffs
Sun Mar 14 16:43:30 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.865: preferred, colored
Changes since revision 1.865: +16 -10
lines
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.
Revision 1.865: download - view: text, markup, annotated - select for diffs
Sun Mar 14 16:03:04 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.864: preferred, colored
Changes since revision 1.864: +5 -2
lines
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.
Revision 1.864: download - view: text, markup, annotated - select for diffs
Sun Mar 14 15:43:31 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.863: preferred, colored
Changes since revision 1.863: +40 -19
lines
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.
Revision 1.863: download - view: text, markup, annotated - select for diffs
Sun Mar 14 15:24:37 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.862: preferred, colored
Changes since revision 1.862: +22 -22
lines
make: reduce indentation in ApplyModifier_SunShell
No functional change.
Revision 1.862: download - view: text, markup, annotated - select for diffs
Sun Mar 14 15:22:21 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.861: preferred, colored
Changes since revision 1.861: +9 -8
lines
make: separate parsing and evaluating for modifier ':u'
No functional change.
Revision 1.861: download - view: text, markup, annotated - select for diffs
Sun Mar 14 15:19:15 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.860: preferred, colored
Changes since revision 1.860: +9 -8
lines
make: separate parsing and evaluating for modifiers ':Q' and ':q'
No functional change.
Revision 1.860: download - view: text, markup, annotated - select for diffs
Sun Mar 14 15:15:28 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.859: preferred, colored
Changes since revision 1.859: +19 -22
lines
make: extract duplicate code for parsing ':S' and ':C'
No functional change.
Revision 1.859: download - view: text, markup, annotated - select for diffs
Sun Mar 14 15:06:19 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.858: preferred, colored
Changes since revision 1.858: +44 -42
lines
make: extract duplicate code for detecting a modifier's end
No functional change.
Revision 1.858: download - view: text, markup, annotated - select for diffs
Sun Mar 14 15:04:13 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.857: preferred, colored
Changes since revision 1.857: +12 -2
lines
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.
Revision 1.857: download - view: text, markup, annotated - select for diffs
Sun Mar 14 11:15:37 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.856: preferred, colored
Changes since revision 1.856: +34 -33
lines
make: sort modifiers in ApplyModifier alphabetically
No functional change.
Revision 1.856: download - view: text, markup, annotated - select for diffs
Sun Mar 14 10:57:12 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.855: preferred, colored
Changes since revision 1.855: +8 -2
lines
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.
Revision 1.855: download - view: text, markup, annotated - select for diffs
Tue Feb 23 16:29:52 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.854: preferred, colored
Changes since revision 1.854: +9 -12
lines
make: reduce indentation in Var_Parse
The extra condition had been necessary before FStr made memory
management simpler.
The Coverity annotation got out-of-date when the parameter was converted
to FStr since that type is not allocated on the heap, only its inner
members are.
No functional change.
Revision 1.854: download - view: text, markup, annotated - select for diffs
Tue Feb 23 16:14:11 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.853: preferred, colored
Changes since revision 1.853: +7 -10
lines
make: restructure code in ParseVarname to target human readers
Breaking the loop once for depth == 0 and once for depth == 1 was
unnecessarily confusing, as was the nested 'if'. Start counting with 0
since there is no reason to start at 1.
Evaluating the common subexpression '*p == endc' is left as an exercise
to the compiler.
No functional change.
Revision 1.853: download - view: text, markup, annotated - select for diffs
Tue Feb 23 16:07:14 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.852: preferred, colored
Changes since revision 1.852: +3 -3
lines
make: improve error message for bad modifier in variable expression
The improvement is especially noteable for variable expressions based on
the empty variable, see moderrs.exp:103.
Revision 1.852: download - view: text, markup, annotated - select for diffs
Tue Feb 23 15:56:29 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.851: preferred, colored
Changes since revision 1.851: +8 -7
lines
make: improve error message for unclosed modifier
Replace "variable specification" with the more modern "variable
expression", reduce the number of parentheses, output more than a single
character for modifiers, make it obvious that in expressions such as
${:Serror}, the "" means a variable name.
Revision 1.851: download - view: text, markup, annotated - select for diffs
Tue Feb 23 15:19:41 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.850: preferred, colored
Changes since revision 1.850: +4 -3
lines
make: improve error message for unknown modifier
Back in 1995, the modifiers were all single-character, and it made sense
to print only the first character. Nowadays, with ':S', ':@var@...@',
'::=' and several others, a little more context is useful to see where
the exact error is. The actual modifier is still guessed, and the guess
may be wrong as soon as backslashes get involved, but it is still better
than before.
Revision 1.850: download - view: text, markup, annotated - select for diffs
Tue Feb 23 15:07:58 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.849: preferred, colored
Changes since revision 1.849: +5 -5
lines
make: remove redundant parameter of ApplySingleModifier
Revision 1.849: download - view: text, markup, annotated - select for diffs
Tue Feb 23 15:03:56 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.848: preferred, colored
Changes since revision 1.848: +11 -6
lines
make: explain non-obvious code around indirect variable modifiers
No functional change.
Revision 1.848: download - view: text, markup, annotated - select for diffs
Tue Feb 23 14:27:27 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.847: preferred, colored
Changes since revision 1.847: +11 -3
lines
make: comment on possible inconsistency in handling modifier ':sh'
Revision 1.847: download - view: text, markup, annotated - select for diffs
Tue Feb 23 14:21:45 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.846: preferred, colored
Changes since revision 1.846: +7 -2
lines
make: note inconsistent parsing behavior in modifier ':_='
Revision 1.846: download - view: text, markup, annotated - select for diffs
Tue Feb 23 00:27:47 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.845: preferred, colored
Changes since revision 1.845: +3 -3
lines
make: quote ':S' in error message about missing delimiter
Revision 1.845: download - view: text, markup, annotated - select for diffs
Tue Feb 23 00:25:06 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.844: preferred, colored
Changes since revision 1.844: +24 -9
lines
make: extract ParseModifier_Match into separate function
No functional change.
Revision 1.844: download - view: text, markup, annotated - select for diffs
Tue Feb 23 00:15:22 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.843: preferred, colored
Changes since revision 1.843: +4 -3
lines
make: add context information to error message about ':range' modifier
Revision 1.843: download - view: text, markup, annotated - select for diffs
Tue Feb 23 00:11:07 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.842: preferred, colored
Changes since revision 1.842: +8 -8
lines
make: fix local variable name for parsing arguments
The variable name 'arg' was misleading since after a successful
TryParseTime, it would no longer point to the argument of the variable
modifier, but to the _end_ of the argument. To reduce confusion, use p
instead, like everywhere else. This name is less specific, which is
still better than a wrong name.
Revision 1.842: download - view: text, markup, annotated - select for diffs
Tue Feb 23 00:04:48 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.841: preferred, colored
Changes since revision 1.841: +3 -3
lines
make: add quotes around variable name in an error message
Revision 1.841: download - view: text, markup, annotated - select for diffs
Mon Feb 22 23:46:03 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.840: preferred, colored
Changes since revision 1.840: +3 -4
lines
make: reorder code in ModifyWords
No functional change.
Revision 1.840: download - view: text, markup, annotated - select for diffs
Mon Feb 22 23:42:29 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.839: preferred, colored
Changes since revision 1.839: +6 -6
lines
make: use more common parameter order for VarSelectWords
No functional change.
Revision 1.839: download - view: text, markup, annotated - select for diffs
Mon Feb 22 23:39:24 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.838: preferred, colored
Changes since revision 1.838: +5 -5
lines
make: make ModifyWord_Subst a little easier to understand
Addition is easier than subtraction, and the expression 'word + wordLen'
obviously means 'the end of the word', which was not as easy to spot
before.
No functional change.
Revision 1.838: download - view: text, markup, annotated - select for diffs
Mon Feb 22 23:21:33 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.837: preferred, colored
Changes since revision 1.837: +15 -16
lines
make: remove freestanding freeIt variables
These variables all belong to a string variable. Connect them using
FStr, which reduces the number of variables to keep track of.
No functional change.
Revision 1.837: download - view: text, markup, annotated - select for diffs
Mon Feb 22 22:55:43 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.836: preferred, colored
Changes since revision 1.836: +21 -24
lines
make: remove boolean parameter and return type from VarFreeEnv
There was only a single case where this parameter was false. Inline
that case. That was the only case that needed the return value, so
remove that as well.
Revision 1.836: download - view: text, markup, annotated - select for diffs
Mon Feb 22 22:34:04 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.835: preferred, colored
Changes since revision 1.835: +5 -2
lines
make: add a few open questions to Var_SetWithFlags
Revision 1.835: download - view: text, markup, annotated - select for diffs
Mon Feb 22 22:26:50 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.834: preferred, colored
Changes since revision 1.834: +4 -5
lines
make: do not expand variable name from the command line twice in a row
When
1. there is a global variable containing a dollar in its expanded name
(very unlikely since there are lots of undocumented edge cases that
make variable names containing dollar signs fragile), and
2. after that (unlikely since that requires .MAKEFLAGS instead of a
normal command line)
3. there is a command line variable of the same name (again very
unlikely since that variable name would contain a dollar sign as
well in the expanded form),
the global variable would not be undefined as promised by the comments
since its name was expanded once more than intended.
Because of the two 'very unlikely' above, this edge case hopefully does
not affect any practical use cases.
Note that this is not about VAR.${param} (which has a dollar sign in its
unexpanded form), but about the case where param itself would expand to
a dollar sign, such as after param=$$.
Revision 1.834: download - view: text, markup, annotated - select for diffs
Mon Feb 22 21:43:57 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.833: preferred, colored
Changes since revision 1.833: +30 -21
lines
make: extract ExistsInCmdline from Var_SetWithFlags
No functional change.
Revision 1.833: download - view: text, markup, annotated - select for diffs
Mon Feb 22 21:30:33 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.832: preferred, colored
Changes since revision 1.832: +8 -8
lines
make: save a hash map lookup when defining a cmdline variable
This is a preparation to extract the code for exporting a cmdline
variable. That code differs in several details from the other code in
ExportVar.
No functional change.
Revision 1.832: download - view: text, markup, annotated - select for diffs
Mon Feb 22 21:14:15 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.831: preferred, colored
Changes since revision 1.831: +12 -2
lines
make: document interaction between cmdline and global variables
Make prevents global variables from being or becoming visible when a
command line variable of the same name is already defined.
There is a double safety net here. Even if the call to Var_DeleteExpand
were removed, there would be no noticeable effect, other than one less
line in the debug log.
No functional change.
Revision 1.831: download - view: text, markup, annotated - select for diffs
Tue Feb 16 19:46:15 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.830: preferred, colored
Changes since revision 1.830: +10 -12
lines
make: clean up VarAdd, Var_Delete, Var_ReexportVars
No functional change.
Revision 1.830: download - view: text, markup, annotated - select for diffs
Tue Feb 16 17:41:23 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.829: preferred, colored
Changes since revision 1.829: +50 -57
lines
make: clean up and update comments in var.c
During the refactorings of the last months, several comments have become
outdated, some are now redundant since the code is as clear as the
comment, and some code benefits from a bit of explanation.
Revision 1.829: download - view: text, markup, annotated - select for diffs
Tue Feb 16 16:33:40 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.828: preferred, colored
Changes since revision 1.828: +8 -8
lines
make: use bit-shift expressions for VarFlags constants
These are easier to read than hex constants.
There was no need to skip bits 2 and 3 (there were no constants for 0x04
and 0x08). Close this gap, to avoid confusing future readers. Keep the
relative order of the flags since that affects the debug output of -dv.
No functional change.
Revision 1.828: download - view: text, markup, annotated - select for diffs
Tue Feb 16 16:28:41 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.827: preferred, colored
Changes since revision 1.827: +38 -38
lines
make: rename constants for VarFlags
The old prefix was "VAR_" and this prefix is used for several other
constants as well, which made it ambiguous.
Revision 1.827: download - view: text, markup, annotated - select for diffs
Tue Feb 16 16:14:27 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.826: preferred, colored
Changes since revision 1.826: +4 -3
lines
make: sync comment about duplicated code with reality
There are only very few places in var.c that contain really duplicate
code anymore.
There is still lots of _almost_ duplicate, for example the code for
parsing variable modifiers. It differs subtly in behavior:
* The modifiers ':M' and ':N' use '$$' to escape a '$' sign, while
almost all other modifiers use '\$' for this purpose.
* The modifiers ':M', ':N', ':S', ':@' and several others parse
balanced parentheses and braces, allowing '(' to '}' to match.
The modifiers ':D' and ':U' only treat the end character special but
not the other 3 of '(){}'.
* When parsing the modifier ':S' but not evaluating it, the code for
nested variable expressions is parsed differently from when it is in
evaluation mode (VARE_WANTRES). This applies to an outer ':S'
modifier and an inner ':D' or ':M' modifier.
Since these inconsistencies affect the behavior in edge cases and some
users of make might depend on it, they cannot be fixed by
behavior-preserving refactorings.
Revision 1.826: download - view: text, markup, annotated - select for diffs
Mon Feb 15 18:23:32 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.825: preferred, colored
Changes since revision 1.825: +5 -5
lines
make: rename ExprDefined constants for debug logging
Revision 1.825: download - view: text, markup, annotated - select for diffs
Mon Feb 15 18:21:13 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.824: preferred, colored
Changes since revision 1.824: +27 -27
lines
make: rename ExprStatus to ExprDefined
The type describes the definedness of an expression, not a general
status, therefore the new name is more precise.
The constants are renamed as well since their prefix 'VES' does not
match the type name anymore, it was correct 3 days ago when the type was
still named VarExprStatus. The name VES_NONE was misleading since
'none' does not describe its actual effect. That name came from the
time when the status was a bit set, and 'none' simply meant 'none of the
bits are set'.
The names used in debug logging will be renamed in a follow-up commit,
to demonstrate that the changes in this commit indeed have no functional
change, especially not the change from '!=' to '==' in line 4304.
No functional change.
Revision 1.824: download - view: text, markup, annotated - select for diffs
Mon Feb 15 17:59:08 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.823: preferred, colored
Changes since revision 1.823: +4 -4
lines
make: update comments for Expr, amending the previous commit
Revision 1.823: download - view: text, markup, annotated - select for diffs
Mon Feb 15 17:44:09 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.822: preferred, colored
Changes since revision 1.822: +200 -164
lines
make: split parameters for evaluating variable expressions
The details of how variable expressions are evaluated is controlled by
several parameters: startc and endc differ for $(VAR) and ${VAR}, the
value of the expression can be interpreted as a single big word, and
when joining several words (such as with ':M' or ':S'), there may be a
custom word separator (defined with ':ts*').
The scope of half of these parameters is the whole variable expression,
the other half of the parameters are reset after each chain of indirect
modifiers. To make this distinction obvious in the code, extract Expr
from ApplyModifiersState. Previously, these details were hidden in how
parameters are passed and restored among ApplyModifiersIndirect and
ApplyModifiers.
The changes in the individual ApplyModifier functions are numerous but
straight-forward. They mostly replace 'st' with 'expr'.
The changes in ApplyModifiers and ApplyModifiersIndirect are more
subtle. The value of the expression is no longer passed around but is
stored in a fixed location, in Expr, which makes it easier to reason
about memory management.
The code in ApplyModifiers after 'cleanup' looks quite different but
preserves the existing behavior. Expr_SetValueRefer is nothing else
than the combination of FStr_Done followed by FStr_InitRefer. Storing
exprStatus back at the end was responsible for passing the definedness
of the expression after applying the indirect modifiers back to the
outer ApplyModifiersState. The same effect is now achieved by having
Expr.status with a wider scope.
No functional change.
Revision 1.822: download - view: text, markup, annotated - select for diffs
Mon Feb 15 06:46:01 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.821: preferred, colored
Changes since revision 1.821: +12 -16
lines
make: clean up code and comments around ModifyWord
In ModifyWords, there is no "passed string" anymore since that function
now directly operates on the expression value.
While here, improve the documentation of ModifyWordsCallback and rename
it to ModifyWordProc, focusing on its purpose instead of where it is
used.
Revision 1.821: download - view: text, markup, annotated - select for diffs
Sun Feb 14 22:48:17 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.820: preferred, colored
Changes since revision 1.820: +122 -140
lines
make: clean up memory management in evaluation of expressions
The condition "st->newValue.str != val" in ApplySingleModifier made the
memory management look more complicated than it really was. Freeing an
object based on another object's value is harder to understand than
necessary.
To fix this, the "current value" of the expression is now stored in
ApplyModifiersState, and it gets updated in-place by the ApplyModifier
functions. This reduces the number of parameters for the ApplyModifier
functions.
Accessing the current value of the expression is now more verbose than
before (st->value.str instead of the simple val). To compensate for
this verbosity, ApplyModifiersIndirect is now much easier to understand
since there is no extra "current value" floating around.
There is still room for improvement. In ApplyModifiers, passing an FStr
in and returning another (or possibly the same) makes it difficult to
understand memory management. Adding a separate Expr type that outlives
the ApplyModifiersState will make this easier, in a follow-up commit.
Revision 1.820: download - view: text, markup, annotated - select for diffs
Sun Feb 14 21:54:42 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.819: preferred, colored
Changes since revision 1.819: +55 -65
lines
make: reduce redundant code around ModifyWords
The result of ModifyWords had been passed to Expr_SetValueOwn in all
cases. The last argument to ModifyWords had always been st->sep.
Revision 1.819: download - view: text, markup, annotated - select for diffs
Sun Feb 14 20:22:30 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.818: preferred, colored
Changes since revision 1.818: +4 -3
lines
make: print error about failed shell command before overwriting variable
Memory management of the value of variable expressions is currently more
complicated than necessary. It is the responsibility of ApplyModifiers,
even though conceptually the value belongs to an expression, so it
should rather be in Expr. Right now, this is an alias for
ApplyModifiersState, but that will change soon.
When that is done, there will no longer be a "current value" and a "new
value", only a single "value" of an expression. At that point, before
Expr_SetValueOwn will overwrite the old value with the output of the
shell command, the error message needs to refer to the latter.
Revision 1.818: download - view: text, markup, annotated - select for diffs
Sun Feb 14 18:59:36 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.817: preferred, colored
Changes since revision 1.817: +4 -11
lines
make: clean up ValidShortVarname
The switch statement was hard to read, especially the "break" that
needed a comment since it was effectively a "continue".
Revision 1.817: download - view: text, markup, annotated - select for diffs
Sun Feb 14 18:55:51 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.816: preferred, colored
Changes since revision 1.816: +8 -14
lines
make: clean up ParseVarnameShort
Single-character short variable expressions such as $V neither have a
starting character nor an ending character. The only interesting
character forms the complete variable name.
No functional change.
Revision 1.816: download - view: text, markup, annotated - select for diffs
Sun Feb 14 18:21:31 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.815: preferred, colored
Changes since revision 1.815: +16 -16
lines
make: rename VarExprStatus to ExprStatus
It is only used in var.c so there is no need to use a prefix.
Revision 1.815: download - view: text, markup, annotated - select for diffs
Sun Feb 14 17:27:25 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.814: preferred, colored
Changes since revision 1.814: +133 -169
lines
make: revert part of previous commit
That code was not ready yet.
Revision 1.814: download - view: text, markup, annotated - select for diffs
Sun Feb 14 17:24:47 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.813: preferred, colored
Changes since revision 1.813: +171 -135
lines
make: update line numbers in expected test output
The documentation from the previous commit added a few lines.
Revision 1.813: download - view: text, markup, annotated - select for diffs
Sun Feb 14 13:53:28 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.812: preferred, colored
Changes since revision 1.812: +68 -56
lines
make: add functions for assigning the value of an expression
The plan is to have only the "current value" of the expression as a
member, not the "new value". To do this consistently and get the memory
management right, there must be a single place (or two) where the value
of the expression is updated.
No functional change.
Revision 1.812: download - view: text, markup, annotated - select for diffs
Sun Feb 14 13:46:01 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.811: preferred, colored
Changes since revision 1.811: +12 -10
lines
make: rename ApplyModifiersState_Define to Expr_Define
The type name ApplyModifiersState was only intended as a working draft,
its name is too long and its scope a little too narrow.
Applying the modifiers is the main part of evaluating a variable
expression, and the scope of that type will be extended to parsing the
name of the expression as well. This will hopefully reduce the number
of parameters, which is currently at 14.
No functional change.
Revision 1.811: download - view: text, markup, annotated - select for diffs
Sun Feb 14 12:35:27 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.810: preferred, colored
Changes since revision 1.810: +12 -20
lines
make: condense the code for parsing :S and :C modifiers
No functional change.
Revision 1.810: download - view: text, markup, annotated - select for diffs
Sun Feb 14 12:24:53 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.809: preferred, colored
Changes since revision 1.809: +13 -17
lines
make: rearrange some comments to make them easier to spot
Revision 1.809: download - view: text, markup, annotated - select for diffs
Sun Feb 14 12:16:13 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.808: preferred, colored
Changes since revision 1.808: +8 -8
lines
make: document purpose of stepping back in the parser
In ApplyModifier_Assign there was no need to compute the delimiter from
st->startc since that has already be done at that point.
Revision 1.808: download - view: text, markup, annotated - select for diffs
Sat Feb 6 21:40:14 2021 UTC (3 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.807: preferred, colored
Changes since revision 1.807: +12 -11
lines
make: sync comment for ApplyModifier_Assign with reality
In compat mode, empty shell commands are handled correctly since at
least 1993.
In jobs mode, empty shell commands are handled correctly since at least
job.c 1.93 from 2005-06-16.
The only place where empty shell commands led to problems was in
Cmd_Exec, but that has nothing to do with the example from the comment.
See var-op-shell.mk for more details.
Revision 1.807: download - view: text, markup, annotated - select for diffs
Fri Feb 5 05:42:39 2021 UTC (3 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.806: preferred, colored
Changes since revision 1.806: +29 -18
lines
make: improve documentation about variable scopes
In an experiment, I tried to separate the concepts of a GNode and a
variable scope. The global variables SCOPE_GLOBAL, SCOPE_INTERNAL and
SCOPE_CMDLINE are implemented as GNode even though they only need the
members 'name' and 'vars'. All their other members are unused.
Therefore it seemed natural to extract this part of the GNode into a
separate type called Scope.
The resulting code was harder to read though since it had split the
namespace of the functions into several parts that were not obviously
related: The Var_ functions, the Scope_ functions, and the short-cut
Global_ functions. Because of this, I threw away the experiment.
All that is left are a few updated comments.
Revision 1.806: download - view: text, markup, annotated - select for diffs
Fri Feb 5 05:19:57 2021 UTC (3 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.805: preferred, colored
Changes since revision 1.805: +9 -8
lines
make: rename remaining ctx to scope
One less small inconsistency. Everywhere else, that variable had been
named ctxt, not ctx.
Revision 1.805: download - view: text, markup, annotated - select for diffs
Fri Feb 5 05:15:12 2021 UTC (3 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.804: preferred, colored
Changes since revision 1.804: +34 -34
lines
make: in the Var_ functions, move the scope to the front
This change provides for a more natural reading order in the code.
Placing the scope first makes it immediately clear in which context the
remaining parameters are interpreted.
No functional change.
Revision 1.804: download - view: text, markup, annotated - select for diffs
Fri Feb 5 04:41:17 2021 UTC (3 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.803: preferred, colored
Changes since revision 1.803: +10 -4
lines
make: add shortcut Global_Delete for deleting a global variable
Revision 1.803: download - view: text, markup, annotated - select for diffs
Thu Feb 4 21:50:39 2021 UTC (3 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.802: preferred, colored
Changes since revision 1.802: +4 -4
lines
make: rename Var_ValueDirect to GNode_ValueDirect
Revision 1.802: download - view: text, markup, annotated - select for diffs
Thu Feb 4 21:42:46 2021 UTC (3 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.801: preferred, colored
Changes since revision 1.801: +156 -157
lines
make: rename context and ctxt to scope
This continues the previous commit, in which VAR_GLOBAL, VAR_INTERNAL
and VAR_CMDLINE were renamed.
Renaming the variable 'ctxt' was trivial since that word is used nowhere
else. In the comments though, each occurrence of the word 'context' had
to be checked individually since the word 'context' was not only used
for referring to a variable scope. It is also used to distinguish
different situations where characters are escaped in a certain way
('parsing context') and in a few other expressions.
Revision 1.801: download - view: text, markup, annotated - select for diffs
Thu Feb 4 21:33:14 2021 UTC (3 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.800: preferred, colored
Changes since revision 1.800: +48 -48
lines
make: rename some VAR constants to SCOPE
The word "context" does not fit perfectly to the variables that are
associate with a GNode, as the context is usually something from the
outside and the variables are more like properties inherent to the
GNode.
The term "global context" fits even less. Since the thing where
variables are looked up is commonly named a scope, use that term
instead.
This commit only renames the global variables VAR_GLOBAL, VAR_INTERNAL
and VAR_CMDLINE, plus a few very closely related comments. These are:
GNode.vars (because of line breaks)
GNode_Free (dito)
varname-make_print_var_on_error.mk
varname-make_print_var_on_error-jobs.mk
The debug message in Var_Stats is left as-is since there is no unit test
for it yet.
The other renamings (variable names "context", "ctxt", as well as
further comments) will be done in a follow-up commit.
Revision 1.800: download - view: text, markup, annotated - select for diffs
Thu Feb 4 19:43:00 2021 UTC (3 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.799: preferred, colored
Changes since revision 1.799: +9 -15
lines
make: merge SetVar into Var_SetWithFlags
No functional change.
Revision 1.799: download - view: text, markup, annotated - select for diffs
Thu Feb 4 19:15:13 2021 UTC (3 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.798: preferred, colored
Changes since revision 1.798: +13 -5
lines
make: rename Var_SetWithFlags to Var_SetExpandWithFlags
Add back Var_SetWithFlags for the one call that doesn't need to expand
the name.
Now one of the flags is encoded in the function name while the others
are encoded in VarSetFlags. This is inconsistent. Maybe there is a
better way to model the different variants of setting a variable.
Revision 1.798: download - view: text, markup, annotated - select for diffs
Thu Feb 4 19:00:45 2021 UTC (3 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.797: preferred, colored
Changes since revision 1.797: +18 -8
lines
make: rename Var_Set to Var_SetExpand
After doing the textual renaming across all files, I added a new
function Var_Set that does not expand the variable name. I then undid
the renaming for all calls where the variable name cannot ever contain a
dollar sign. I omitted the word "Expand" from the textual references in
the unit tests and in the debug logging messages since the focus is
usually on the "Set" part, not on the "Expand".
No functional change.
Revision 1.797: download - view: text, markup, annotated - select for diffs
Wed Feb 3 15:08:17 2021 UTC (3 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.796: preferred, colored
Changes since revision 1.796: +11 -9
lines
make: rename Var_Delete to Var_DeleteExpand, Var_DeleteVar to Var_Delete
The function names now follow the naming scheme from the other functions
that handle variables.
There are several calls that remain syntactically unchanged but that
omit the call to strchr('$') now. Since all these calls use constant
variable names, there is no functional change.
Revision 1.796: download - view: text, markup, annotated - select for diffs
Wed Feb 3 14:33:09 2021 UTC (3 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.795: preferred, colored
Changes since revision 1.795: +20 -11
lines
make: split Var_Exists into plain Var_Exists and Var_ExistsExpand
Most previous calls to Var_Exists use constant variable names. Only the
two calls in parse.c need to expand the variable name.
It may be a good idea to expand the variable name once in VarAssign_Eval
instead of repeating the expansion in each of its special cases.
No functional change.
Revision 1.795: download - view: text, markup, annotated - select for diffs
Wed Feb 3 13:53:12 2021 UTC (3 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.794: preferred, colored
Changes since revision 1.794: +6 -6
lines
make: replace Global_AppendExpand with Global_Append
All callers with a variable name that is guaranteed to not contain a
dollar sign have been converted to call Global_Append instead of the
previous Global_AppendExpand. After that, Global_AppendExpand was
unused, therefore it was effectively just renamed.
Revision 1.794: download - view: text, markup, annotated - select for diffs
Wed Feb 3 13:44:39 2021 UTC (3 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.793: preferred, colored
Changes since revision 1.793: +52 -35
lines
make: split Var_Append into Var_Append and Var_AppendExpand
The plain Var_Append now does not expand the variable name anymore. It
is used in situations where the variable name is known to not contain a
dollar sign.
This is a preparation for adding Global_Append, corresponding to
Global_AppendExpand.
Revision 1.793: download - view: text, markup, annotated - select for diffs
Wed Feb 3 08:40:47 2021 UTC (3 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.792: preferred, colored
Changes since revision 1.792: +10 -10
lines
make: fix double expansion when appending to a new variable
Revision 1.792: download - view: text, markup, annotated - select for diffs
Wed Feb 3 08:08:18 2021 UTC (3 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.791: preferred, colored
Changes since revision 1.791: +14 -3
lines
make: replace Global_SetExpand with Global_Set for constant names
Revision 1.791: download - view: text, markup, annotated - select for diffs
Wed Feb 3 08:00:36 2021 UTC (3 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.790: preferred, colored
Changes since revision 1.790: +17 -5
lines
make: use shortcut functions Global_SetExpand and Global_AppendExpand
There are many places where global variables are set or appended to. To
reduce clutter and code size, encode the VAR_GLOBAL in the function
name.
The word Expand in the function names says that the variable name is
expanded. In most of the cases, this is not necessary, but there are no
corresponding functions Global_Set or Global_Append yet.
Encoding the information whether the name is expanded or not in the
function name will make inconsistencies obvious in future manual code
reviews. Letting the compiler check this by using different types for
unexpanded and expanded variable names is probably not worth the effort.
There are still a few bugs to be fixed, such as in SetVar, which expands
the variable name twice in a row.
Revision 1.790: download - view: text, markup, annotated - select for diffs
Tue Feb 2 21:26:51 2021 UTC (3 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.789: preferred, colored
Changes since revision 1.789: +3 -4
lines
make: remove unused INTERNAL flag
It had been used for cached_realpaths, until this variable had its type
changed from GNode to HashTable in main.c 1.469 from 2020-11-14.
Revision 1.789: download - view: text, markup, annotated - select for diffs
Tue Feb 2 16:18:16 2021 UTC (3 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.788: preferred, colored
Changes since revision 1.788: +35 -34
lines
make: replace VarExprFlags with VarExprStatus
The combination of !VEF_UNDEF && VEF_DEF was not possible, which made it
rather strange to model this state as a bit set.
The only functional change is the renamed constants in the debug output.
Using ENUM_VALUE_RTTI_2 felt like overengineering since it's harder to
understand than a simple array of names.
Revision 1.788: download - view: text, markup, annotated - select for diffs
Tue Feb 2 15:41:14 2021 UTC (3 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.787: preferred, colored
Changes since revision 1.787: +23 -23
lines
make: replace enum bit-set with bit-field
No functional change.
The generated code from GCC 5.5 is very similar. On x86_64, memory
access is no longer in 32-bit units but in 8-bit units since only the
first few bits are actually used. The bit patterns are the same as
before, so if there is any difference in performance, GCC should have
chosen the more efficient variant all along.
In a previous experiment, the code size increased a lot, surprisingly.
Revision 1.787: download - view: text, markup, annotated - select for diffs
Mon Feb 1 19:46:58 2021 UTC (3 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.786: preferred, colored
Changes since revision 1.786: +3 -3
lines
make: replace pre-increment with post-increment or simple addition
The rest of the code already prefers post-increment if there is no
actual difference.
Revision 1.786: download - view: text, markup, annotated - select for diffs
Sat Jan 30 21:25:10 2021 UTC (3 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.785: preferred, colored
Changes since revision 1.785: +5 -5
lines
make(1): inline Buf_Len
Revision 1.785: download - view: text, markup, annotated - select for diffs
Sat Jan 30 21:03:32 2021 UTC (3 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.784: preferred, colored
Changes since revision 1.784: +8 -10
lines
make(1): inline Buf_GetAll
Revision 1.784: download - view: text, markup, annotated - select for diffs
Sat Jan 30 20:53:29 2021 UTC (3 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.783: preferred, colored
Changes since revision 1.783: +23 -20
lines
make(1): split Buf_Destroy into Buf_Done and Buf_DoneData
In all cases except one, the boolean argument to Buf_Destroy was
constant. Removing that argument by splitting the function into two
separate functions makes the intention clearer on the call site. It
also removes the possibility for using the return value of Buf_Done,
which would have made no sense.
The function Buf_Done now pairs with Buf_Init, just as in HashTable and
Lst.
Even though Buf_Done is essentially a no-op, it is kept as a function,
both for symmetry with Buf_Init and for clearing the Buffer members
after use (this will be done only in CLEANUP mode, in a follow-up
commit).
Revision 1.783: download - view: text, markup, annotated - select for diffs
Sat Jan 30 15:48:42 2021 UTC (3 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.782: preferred, colored
Changes since revision 1.782: +9 -18
lines
make(1): reduce boilerplate for printing bit sets in debug mode
No functional change.
Revision 1.782: download - view: text, markup, annotated - select for diffs
Sat Jan 16 20:49:31 2021 UTC (3 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.781: preferred, colored
Changes since revision 1.781: +7 -2
lines
make(1): fix a few inconsistencies for lint's strict bool mode
Revision 1.781: download - view: text, markup, annotated - select for diffs
Sun Jan 10 23:59:53 2021 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.780: preferred, colored
Changes since revision 1.780: +4 -4
lines
make(1): make a few more bool expressions more precise
The previous version of lint(1) from a few hours ago didn't catch all
occurrences. And even the current one doesn't catch everything.
Function arguments and return types still need some work. The "return
quietly" from shouldDieQuietly still implicitly converts from int to
_Bool.
No functional change.
Revision 1.780: download - view: text, markup, annotated - select for diffs
Sun Jan 10 21:20:47 2021 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.779: preferred, colored
Changes since revision 1.779: +4 -4
lines
make(1): consistently use boolean expressions in conditions
Most of the make code already followed the style of explicitly writing
(ptr != NULL) instead of the shorter (ptr) in conditions.
The remaining 50 instances have been found by an experimental,
unpublished check in lint(1) that treats bool expressions as
incompatible to any other scalar type, just as in Java, C#, Pascal and
several other languages.
The only unsafe operation on Boolean that is left over is (flags &
FLAG), for an enum implementing a bit set. If Boolean is an ordinary
integer type (the default), some high bits may get lost. But if Boolean
is the same as _Bool (by compiling with -DUSE_C99_BOOLEAN), C99 6.3.1.2
defines that a conversion from any scalar to the type _Bool acts as a
comparison to 0, which cannot lose any bits.
Revision 1.779: download - view: text, markup, annotated - select for diffs
Sat Jan 9 16:06:09 2021 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.778: preferred, colored
Changes since revision 1.778: +10 -4
lines
make(1): fix lint warnings
Revision 1.778: download - view: text, markup, annotated - select for diffs
Wed Dec 30 10:03:16 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.777: preferred, colored
Changes since revision 1.777: +114 -58
lines
make(1): format multi-line comments
Revision 1.777: download - view: text, markup, annotated - select for diffs
Tue Dec 29 03:21:09 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.776: preferred, colored
Changes since revision 1.776: +37 -128
lines
make(1): clean up code in extracted ExportVar functions
Revision 1.776: download - view: text, markup, annotated - select for diffs
Tue Dec 29 03:05:15 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.775: preferred, colored
Changes since revision 1.775: +140 -27
lines
make(1): split ExportVar into separate functions
Revision 1.775: download - view: text, markup, annotated - select for diffs
Tue Dec 29 01:48:46 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.774: preferred, colored
Changes since revision 1.774: +10 -10
lines
make(1): rename local variables in Var_ReexportVars
Revision 1.774: download - view: text, markup, annotated - select for diffs
Mon Dec 28 00:46:24 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.773: preferred, colored
Changes since revision 1.773: +6 -5
lines
make(1): replace global preserveUndefined with VARE_KEEP_UNDEF
Controlling the expansion of variable expressions using a global
variable and a VARE flag was inconsistent.
Converting the global variable into a flag had to prerequisites:
1. The unintended duplicate variable assignment had to be fixed, as
done in parse.c 1.520 from 2020-12-27. Without this fix, it would have
been necessary to add more flags to Var_Exists and Var_SetWithFlags, and
this would have become too complex.
2. There had to be a unit test demonstrating that VARE_KEEP_DOLLAR only
applies to the top-level expression and is not passed to the
subexpressions, while VARE_KEEP_UNDEF applies to all subexpressions as
well. This test is in var-op-expand.mk 1.10 from 2020-12-28, at least
for the ':@word@' modifier. In ParseModifierPartSubst, VARE_KEEP_UNDEF
is not passed down either, in the same way.
Revision 1.773: download - view: text, markup, annotated - select for diffs
Sun Dec 27 16:31:58 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.772: preferred, colored
Changes since revision 1.772: +3 -4
lines
make(1): remove dead code from ApplyModifiersIndirect
At that point, the expression can never be varUndefined. At the
beginning of ParseVarnameLong, the expression is initialized to a simple
empty string, and that string is only ever converted to varUndefined at
the very end of Var_Parse.
Revision 1.772: download - view: text, markup, annotated - select for diffs
Sun Dec 27 14:41:25 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.771: preferred, colored
Changes since revision 1.771: +2 -12
lines
make(1): remove outdated comment about string comparisons
Back in 1993, the variables in a context were stored in a linked list.
Searching such a list indeed required literally thousands of calls to
strcmp. In make.h 1.22 from 1999-09-15, the linked list was replaced
with a hash table, requiring much fewer string comparisons. Since then,
the rationale doesn't apply anymore.
Revision 1.771: download - view: text, markup, annotated - select for diffs
Sun Dec 27 14:02:12 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.770: preferred, colored
Changes since revision 1.770: +4 -6
lines
make(1): remove unnecessary VPR_ERR_SILENT
Revision 1.770: download - view: text, markup, annotated - select for diffs
Sun Dec 27 13:15:43 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.769: preferred, colored
Changes since revision 1.769: +9 -8
lines
make(1): do not inspect output variables in ParseVarnameShort
Revision 1.769: download - view: text, markup, annotated - select for diffs
Sun Dec 27 13:12:34 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.768: preferred, colored
Changes since revision 1.768: +10 -5
lines
make(1): move error handling code out of UndefinedShortVarValue
Revision 1.768: download - view: text, markup, annotated - select for diffs
Sun Dec 27 11:03:00 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.767: preferred, colored
Changes since revision 1.767: +39 -29
lines
make(1): split Var_Subst into easily understandable functions
Extracting the character-level details makes the essence of Var_Subst
visible in the code, which is to iterate over the given text, handling a
few types of tokens.
Revision 1.767: download - view: text, markup, annotated - select for diffs
Sun Dec 27 10:53:23 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.766: preferred, colored
Changes since revision 1.766: +24 -12
lines
make(1): clean up VarParseResult constants
The many constants were invented because at that time I didn't quite
understand the actual outcomes of Var_Parse that need to be
distinguished. There are only a few:
(1) Errors, whether they are parse errors, or evaluation errors or
undefined variables. The old constants VPR_PARSE_MSG and
VPR_UNDEF_MSG are merged into VPR_ERR.
(2) Undefined expressions in a situation in which they are allowed.
Previously the documentation for VPR_UNDEF_SILENT talked about
undefined expressions in situations where they were not allowed.
That case is fully covered by VPR_ERR instead.
(3) Errors that are silently ignored. These are probably bugs.
(4) Everything went fine, the expression has a defined value.
Revision 1.766: download - view: text, markup, annotated - select for diffs
Sun Dec 27 10:09:53 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.765: preferred, colored
Changes since revision 1.765: +3 -3
lines
make(1): remove unnecessary VPR_UNKNOWN for error handling
There is no sensible way for a caller of Var_Parse to deal with an error
state of "maybe successful, maybe not", therefore remove the constant
for it.
Revision 1.765: download - view: text, markup, annotated - select for diffs
Sun Dec 27 05:06:17 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.764: preferred, colored
Changes since revision 1.764: +20 -15
lines
make(1): align names of VarExportMode with the directives
Revision 1.764: download - view: text, markup, annotated - select for diffs
Wed Dec 23 13:50:54 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.763: preferred, colored
Changes since revision 1.763: +8 -8
lines
make(1): rename CmdOpts.lint to strict
When running lint(1) on the code, it defines the preprocessor macro
"lint" to 1, which generated a syntax error in the declaration "Boolean
lint", as that became "Boolean 1".
Revision 1.763: download - view: text, markup, annotated - select for diffs
Wed Dec 23 13:11:27 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.762: preferred, colored
Changes since revision 1.762: +3 -2
lines
make(1): fix memory leak in Var_Undef (since 2020-12-22)
Revision 1.762: download - view: text, markup, annotated - select for diffs
Tue Dec 22 20:10:21 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.761: preferred, colored
Changes since revision 1.761: +29 -27
lines
make(1): allow .undef to undefine multiple variables at once
Since make doesn't support variable names containing spaces, this edge
case is not enough reason to stop this feature. Having multiple
variable names as arguments nicely aligns with other directives such as
.for and .export.
Revision 1.761: download - view: text, markup, annotated - select for diffs
Mon Dec 21 21:04:18 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.760: preferred, colored
Changes since revision 1.760: +6 -6
lines
make(1): remove excess newline from parse errors (since 2020-11-01)
For the modifiers :gmtime and :localtime, the excess newline had been
added in var.c 1.631 from 2020-10-31 21:40:20.
For the modifiers :range and :ts, the excess newline had been added in
var.c 1.635 from 2020-11-01 14:36:25.
Revision 1.760: download - view: text, markup, annotated - select for diffs
Mon Dec 21 02:38:57 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.759: preferred, colored
Changes since revision 1.759: +47 -44
lines
make(1): remove redundant parameters from ParseModifierPart
Revision 1.759: download - view: text, markup, annotated - select for diffs
Mon Dec 21 00:30:13 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.758: preferred, colored
Changes since revision 1.758: +6 -6
lines
make(1): save a few memory allocations in variable expressions
Revision 1.758: download - view: text, markup, annotated - select for diffs
Mon Dec 21 00:20:58 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.757: preferred, colored
Changes since revision 1.757: +66 -65
lines
make(1): switch memory handling from MFStr to FStr
This makes all intermediate strings constant. For this simple
search-and-replace refactoring, all intermediate locations where the
"current value of the expression" was stored had to be of the type
MFStr.
Using FStr instead of MFStr allows to save a few memory allocations,
which will be done in the follow-up commits.
Revision 1.757: download - view: text, markup, annotated - select for diffs
Mon Dec 21 00:11:29 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.756: preferred, colored
Changes since revision 1.756: +29 -48
lines
make(1): clean up memory management for expanding variable expressions
Previously, memory management had been split among several variables.
The general idea was very simple though. The current value of the
expression needs to be kept in memory, and each modifier either keeps
that value or replaces it with its own newly allocated result, or
var_Error or varUndefined.
Using MFStr, it does not matter anymore that var_Error and varUndefined
are statically allocated since these are assigned using MFStr_InitRefer.
The complexity of the implementation is now closer to the actual
complexity. Most probably the code can be simplified even more.
Revision 1.756: download - view: text, markup, annotated - select for diffs
Sun Dec 20 23:27:37 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.755: preferred, colored
Changes since revision 1.755: +61 -55
lines
make(1): use FStr for ApplyModifiersState.newVal
Memory management is still complicated in this area. To clean this up,
the previous value of the expression needs to be converted to an MFStr
first, and later to an FStr.
Revision 1.755: download - view: text, markup, annotated - select for diffs
Sun Dec 20 19:51:37 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.754: preferred, colored
Changes since revision 1.754: +2 -3
lines
make(1): remove redundant assignment in ApplyModifier_SysV
Revision 1.754: download - view: text, markup, annotated - select for diffs
Sun Dec 20 19:47:34 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.753: preferred, colored
Changes since revision 1.753: +3 -3
lines
make(1): error out on unknown variable modifiers at parse time
Before, make printed an "error message" that did not include the word
error and thus was not easily identified as such. This "error message"
also did not influence the exit status in the default mode but only in
-dL mode. The error message also didn't include any line number
information and was thus rude.
Revision 1.753: download - view: text, markup, annotated - select for diffs
Sun Dec 20 19:10:53 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.752: preferred, colored
Changes since revision 1.752: +2 -8
lines
make(1): remove wrong error message for indirect modifier in lint mode
Revision 1.752: download - view: text, markup, annotated - select for diffs
Sun Dec 20 19:02:28 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.751: preferred, colored
Changes since revision 1.751: +24 -14
lines
make(1): document that indirect modifiers fall back to SysV modifiers
Revision 1.751: download - view: text, markup, annotated - select for diffs
Sun Dec 20 18:23:24 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.750: preferred, colored
Changes since revision 1.750: +5 -5
lines
make(1): remove redundant const declarations for parameters
Revision 1.750: download - view: text, markup, annotated - select for diffs
Sun Dec 20 18:13:50 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.749: preferred, colored
Changes since revision 1.749: +77 -57
lines
make(1): extract ApplySingleModifier from ApplyModifiers
Revision 1.749: download - view: text, markup, annotated - select for diffs
Sun Dec 20 17:22:10 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.748: preferred, colored
Changes since revision 1.748: +99 -102
lines
make(1): turn ApplyModifiersState.val into a local variable
This reduces the scope and makes it more obvious at which places this
variable can be changed and how the memory management is done.
Revision 1.748: download - view: text, markup, annotated - select for diffs
Sun Dec 20 15:31:29 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.747: preferred, colored
Changes since revision 1.747: +11 -13
lines
make(1): use FStr for memory management in Var_SetWithFlags
Revision 1.747: download - view: text, markup, annotated - select for diffs
Sun Dec 20 15:26:40 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.746: preferred, colored
Changes since revision 1.746: +43 -34
lines
make(1): extract SetVar from Var_SetWithFlags
SetVar contains the part that is not concerned about memory management
and expansion of the variable name.
Revision 1.746: download - view: text, markup, annotated - select for diffs
Sun Dec 20 15:04:29 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.745: preferred, colored
Changes since revision 1.745: +10 -7
lines
make(1): fix memory leak in Var_Delete (since yesterday)
The memory leak had been introduced in var.c 1.736 from 2020-12-19
20:47:24.
Revision 1.745: download - view: text, markup, annotated - select for diffs
Sun Dec 20 14:32:13 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.744: preferred, colored
Changes since revision 1.744: +8 -9
lines
make(1): change return type of Var_Value to FStr
Revision 1.744: download - view: text, markup, annotated - select for diffs
Sun Dec 20 13:50:10 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.743: preferred, colored
Changes since revision 1.743: +7 -8
lines
make(1): use FStr in VarNew
Revision 1.743: download - view: text, markup, annotated - select for diffs
Sun Dec 20 13:38:43 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.742: preferred, colored
Changes since revision 1.742: +53 -72
lines
make(1): return FStr from Var_Parse
This reduces the number of variable declarations at the call sites.
Revision 1.742: download - view: text, markup, annotated - select for diffs
Sun Dec 20 12:53:34 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.741: preferred, colored
Changes since revision 1.741: +2 -27
lines
make(1): export FStr and MFStr
These types are a replacement for the pattern "var + var_freeIt" that
enforces these two variables to be updated together.
Revision 1.741: download - view: text, markup, annotated - select for diffs
Sun Dec 20 11:38:51 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.740: preferred, colored
Changes since revision 1.740: +4 -3
lines
make(1): document memory handling in ApplyModifiers
Revision 1.740: download - view: text, markup, annotated - select for diffs
Sun Dec 20 10:59:21 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.739: preferred, colored
Changes since revision 1.739: +16 -15
lines
make(1): replace freeIt with FStr in EvalUndefined
Previously, the parameter out_freeIt was not guaranteed to be
initialized in every case, at least when looking only at EvalUndefined.
This contradicted the variable name.
Replace the two parameters with a single FStr to ensure that these
variables are always initialized together.
Revision 1.739: download - view: text, markup, annotated - select for diffs
Sun Dec 20 00:57:29 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.738: preferred, colored
Changes since revision 1.738: +15 -11
lines
make(1): replace FStr_Assign with separate initialization functions
In GetVarnamesToUnexport, there is no need to free the local FStr since
the only place where it is assigned an allocated string is at the very
end.
Having separate functions for the two main use cases of a possibly
allocated string makes the calling code simpler. This is a preparatory
commit for making the memory allocation in ApplyModifiers easier to
understand.
Revision 1.738: download - view: text, markup, annotated - select for diffs
Sun Dec 20 00:47:21 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.737: preferred, colored
Changes since revision 1.737: +32 -12
lines
make(1): extract string functions from ApplyModifier_To
Revision 1.737: download - view: text, markup, annotated - select for diffs
Sat Dec 19 22:10:17 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.736: preferred, colored
Changes since revision 1.736: +25 -4
lines
make(1): error out if .undef has not exactly 1 argument
Revision 1.736: download - view: text, markup, annotated - select for diffs
Sat Dec 19 20:47:24 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.735: preferred, colored
Changes since revision 1.735: +30 -18
lines
make(1): extract Var_DeleteVar from Var_Delete
Revision 1.735: download - view: text, markup, annotated - select for diffs
Sat Dec 19 20:16:36 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.734: preferred, colored
Changes since revision 1.734: +16 -2
lines
make(1): extract Var_Undef from ParseDirective
Revision 1.734: download - view: text, markup, annotated - select for diffs
Sun Dec 13 21:27:45 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.733: preferred, colored
Changes since revision 1.733: +8 -7
lines
make(1): replace %zu with %u in printf calls
This is needed to compile bmake with GCC 2.8.1 on SunOS 5.9.
To support ancient systems like this, the whole code of usr.bin/make is
supposed to use only ISO C90 features, except for filemon, which is not
used on these systems.
Revision 1.733: download - view: text, markup, annotated - select for diffs
Sun Dec 13 20:14:48 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.732: preferred, colored
Changes since revision 1.732: +3 -5
lines
make(1): add str_basename to reduce duplicate code
The function basename from POSIX has a few unfortunate properties, it is
allowed to return a pointer to static memory. This is too unreliable,
therefore this trivial own implementation.
Revision 1.732: download - view: text, markup, annotated - select for diffs
Sun Dec 13 02:15:49 2020 UTC (4 years ago) by rillig
Branches: MAIN
Diff to: previous 1.731: preferred, colored
Changes since revision 1.731: +10 -20
lines
make(1): remove dead code from GetVarnamesToUnexport
Now that the parsing of the directives is unified and strict, there is
no need anymore for the dispatched functions to check for unknown
directives. These functions don't even get the information to decide
that since this decision is already done.
Revision 1.731: download - view: text, markup, annotated - select for diffs
Sun Dec 13 01:41:12 2020 UTC (4 years ago) by rillig
Branches: MAIN
Diff to: previous 1.730: preferred, colored
Changes since revision 1.730: +7 -34
lines
make(1): clean up Var_Export
Revision 1.730: download - view: text, markup, annotated - select for diffs
Sun Dec 13 01:33:17 2020 UTC (4 years ago) by rillig
Branches: MAIN
Diff to: previous 1.729: preferred, colored
Changes since revision 1.729: +26 -31
lines
make(1): replace bitset VarExportFlags with enum VarExportMode
The previous flags were not combined at all.
Revision 1.729: download - view: text, markup, annotated - select for diffs
Sat Dec 12 21:20:30 2020 UTC (4 years ago) by rillig
Branches: MAIN
Diff to: previous 1.728: preferred, colored
Changes since revision 1.728: +13 -7
lines
make(1): eliminate boolean argument of Var_Export
Revision 1.728: download - view: text, markup, annotated - select for diffs
Sat Dec 12 20:00:51 2020 UTC (4 years ago) by rillig
Branches: MAIN
Diff to: previous 1.727: preferred, colored
Changes since revision 1.727: +14 -7
lines
make(1): extract ExportVarsExpand from Var_Export
Revision 1.727: download - view: text, markup, annotated - select for diffs
Sat Dec 12 19:39:34 2020 UTC (4 years ago) by rillig
Branches: MAIN
Diff to: previous 1.726: preferred, colored
Changes since revision 1.726: +18 -17
lines
make(1): fix undefined behavior when exporting ${:U }
Revision 1.726: download - view: text, markup, annotated - select for diffs
Sat Dec 12 19:31:17 2020 UTC (4 years ago) by rillig
Branches: MAIN
Diff to: previous 1.725: preferred, colored
Changes since revision 1.725: +28 -22
lines
make(1): extract ExportVars from Var_Export
Revision 1.725: download - view: text, markup, annotated - select for diffs
Sat Dec 12 18:53:53 2020 UTC (4 years ago) by rillig
Branches: MAIN
Diff to: previous 1.724: preferred, colored
Changes since revision 1.724: +5 -4
lines
make(1): rename Var_ExportVars to Var_ReexportVars
Revision 1.724: download - view: text, markup, annotated - select for diffs
Sat Dec 12 18:11:42 2020 UTC (4 years ago) by rillig
Branches: MAIN
Diff to: previous 1.723: preferred, colored
Changes since revision 1.723: +7 -3
lines
make(1): error out on misspelled .export directives
Revision 1.723: download - view: text, markup, annotated - select for diffs
Sat Dec 12 18:00:18 2020 UTC (4 years ago) by rillig
Branches: MAIN
Diff to: previous 1.722: preferred, colored
Changes since revision 1.722: +19 -9
lines
make(1): error out on misspelled .unexport-env
Revision 1.722: download - view: text, markup, annotated - select for diffs
Sat Dec 12 00:53:23 2020 UTC (4 years ago) by rillig
Branches: MAIN
Diff to: previous 1.721: preferred, colored
Changes since revision 1.721: +4 -5
lines
make(1): inline local variable in ApplyModifiersIndirect
Revision 1.721: download - view: text, markup, annotated - select for diffs
Sat Dec 12 00:42:35 2020 UTC (4 years ago) by rillig
Branches: MAIN
Diff to: previous 1.720: preferred, colored
Changes since revision 1.720: +15 -15
lines
make(1): in ApplyModifiersIndirect, rename local variable
In other places, the parsing position is abbreviated as pp as well.
Revision 1.720: download - view: text, markup, annotated - select for diffs
Sat Dec 12 00:33:25 2020 UTC (4 years ago) by rillig
Branches: MAIN
Diff to: previous 1.719: preferred, colored
Changes since revision 1.719: +16 -19
lines
make(1): remove const from function parameters
These have been left-overs from refactoring, when these pieces were
extracted to separate functions.
Revision 1.719: download - view: text, markup, annotated - select for diffs
Mon Dec 7 01:50:19 2020 UTC (4 years ago) by rillig
Branches: MAIN
Diff to: previous 1.718: preferred, colored
Changes since revision 1.718: +8 -8
lines
make(1): rename Var_Export1 to ExportVar
Since Var_Export1 is neither exported by the module nor does it belong
to the Var type, the previous function name was misleading. The 1 in
the function name was not as expressive as possible. The new name
aligns nicely with UnexportVar, which is a very young name as well.
Revision 1.718: download - view: text, markup, annotated - select for diffs
Sun Dec 6 18:13:17 2020 UTC (4 years ago) by rillig
Branches: MAIN
Diff to: previous 1.717: preferred, colored
Changes since revision 1.717: +16 -25
lines
make(1): remove comment decoration
Revision 1.717: download - view: text, markup, annotated - select for diffs
Sun Dec 6 17:41:52 2020 UTC (4 years ago) by rillig
Branches: MAIN
Diff to: previous 1.716: preferred, colored
Changes since revision 1.716: +9 -6
lines
make(1): move CleanEnv to UnexportVars
It clearly didn't belong in the GetVarnamesToUnexport part of the code.
Revision 1.716: download - view: text, markup, annotated - select for diffs
Sun Dec 6 17:35:51 2020 UTC (4 years ago) by rillig
Branches: MAIN
Diff to: previous 1.715: preferred, colored
Changes since revision 1.715: +19 -17
lines
make(1): extract UnexportVars from Var_UnExport
Revision 1.715: download - view: text, markup, annotated - select for diffs
Sun Dec 6 17:27:10 2020 UTC (4 years ago) by rillig
Branches: MAIN
Diff to: previous 1.714: preferred, colored
Changes since revision 1.714: +6 -8
lines
make(1): clean up GetVarnamesToUnexport
Revision 1.714: download - view: text, markup, annotated - select for diffs
Sun Dec 6 17:22:44 2020 UTC (4 years ago) by rillig
Branches: MAIN
Diff to: previous 1.713: preferred, colored
Changes since revision 1.713: +40 -24
lines
make(1): extract GetVarnamesToUnexport from Var_UnExport
Revision 1.713: download - view: text, markup, annotated - select for diffs
Sun Dec 6 16:24:30 2020 UTC (4 years ago) by rillig
Branches: MAIN
Diff to: previous 1.712: preferred, colored
Changes since revision 1.712: +20 -13
lines
make(1): replace pointer comparisons with enum
Keeping track of what it means if varname.str == str is not as
expressive as declaring what exactly to unexport.
Revision 1.712: download - view: text, markup, annotated - select for diffs
Sun Dec 6 15:40:46 2020 UTC (4 years ago) by rillig
Branches: MAIN
Diff to: previous 1.711: preferred, colored
Changes since revision 1.711: +23 -16
lines
make(1): use FStr in Var_UnExport
Revision 1.711: download - view: text, markup, annotated - select for diffs
Sun Dec 6 14:50:09 2020 UTC (4 years ago) by rillig
Branches: MAIN
Diff to: previous 1.710: preferred, colored
Changes since revision 1.710: +47 -36
lines
make(1): add FStr to var.c to make memory handling simpler
The pattern of having a variable and a corresponding freeIt variable
appears over and over again in make, so cast it into a struct.
Revision 1.710: download - view: text, markup, annotated - select for diffs
Sun Dec 6 14:20:20 2020 UTC (4 years ago) by rillig
Branches: MAIN
Diff to: previous 1.709: preferred, colored
Changes since revision 1.709: +76 -74
lines
make(1): move type definitions in var.c to the top
Revision 1.709: download - view: text, markup, annotated - select for diffs
Sun Dec 6 13:51:06 2020 UTC (4 years ago) by rillig
Branches: MAIN
Diff to: previous 1.708: preferred, colored
Changes since revision 1.708: +17 -12
lines
make(1): extract FreeEnvVar from Var_Parse
Revision 1.708: download - view: text, markup, annotated - select for diffs
Sun Dec 6 10:49:02 2020 UTC (4 years ago) by rillig
Branches: MAIN
Diff to: previous 1.707: preferred, colored
Changes since revision 1.707: +24 -30
lines
make(1): inline macros for debug logging
No changes to the resulting binary, except for the line numbers in
assertions.
Revision 1.707: download - view: text, markup, annotated - select for diffs
Sat Dec 5 18:38:02 2020 UTC (4 years ago) by rillig
Branches: MAIN
Diff to: previous 1.706: preferred, colored
Changes since revision 1.706: +11 -8
lines
make(1): define constants for enum zero-values
Revision 1.706: download - view: text, markup, annotated - select for diffs
Sat Dec 5 18:15:40 2020 UTC (4 years ago) by rillig
Branches: MAIN
Diff to: previous 1.705: preferred, colored
Changes since revision 1.705: +2 -3
lines
make(1): remove redundant assignments
Revision 1.705: download - view: text, markup, annotated - select for diffs
Sat Dec 5 15:31:18 2020 UTC (4 years ago) by rillig
Branches: MAIN
Diff to: previous 1.704: preferred, colored
Changes since revision 1.704: +36 -36
lines
make(1): extract ShuffleStrings from ApplyModifier_Order
Revision 1.704: download - view: text, markup, annotated - select for diffs
Sat Dec 5 14:55:17 2020 UTC (4 years ago) by rillig
Branches: MAIN
Diff to: previous 1.703: preferred, colored
Changes since revision 1.703: +288 -275
lines
make(1): indent remaining code of var.c with tabs instead of spaces
Revision 1.703: download - view: text, markup, annotated - select for diffs
Sat Dec 5 14:28:09 2020 UTC (4 years ago) by rillig
Branches: MAIN
Diff to: previous 1.702: preferred, colored
Changes since revision 1.702: +2354 -2245
lines
make(1): indent large parts of var.c with tabs instead of spaces
The few remaining functions need to be cleaned up before being indented
further, to reduce the overall indentation.
Revision 1.702: download - view: text, markup, annotated - select for diffs
Sat Dec 5 13:01:33 2020 UTC (4 years ago) by rillig
Branches: MAIN
Diff to: previous 1.701: preferred, colored
Changes since revision 1.701: +3 -3
lines
make(1): improve explanation of tests for the SysV modifier
Revision 1.701: download - view: text, markup, annotated - select for diffs
Fri Dec 4 22:47:57 2020 UTC (4 years ago) by rillig
Branches: MAIN
Diff to: previous 1.700: preferred, colored
Changes since revision 1.700: +29 -23
lines
make(1): extract UnexportEnv from Var_UnExport
Revision 1.700: download - view: text, markup, annotated - select for diffs
Fri Dec 4 22:35:40 2020 UTC (4 years ago) by rillig
Branches: MAIN
Diff to: previous 1.699: preferred, colored
Changes since revision 1.699: +31 -31
lines
make(1): extract UnexportVar from Var_UnExport
Revision 1.699: download - view: text, markup, annotated - select for diffs
Sat Nov 28 16:36:19 2020 UTC (4 years ago) by rillig
Branches: MAIN
Diff to: previous 1.698: preferred, colored
Changes since revision 1.698: +3 -3
lines
make(1): improve type of local variable in Var_Export1
Revision 1.698: download - view: text, markup, annotated - select for diffs
Sat Nov 28 10:09:28 2020 UTC (4 years ago) by rillig
Branches: MAIN
Diff to: previous 1.697: preferred, colored
Changes since revision 1.697: +4 -4
lines
make(1): rename local variable in ModifyWord_Root
The name 'dot' conflicted with the global variable from dir.c when make
was compiled in all-in-one mode.
Revision 1.697: download - view: text, markup, annotated - select for diffs
Sat Nov 28 10:07:26 2020 UTC (4 years ago) by rillig
Branches: MAIN
Diff to: previous 1.696: preferred, colored
Changes since revision 1.696: +5 -5
lines
make(1): rename local variable in ModifyWord_Suffix
It conflicted with 'dot' from dir.c.
Revision 1.696: download - view: text, markup, annotated - select for diffs
Tue Nov 24 21:42:28 2020 UTC (4 years ago) by rillig
Branches: MAIN
Diff to: previous 1.695: preferred, colored
Changes since revision 1.695: +8 -8
lines
make(1): rename local variable in ApplyModifier_Assign
Revision 1.695: download - view: text, markup, annotated - select for diffs
Mon Nov 23 23:41:11 2020 UTC (4 years ago) by rillig
Branches: MAIN
Diff to: previous 1.694: preferred, colored
Changes since revision 1.694: +6 -6
lines
make(1): use comparisons in boolean expressions
The generated code stays exactly the same.
Revision 1.694: download - view: text, markup, annotated - select for diffs
Mon Nov 23 20:52:59 2020 UTC (4 years ago) by rillig
Branches: MAIN
Diff to: previous 1.693: preferred, colored
Changes since revision 1.693: +5 -6
lines
make(1): use properly typed comparisons in boolean contexts
Revision 1.693: download - view: text, markup, annotated - select for diffs
Sat Nov 21 18:41:57 2020 UTC (4 years ago) by rillig
Branches: MAIN
Diff to: previous 1.692: preferred, colored
Changes since revision 1.692: +11 -11
lines
make(1): rename GNode.context to vars
Especially in the variables module, the expression 'ctxt->context' looked
redundant. Having a GNode as a context sounds ok, but a context of a
context just doesn't make sense.
Revision 1.692: download - view: text, markup, annotated - select for diffs
Sat Nov 21 15:32:52 2020 UTC (4 years ago) by rillig
Branches: MAIN
Diff to: previous 1.691: preferred, colored
Changes since revision 1.691: +13 -8
lines
make(1): clean up freeing of environment variables in Var_Parse
The previous code with the extra boolean variable was a brain-twister
since the responsibility of freeing the memory was distributed over 3
different functions.
Revision 1.691: download - view: text, markup, annotated - select for diffs
Sat Nov 21 15:28:44 2020 UTC (4 years ago) by rillig
Branches: MAIN
Diff to: previous 1.690: preferred, colored
Changes since revision 1.690: +5 -5
lines
make(1): clean up parameter order in EvalUndefined
Revision 1.690: download - view: text, markup, annotated - select for diffs
Sat Nov 21 15:02:52 2020 UTC (4 years ago) by rillig
Branches: MAIN
Diff to: previous 1.689: preferred, colored
Changes since revision 1.689: +9 -9
lines
make(1): rename local variable in Var_Subst
Revision 1.689: download - view: text, markup, annotated - select for diffs
Tue Nov 17 20:11:02 2020 UTC (4 years ago) by rillig
Branches: MAIN
Diff to: previous 1.688: preferred, colored
Changes since revision 1.688: +4 -5
lines
make(1): fix error message of failed :!cmd! modifier (since 2000-04-29)
Revision 1.688: download - view: text, markup, annotated - select for diffs
Mon Nov 16 21:39:22 2020 UTC (4 years ago) by rillig
Branches: MAIN
Diff to: previous 1.687: preferred, colored
Changes since revision 1.687: +5 -5
lines
make(1): rename Targ_NewGN to GNode_New
This function is a classical constructor function, and if it weren't for
CLEANUP mode, it would have no dependencies on anything else besides the
memory allocator. Therefore it doesn't really matter which module
defines this function, and there is no need for the "Targ" to be part of
the function name.
Revision 1.687: download - view: text, markup, annotated - select for diffs
Sun Nov 15 18:33:41 2020 UTC (4 years ago) by rillig
Branches: MAIN
Diff to: previous 1.686: preferred, colored
Changes since revision 1.686: +37 -10
lines
make(1): add remarks to var.c and the test varmod-match
Revision 1.686: download - view: text, markup, annotated - select for diffs
Sun Nov 15 18:32:29 2020 UTC (4 years ago) by rillig
Branches: MAIN
Diff to: previous 1.685: preferred, colored
Changes since revision 1.685: +29 -27
lines
make(1): rename ApplyModifiersState.v to var
Revision 1.685: download - view: text, markup, annotated - select for diffs
Sat Nov 14 21:29:44 2020 UTC (4 years ago) by rillig
Branches: MAIN
Diff to: previous 1.684: preferred, colored
Changes since revision 1.684: +5 -6
lines
make(1): replace a few HashTable_CreateEntry with HashTable_Set
Instead of HashTable_CreateEntry and HashEntry_Set, several places just
need the HashEntry for storing a value in it. This makes the calling
code simpler to understand.
These parts of the code are already hard enough to understand since they
are about memory management and aliasing. Having a too detailed API for
the HashTable only distracts from these topics.
Revision 1.684: download - view: text, markup, annotated - select for diffs
Tue Nov 10 00:32:12 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.683: preferred, colored
Changes since revision 1.683: +4 -4
lines
make(1): use consistent definition for MAKE_INLINE
Revision 1.683: download - view: text, markup, annotated - select for diffs
Sun Nov 8 23:38:02 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.682: preferred, colored
Changes since revision 1.682: +9 -9
lines
make(1): move lint option away from the debug flags
The lint option affects much more than a typical debug flag. Not only
does it produce additional diagnostics, it also changes the control flow
and fixes the traditional error handling in a few places.
No functional change.
Revision 1.682: download - view: text, markup, annotated - select for diffs
Sun Nov 8 19:53:11 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.681: preferred, colored
Changes since revision 1.681: +3 -8
lines
make(1): clean up code related to VarEvalFlags
Mention VARE_WANTRES before VARE_UNDEFERR since the latter depends on
the former.
In ApplyModifier_Assign, VARE_KEEP_DOLLAR doesn't have to be removed
from eflags since ParseModifierPart does this already.
In EvalUndefined, testing for VARE_WANTRES is redundant if VARE_UNDEFERR
is already set.
Revision 1.681: download - view: text, markup, annotated - select for diffs
Sun Nov 8 19:24:19 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.680: preferred, colored
Changes since revision 1.680: +12 -14
lines
make(1): clean up VarEvalFlags in the calls to Var_Parse and Var_Subst
There are only 3 flags, and some combinations don't even make sense.
VARE_UNDEFERR only makes sense if combined with VARE_WANTRES. If the
latter is not set, the variable expressions are only parsed, without
asking whether they are defined or not. Therefore, VARE_UNDEFERR cannot
have any effect in that case.
VARE_KEEP_DOLLAR is actively ignored by ParseModifierPart. In cases
where VARE_WANTRES is not set, this means that VARE_NONE can be passed,
which is easier to grasp than any bitset operations. This also gets rid
of a few type casts from enum to unsigned int that were necessary to
pass WARNS=6.
Revision 1.680: download - view: text, markup, annotated - select for diffs
Sun Nov 8 18:27:14 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.679: preferred, colored
Changes since revision 1.679: +5 -5
lines
make(1): rename local variable in VarSubstNested
Revision 1.679: download - view: text, markup, annotated - select for diffs
Sun Nov 8 18:16:55 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.678: preferred, colored
Changes since revision 1.678: +7 -5
lines
make(1): reorder branches in Var_Subst
This way, '$$' is handled first, followed by '$', followed by everything
else. This is easier to follow than first '$$' then not '$' and finally
'$'.
Revision 1.678: download - view: text, markup, annotated - select for diffs
Sun Nov 8 18:13:01 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.677: preferred, colored
Changes since revision 1.677: +53 -42
lines
make(1): extract VarSubstNested from Var_Subst
Each of these functions now fits on a moderately large screen.
Revision 1.677: download - view: text, markup, annotated - select for diffs
Sun Nov 8 16:58:33 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.676: preferred, colored
Changes since revision 1.676: +8 -9
lines
make(1): rename VARE_ASSIGN to VARE_KEEP_DOLLAR
The other flags in VarEvalFlags already describe their effects, not the
place where they are used. It's more important to know the effect.
Only a single unit test had to be adjusted. This probably means that
there are too few tests where the special effects of VARE_KEEP_DOLLAR
come into play. It could also mean that the effects are so simple and
obvious that they don't need any debug log, but that's not the case.
Revision 1.676: download - view: text, markup, annotated - select for diffs
Sun Nov 8 15:07:37 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.675: preferred, colored
Changes since revision 1.675: +4 -4
lines
make(1): use strict typing in conditions of the form !var
Revision 1.675: download - view: text, markup, annotated - select for diffs
Sat Nov 7 22:28:24 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.674: preferred, colored
Changes since revision 1.674: +5 -4
lines
make(1): fix type mismatch between int and VarExportFlags
Revision 1.674: download - view: text, markup, annotated - select for diffs
Sat Nov 7 21:31:07 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.673: preferred, colored
Changes since revision 1.673: +6 -6
lines
make(1): fix type mismatch between int and VarSetFlags
Revision 1.673: download - view: text, markup, annotated - select for diffs
Sat Nov 7 14:11:58 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.672: preferred, colored
Changes since revision 1.672: +12 -12
lines
make(1): make API of Buf_Init simpler
In most cases, the caller doesn't want to specify the exact number of
preallocated bytes.
Revision 1.672: download - view: text, markup, annotated - select for diffs
Sat Nov 7 10:16:19 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.671: preferred, colored
Changes since revision 1.671: +11 -11
lines
make(1): clean up code stylistically
* Replace character literal 0 with '\0'.
* Replace pointer literal 0 with NULL.
* Remove redundant parentheses.
* Parentheses in multi-line conditions are not redundant at the
beginning of a line.
* Replace a few !ptr with ptr == NULL.
* Replace a few ptr with ptr != NULL.
* Replace (expr & mask) == 0 with !(expr & mask).
* Remove redundant braces for blocks in cases where the generated code
stays the same. (Assertions further down in the code would get
different line numbers.)
* Rename parameters in CondParser_String to reflect the data flow.
* Replace #ifdef notdef with #if 0.
The generated code stays exactly the same, at least with GCC 5.5.0 on
NetBSD 8.0 amd64 using the default configuration.
Revision 1.671: download - view: text, markup, annotated - select for diffs
Sat Nov 7 00:06:13 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.670: preferred, colored
Changes since revision 1.670: +6 -6
lines
make(1): rename Var_Set_with_flags to Var_SetWithFlags
Now that the function is exported from the var module, it should stick
to the naming conventions for public functions.
Revision 1.670: download - view: text, markup, annotated - select for diffs
Sat Nov 7 00:02:54 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.669: preferred, colored
Changes since revision 1.669: +4 -4
lines
make(1): rename VarSet_Flags to VarSetFlags
Most other types don't have an underscore as well.
Revision 1.669: download - view: text, markup, annotated - select for diffs
Fri Nov 6 23:11:11 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.668: preferred, colored
Changes since revision 1.668: +3 -3
lines
make(1): rename getBoolean and s2Boolean
Revision 1.668: download - view: text, markup, annotated - select for diffs
Fri Nov 6 00:29:50 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.667: preferred, colored
Changes since revision 1.667: +21 -27
lines
make(1): rename local variable in Var_Parse
Revision 1.667: download - view: text, markup, annotated - select for diffs
Fri Nov 6 00:05:18 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.666: preferred, colored
Changes since revision 1.666: +12 -21
lines
make(1): format source code of a few functions in var.c
Revision 1.666: download - view: text, markup, annotated - select for diffs
Thu Nov 5 23:52:08 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.665: preferred, colored
Changes since revision 1.665: +37 -42
lines
make(1): update and clean up documentation of Var_Parse
Revision 1.665: download - view: text, markup, annotated - select for diffs
Thu Nov 5 23:24:47 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.664: preferred, colored
Changes since revision 1.664: +11 -11
lines
make(1): fix parameter name in ApplyModifiersIndirect and ApplyModifiers
The variable must be properly initialized before these functions are
called.
Revision 1.664: download - view: text, markup, annotated - select for diffs
Thu Nov 5 21:16:20 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.663: preferred, colored
Changes since revision 1.663: +14 -13
lines
make(1): clean up ParseVarnameLong
A parameter named pp is usually used as the parsing position, which is
updated upon successful return. Not so in ParseVarnameLong, where it
was updated in the unsuccessful branch only.
To avoid confusion, rename it to out_FALSE_pp, which is a longer name
but expresses more clearly what actually happens.
Revision 1.663: download - view: text, markup, annotated - select for diffs
Thu Nov 5 20:50:13 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.662: preferred, colored
Changes since revision 1.662: +42 -32
lines
make(1): extract EvalUndefined from ParseVarnameLong
Revision 1.662: download - view: text, markup, annotated - select for diffs
Thu Nov 5 18:43:55 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.661: preferred, colored
Changes since revision 1.661: +35 -24
lines
make(1): extract FindLocalLegacyVar from Var_Parse
Revision 1.661: download - view: text, markup, annotated - select for diffs
Thu Nov 5 18:26:59 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.660: preferred, colored
Changes since revision 1.660: +3 -3
lines
make(1): replace '(' and ')' with neutral '\0' in Var_Parse
The only possible values for extramodifiers are "H:" and "T:", therefore
parsing is independent of startc and endc. Use '\0' instead of '(' and
')' to remove any possible confusion about how '{' and '}' would be
handled.
Revision 1.660: download - view: text, markup, annotated - select for diffs
Thu Nov 5 18:20:23 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.659: preferred, colored
Changes since revision 1.659: +8 -11
lines
make(1): clean up documentation for Var_Subst
Revision 1.659: download - view: text, markup, annotated - select for diffs
Thu Nov 5 17:27:16 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.658: preferred, colored
Changes since revision 1.658: +8 -8
lines
make(1): remove redundant parentheses from sizeof operator
The parentheses are only needed if the argument is a type, not an
expression.
Revision 1.658: download - view: text, markup, annotated - select for diffs
Thu Nov 5 15:04:51 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.657: preferred, colored
Changes since revision 1.657: +2 -5
lines
make(1): remove wrong comment from Var_Subst
The error handling in variable expressions is inconsistent. Some errors
are detected, most aren't. In particular, the error message for
undefined variables is _not_ issued on undefined variables but instead
on parse errors.
Revision 1.657: download - view: text, markup, annotated - select for diffs
Wed Nov 4 04:49:32 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.656: preferred, colored
Changes since revision 1.656: +8 -3
lines
make(1): negate discardUndefined to preserveUndefined
Revision 1.656: download - view: text, markup, annotated - select for diffs
Wed Nov 4 04:24:57 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.655: preferred, colored
Changes since revision 1.655: +4 -2
lines
make(1): add test for undefined variables in command line arguments
The variable discardUndefined has an implicit negation in its name,
which makes it hard to understand. Plus, most of the time it is true.
It's better to have a flag that is false most of the time and has a
positive name.
On the first attempt of inverting that variable, I stumbled upon
MainParseArgs, which initially leaves discardUndefined == FALSE, and
after handling the dashed options, sets it to TRUE. This would make a
difference when more command line arguments would be added later via the
.MAKEFLAGS special target.
Upon further inspection, the only place where discardUndefined is used
is in VarAssign_EvalSubst in parse.c, and that place is not reachable
from any of the dashed options. Therefore, discardUndefined could
already be set at the very beginning of MainParseArgs or even when
initializing the global variable itself, without any observable
difference.
Not even the ::= variable modifier could do anything about this since it
is not reachable from the dashed command line options as well, and in
addition, it expands its right-hand side in any case, always discarding
undefined variables. Oh, these little inconsistencies everywhere.
Revision 1.655: download - view: text, markup, annotated - select for diffs
Wed Nov 4 03:37:51 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.654: preferred, colored
Changes since revision 1.654: +3 -9
lines
make(1): rename oldVars to discardUndefined
While here, moved all the documentation about this variable into a
single place.
Revision 1.654: download - view: text, markup, annotated - select for diffs
Wed Nov 4 02:53:18 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.653: preferred, colored
Changes since revision 1.653: +4 -5
lines
make(1): remove redundant condition from ApplyModifiersIndirect
Whenever varUndefined is returned from another function, that is only
done if eflags does not contain VARE_UNDEFERR. Therefore, testing for
that flag is unnecessary.
Revision 1.653: download - view: text, markup, annotated - select for diffs
Wed Nov 4 02:26:21 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.652: preferred, colored
Changes since revision 1.652: +6 -13
lines
make(1): replace emptyString with allocated empty string
Special-casing this variable only made the code more complicated.
Furthermore, it is not related to error handling in any way and
therefore distracted the reader from this topic.
Revision 1.652: download - view: text, markup, annotated - select for diffs
Mon Nov 2 21:34:40 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.651: preferred, colored
Changes since revision 1.651: +10 -8
lines
make(1): fix error handling on parse errors in variable expressions
This change doesn't change any of the unit tests since the error
handling code is not yet complete, see the many "handle errors" in the
code. Nevertheless, the "out_FALSE_res = VPR_PARSE_MSG" was wrong since
the error message was only printed in lint mode, not in default mode.
Revision 1.651: download - view: text, markup, annotated - select for diffs
Mon Nov 2 21:24:23 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.650: preferred, colored
Changes since revision 1.650: +8 -7
lines
make(1): improve local variable name in ParseVarname
Revision 1.650: download - view: text, markup, annotated - select for diffs
Mon Nov 2 21:15:00 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.649: preferred, colored
Changes since revision 1.649: +5 -2
lines
make(1): document that skipping a modifier on parse errors is risky
Revision 1.649: download - view: text, markup, annotated - select for diffs
Mon Nov 2 20:48:36 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.648: preferred, colored
Changes since revision 1.648: +9 -2
lines
make(1): error out on unclosed expressions after the colon
Revision 1.648: download - view: text, markup, annotated - select for diffs
Mon Nov 2 19:07:09 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.647: preferred, colored
Changes since revision 1.647: +4 -4
lines
make(1): remove word "Ptr" from variable names
Whether or not a variable is a pointer is obvious from the context.
Since the introduction of function prototypes in C90, this information
is checked by the compiler and no longer needs to be encoded in the
variable names.
Revision 1.647: download - view: text, markup, annotated - select for diffs
Mon Nov 2 18:15:12 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.646: preferred, colored
Changes since revision 1.646: +3 -3
lines
make(1): fix wording of a comment in var.c
The "why again" could be easily misunderstood, it was ambiguous.
Revision 1.646: download - view: text, markup, annotated - select for diffs
Mon Nov 2 17:55:26 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.645: preferred, colored
Changes since revision 1.645: +3 -2
lines
make(1): add a comment where to fix the STOP/STORE test from varmod.mk
Revision 1.645: download - view: text, markup, annotated - select for diffs
Mon Nov 2 17:00:33 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.644: preferred, colored
Changes since revision 1.644: +11 -10
lines
make(1): format code in ApplyModifiersIndirect and ApplyModifiers
Revision 1.644: download - view: text, markup, annotated - select for diffs
Mon Nov 2 16:55:18 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.643: preferred, colored
Changes since revision 1.643: +6 -10
lines
make(1): merge variables p and nested_p in ApplyModifiersIndirect
When the code was still in ApplyModifiers, the variable nested_p was
necessary to distinguish the parsing position in the nested modifier
from the parsing position of the main expression.
Revision 1.643: download - view: text, markup, annotated - select for diffs
Mon Nov 2 16:48:49 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.642: preferred, colored
Changes since revision 1.642: +12 -12
lines
make(1): rename rval to mods in ApplyModifiersIndirect
Revision 1.642: download - view: text, markup, annotated - select for diffs
Mon Nov 2 16:38:47 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.641: preferred, colored
Changes since revision 1.641: +8 -9
lines
make(1): inline and rename variables in ApplyModifiersIndirect
Revision 1.641: download - view: text, markup, annotated - select for diffs
Sun Nov 1 23:17:40 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.640: preferred, colored
Changes since revision 1.640: +85 -59
lines
make(1): extract ApplyModifiersIndirect from ApplyModifiers
Revision 1.640: download - view: text, markup, annotated - select for diffs
Sun Nov 1 22:48:41 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.639: preferred, colored
Changes since revision 1.639: +14 -16
lines
make(1): rename local variable in ApplyModifiers
Revision 1.639: download - view: text, markup, annotated - select for diffs
Sun Nov 1 22:12:54 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.638: preferred, colored
Changes since revision 1.638: +19 -18
lines
make(1): rename local variables in ApplyModifier_SysV
Revision 1.638: download - view: text, markup, annotated - select for diffs
Sun Nov 1 21:28:42 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.637: preferred, colored
Changes since revision 1.637: +8 -6
lines
make(1): reduce number of nested parentheses in ApplyModifier_Assign
Revision 1.637: download - view: text, markup, annotated - select for diffs
Sun Nov 1 18:48:13 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.636: preferred, colored
Changes since revision 1.636: +4 -3
lines
make(1): revert unintended change from previous commit
Revision 1.636: download - view: text, markup, annotated - select for diffs
Sun Nov 1 18:45:49 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.635: preferred, colored
Changes since revision 1.635: +3 -4
lines
make(1): fix indentation of source code
Revision 1.635: download - view: text, markup, annotated - select for diffs
Sun Nov 1 14:36:25 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.634: preferred, colored
Changes since revision 1.634: +86 -21
lines
make(1): treat malformed :range, :ts and :[...] as errors
Before, integer overflow in the :[1..2] modifier had not been detected,
and the actual behavior varied between ILP64 and LP64I32 machines.
Before, the :ts modifier accepted character literals like \012345 and
\x1F600, which don't fit in a single character and were thus truncated.
Before, the :range modifier issued an "Unknown modifier" error message
for :range=x, which was not quite correct. The error message in this
case is now "Invalid number".
Revision 1.634: download - view: text, markup, annotated - select for diffs
Sun Nov 1 13:55:31 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.633: preferred, colored
Changes since revision 1.633: +3 -3
lines
make(1): add tests for the variable modifiers :[words] and :range
Revision 1.633: download - view: text, markup, annotated - select for diffs
Sun Nov 1 12:34:45 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.632: preferred, colored
Changes since revision 1.632: +7 -6
lines
make(1): clean up comments in ApplyModifier_Words
Revision 1.632: download - view: text, markup, annotated - select for diffs
Sat Oct 31 23:23:22 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.631: preferred, colored
Changes since revision 1.631: +7 -7
lines
make(1): rename parameter of Var_Value
Revision 1.631: download - view: text, markup, annotated - select for diffs
Sat Oct 31 21:40:20 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.630: preferred, colored
Changes since revision 1.630: +33 -8
lines
make(1): make parsing of the :gmtime and :localtime modifiers stricter
These variable modifiers accept an optional timestamp in seconds, to
select which date to print. This feature is only used very rarely. The
NetBSD build doesn't use it at all, and the FreeBSD build mainly uses
the plain modifiers :gmtime and :localtime, but not their optional
argument :gmtime=1500000000.
Therefore, this change is not going to affect many builds. Those that
are indeed affected had been wrong all the time anyway.
At parse time, these errors stop the build, as intended. After that,
when the actual shell commands of the targets are expanded and run,
these errors don't stop anything, the build just continues as if nothing
had happened. This is a general problem with Var_Parse, see the many
"handle errors" markers in the code. Another problem is that on parse
errors, parsing continues and spits out spurious strings of the form
"mtime" and "ocaltime". This as well is a general problem with error
handling in make.
ok sjg
Revision 1.630: download - view: text, markup, annotated - select for diffs
Sat Oct 31 18:41:07 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.629: preferred, colored
Changes since revision 1.629: +13 -13
lines
make(1): format #include directives consistently
Revision 1.629: download - view: text, markup, annotated - select for diffs
Sat Oct 31 18:17:08 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.628: preferred, colored
Changes since revision 1.628: +3 -3
lines
make(1): rename ismeta to is_shell_metachar
The old name was too broad.
Revision 1.628: download - view: text, markup, annotated - select for diffs
Sat Oct 31 18:14:59 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.627: preferred, colored
Changes since revision 1.627: +3 -6
lines
make(1): remove debug logging for the :Q variable modifier
The same information is already logged in LogAfterApply.
Revision 1.627: download - view: text, markup, annotated - select for diffs
Sat Oct 31 18:05:16 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.626: preferred, colored
Changes since revision 1.626: +6 -6
lines
make(1): fix local variable names in ParseModifierPart
Revision 1.626: download - view: text, markup, annotated - select for diffs
Sat Oct 31 15:23:52 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.625: preferred, colored
Changes since revision 1.625: +17 -26
lines
make(1): rewrite VarIsDynamic to VarnameIsDynamic
The condition for the context is the same for both short and long names,
therefore move that condition to the only caller.
Clean up the comment and move its parts to the appropriate places. The
"with the dollar sign escaped" part had been wrong already in 1993, and
it didn't get better over time.
Revision 1.625: download - view: text, markup, annotated - select for diffs
Sat Oct 31 14:55:33 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.624: preferred, colored
Changes since revision 1.624: +17 -20
lines
make(1): rename local variable freePtr in Var_Parse
Revision 1.624: download - view: text, markup, annotated - select for diffs
Sat Oct 31 14:47:32 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.623: preferred, colored
Changes since revision 1.623: +28 -25
lines
make(1): use consistent parameter order in varname parsing functions
Revision 1.623: download - view: text, markup, annotated - select for diffs
Sat Oct 31 14:40:34 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.622: preferred, colored
Changes since revision 1.622: +148 -101
lines
make(1): extract ParseVarnameLong from Var_Parse
Revision 1.622: download - view: text, markup, annotated - select for diffs
Sat Oct 31 14:12:01 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.621: preferred, colored
Changes since revision 1.621: +52 -32
lines
make(1): extract ParseVarnameShort from Var_Parse
With its more than 200 lines, the latter has too much code to be read
easily.
Revision 1.621: download - view: text, markup, annotated - select for diffs
Sat Oct 31 12:59:28 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.620: preferred, colored
Changes since revision 1.620: +3 -3
lines
make(1): fix type of ParseModifierPart parameter delim
Revision 1.620: download - view: text, markup, annotated - select for diffs
Sat Oct 31 12:57:39 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.619: preferred, colored
Changes since revision 1.619: +21 -13
lines
make(1): extract IsEscapedModifierPart from ParseModifierPart
Revision 1.619: download - view: text, markup, annotated - select for diffs
Sat Oct 31 12:45:42 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.618: preferred, colored
Changes since revision 1.618: +24 -28
lines
make(1): clean up ModifyWords
Reorder the parameters to match the documentation comment, and the
remaining parameters in chronological order. Remove the unused
parameter ctxt. The callbacks that need it pass it in their
modifyWordArgs instead.
Revision 1.618: download - view: text, markup, annotated - select for diffs
Sat Oct 31 12:34:03 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.617: preferred, colored
Changes since revision 1.617: +4 -4
lines
make(1): add test for combining the :@ and :? variable modifiers
Revision 1.617: download - view: text, markup, annotated - select for diffs
Sat Oct 31 12:22:43 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.616: preferred, colored
Changes since revision 1.616: +3 -3
lines
make(1): remove redundant condition for regmatch_t.rm_eo being -1
If rm_so is -1, rm_eo is guaranteed to be -1 as well.
Revision 1.616: download - view: text, markup, annotated - select for diffs
Sat Oct 31 11:54:33 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.615: preferred, colored
Changes since revision 1.615: +11 -2
lines
make(1): do not look up local variables like .TARGET anywhere else
Nobody defines a global variable named .TARGET since that would have
many unpredictable effects, applying to all targets at once.
Nobody defines an environment variable named .TARGET since that's
against the naming conventions for environment variables and would have
the same effect.
Because of this, there is no point looking up the variables that are
local to a GNode anywhere else. This means they cannot come from the
environment and thus their value doesn't need to be freed after use,
which makes the code simpler.
The newly added accessor functions in make.h refer to external
functions, but since that header is not used anywhere outside of
usr.bin/make, it doesn't matter. Between 2020-08-25 and 2020-10-30,
that header had been referenced by usr.bin/xinstall.
Revision 1.615: download - view: text, markup, annotated - select for diffs
Sat Oct 31 11:34:30 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.614: preferred, colored
Changes since revision 1.614: +5 -9
lines
make(1): reduce the scope where recursive expressions are detected
Only the call to Var_Subst needs to be protected since the other
functions have nothing to do with expanding variables.
Revision 1.614: download - view: text, markup, annotated - select for diffs
Sat Oct 31 09:57:47 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.613: preferred, colored
Changes since revision 1.613: +4 -4
lines
make(1): fix indentation in source code
Revision 1.613: download - view: text, markup, annotated - select for diffs
Sat Oct 31 09:27:19 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.612: preferred, colored
Changes since revision 1.612: +3 -3
lines
make(1): remove redundant null check from s2Boolean
Revision 1.612: download - view: text, markup, annotated - select for diffs
Sat Oct 31 09:03:36 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.611: preferred, colored
Changes since revision 1.611: +2 -7
lines
make(1): remove redundant code branch in SysVMatch
The general code path of parsing :from=to achieves the same effect.
Revision 1.611: download - view: text, markup, annotated - select for diffs
Sat Oct 31 08:40:54 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.610: preferred, colored
Changes since revision 1.610: +9 -15
lines
make(1): merge duplicate code in ModifyWord_Subst
Revision 1.610: download - view: text, markup, annotated - select for diffs
Fri Oct 30 22:55:34 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.609: preferred, colored
Changes since revision 1.609: +14 -18
lines
make(1): rename Str_SYSVMatch and its parameters
Revision 1.609: download - view: text, markup, annotated - select for diffs
Fri Oct 30 22:49:07 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.608: preferred, colored
Changes since revision 1.608: +12 -9
lines
make(1): improve variable name in Var_Value, document callback
Revision 1.608: download - view: text, markup, annotated - select for diffs
Fri Oct 30 22:43:39 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.607: preferred, colored
Changes since revision 1.607: +7 -10
lines
make(1): remove unsatisfiable conditions in Var_Set_with_flags
Revision 1.607: download - view: text, markup, annotated - select for diffs
Fri Oct 30 22:30:42 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.606: preferred, colored
Changes since revision 1.606: +13 -8
lines
make(1): document where the variable name is expanded
Revision 1.606: download - view: text, markup, annotated - select for diffs
Fri Oct 30 20:30:44 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.605: preferred, colored
Changes since revision 1.605: +3 -3
lines
make(1): change char * to void * in Var_Value
The only purpose of the parameter freeIt is to free the memory
associated with the return value. To do this, no pointer arithmetic is
needed. Therefore, change to a void pointer, to catch accidental use of
that pointer.
Revision 1.605: download - view: text, markup, annotated - select for diffs
Fri Oct 30 17:10:48 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.604: preferred, colored
Changes since revision 1.604: +22 -30
lines
make(1): clean up comments and local variables in var.c
Revision 1.604: download - view: text, markup, annotated - select for diffs
Fri Oct 30 16:54:38 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.603: preferred, colored
Changes since revision 1.603: +6 -6
lines
make(1): fix documentation for VARP_SUB_ONE
The pattern is only replaced a single time, not everywhere in the first
matching word.
Revision 1.603: download - view: text, markup, annotated - select for diffs
Fri Oct 30 16:48:58 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.602: preferred, colored
Changes since revision 1.602: +6 -8
lines
make(1): make iterating over HashTable simpler
Revision 1.602: download - view: text, markup, annotated - select for diffs
Fri Oct 30 16:45:37 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.601: preferred, colored
Changes since revision 1.601: +5 -5
lines
make(1): rename VAR_EXPORTED_YES to VAR_EXPORTED_SOME
The "yes" sounded too much like "all".
Revision 1.601: download - view: text, markup, annotated - select for diffs
Fri Oct 30 16:16:16 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.600: preferred, colored
Changes since revision 1.600: +11 -3
lines
make(1): document VAR_READONLY, now that it is really read-only
Revision 1.600: download - view: text, markup, annotated - select for diffs
Fri Oct 30 16:09:56 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.599: preferred, colored
Changes since revision 1.599: +4 -2
lines
make(1): prevent appending to read-only variables
Revision 1.599: download - view: text, markup, annotated - select for diffs
Fri Oct 30 15:39:17 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.598: preferred, colored
Changes since revision 1.598: +15 -15
lines
make(1): fix indentation in source code
Revision 1.598: download - view: text, markup, annotated - select for diffs
Fri Oct 30 15:28:38 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.597: preferred, colored
Changes since revision 1.597: +22 -15
lines
make(1): extract MayExport from Var_Export1
Revision 1.597: download - view: text, markup, annotated - select for diffs
Fri Oct 30 07:47:11 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.596: preferred, colored
Changes since revision 1.596: +8 -6
lines
make(1): remove redundant evaluations in VarFind
Revision 1.596: download - view: text, markup, annotated - select for diffs
Fri Oct 30 07:37:30 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.595: preferred, colored
Changes since revision 1.595: +13 -21
lines
make(1): replace VarFindFlags with a simple Boolean
Either all flags had been given or none. Except in Var_Append, but
since the ctxt was VAR_GLOBAL anyway, adding FIND_GLOBAL there did not
make a difference.
Revision 1.595: download - view: text, markup, annotated - select for diffs
Fri Oct 30 07:30:29 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.594: preferred, colored
Changes since revision 1.594: +10 -12
lines
make(1): rename FIND_CMD to FIND_CMDLINE, to match VAR_CMDLINE
While here, use a consistent order for the enum constants. This is both
the declaration order and at the same time the usual lookup order,
unless the -e option is given.
Revision 1.594: download - view: text, markup, annotated - select for diffs
Fri Oct 30 07:19:30 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.593: preferred, colored
Changes since revision 1.593: +26 -26
lines
make(1): rename VAR_CMD to VAR_CMDLINE
Since make has to do with both the command line and child commands, the
former name was confusing.
Revision 1.593: download - view: text, markup, annotated - select for diffs
Fri Oct 30 06:59:12 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.592: preferred, colored
Changes since revision 1.592: +7 -6
lines
make(1): rename SAVE_DOLLARS to follow the naming conventions
Revision 1.592: download - view: text, markup, annotated - select for diffs
Fri Oct 30 06:44:57 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.591: preferred, colored
Changes since revision 1.591: +33 -25
lines
make(1): clean up and update module comment in var.c
Revision 1.591: download - view: text, markup, annotated - select for diffs
Tue Oct 27 07:16:27 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.590: preferred, colored
Changes since revision 1.590: +3 -3
lines
make(1): initialize all CmdOpts fiels
Revision 1.590: download - view: text, markup, annotated - select for diffs
Mon Oct 26 21:34:10 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.589: preferred, colored
Changes since revision 1.589: +5 -5
lines
make(1): group the command line options and arguments
By having a single struct that holds all command line options and
arguments, it is easy to see in the code when such a command line
argument is modified. It also cleans up the namespace since the command
line options don't follow a common naming style. Having them in a
struct also means that there is a single place for putting the
documentation, not two as before.
The struct also suggests to extract the initialization code out of main,
which is still too large, having more than 400 lines of code and
covering far too many topics.
Revision 1.589: download - view: text, markup, annotated - select for diffs
Sun Oct 25 21:51:49 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.588: preferred, colored
Changes since revision 1.588: +3 -3
lines
make(1): add GNode_Path to access the path of a GNode
Revision 1.588: download - view: text, markup, annotated - select for diffs
Sun Oct 25 19:19:07 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.587: preferred, colored
Changes since revision 1.587: +13 -13
lines
make(1): rename hash functions to identify the type name
This makes it easier to spot mismatches between the function name and
its first parameter, although the compiler should already catch most of
them. Except for void pointers.
Revision 1.587: download - view: text, markup, annotated - select for diffs
Sun Oct 25 19:11:30 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.586: preferred, colored
Changes since revision 1.586: +14 -8
lines
make(1): reduce duplicate code in VarFind
Revision 1.586: download - view: text, markup, annotated - select for diffs
Sun Oct 25 17:01:05 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.585: preferred, colored
Changes since revision 1.585: +10 -8
lines
make(1): reduce amount of string hashing
In pkgsrc, running "bmake show-all" in pkgtools/pkglint called the hash
function 249130 times before, and only 115502 times after.
Still, a single call to Var_Set hashes the same string 3 times.
Revision 1.585: download - view: text, markup, annotated - select for diffs
Sun Oct 25 13:06:12 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.584: preferred, colored
Changes since revision 1.584: +11 -9
lines
make(1): replace PtrVector with Vector, which can contain any type
Revision 1.584: download - view: text, markup, annotated - select for diffs
Sun Oct 25 12:08:53 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.583: preferred, colored
Changes since revision 1.583: +6 -6
lines
make(1): rename type Vector to PtrVector
This allows the name Vector to be used for a more generic vector type,
which will be added soon.
Revision 1.583: download - view: text, markup, annotated - select for diffs
Sat Oct 24 20:51:49 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.582: preferred, colored
Changes since revision 1.582: +10 -9
lines
make(1): remove macros MIN and MAX
These macros typically evaluate one of their arguments twice. Until
2020-08-31, they had not parenthesized their arguments properly. They
are only used in a few places, therefore it doesn't hurt much to have
them expanded.
Revision 1.582: download - view: text, markup, annotated - select for diffs
Fri Oct 23 13:38:17 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.581: preferred, colored
Changes since revision 1.581: +7 -7
lines
make(1): move comment in Var_Set_with_flags
Until 2000-05-11, that comment was just above a VarFind call. 20 years
later, it is back again where it belongs.
Revision 1.581: download - view: text, markup, annotated - select for diffs
Thu Oct 22 05:50:02 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.580: preferred, colored
Changes since revision 1.580: +3 -3
lines
make(1): remove redundant type casts
This mainly affects the void pointers in callback functions for lists.
These had been necessary once when the parameter type was still
ClientData instead of void pointer.
Revision 1.580: download - view: text, markup, annotated - select for diffs
Thu Oct 22 05:35:21 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.579: preferred, colored
Changes since revision 1.579: +40 -36
lines
make(1): extract CanonicalVarname from VarFind
Revision 1.579: download - view: text, markup, annotated - select for diffs
Tue Oct 20 23:15:23 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.578: preferred, colored
Changes since revision 1.578: +6 -2
lines
make(1): document parameter to Var_Parse
Revision 1.578: download - view: text, markup, annotated - select for diffs
Sun Oct 18 17:19:54 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.577: preferred, colored
Changes since revision 1.577: +8 -8
lines
make(1): add tags to enum types
This allows IDEs to offer better type information than "anonymous enum".
Revision 1.577: download - view: text, markup, annotated - select for diffs
Sun Oct 18 12:47:43 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.576: preferred, colored
Changes since revision 1.576: +5 -5
lines
make(1): rename HashEntry.name to key
Revision 1.576: download - view: text, markup, annotated - select for diffs
Sun Oct 18 12:36:43 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.575: preferred, colored
Changes since revision 1.575: +8 -8
lines
make(1): remove underscore from Hash_Table and Hash_Entry
For consistency with the other type names, such as GNodeListNode.
Revision 1.575: download - view: text, markup, annotated - select for diffs
Sun Oct 18 10:44:25 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.574: preferred, colored
Changes since revision 1.574: +15 -15
lines
make(1): make API for iterating over hash tables simpler
Revision 1.574: download - view: text, markup, annotated - select for diffs
Sun Oct 18 08:58:29 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.573: preferred, colored
Changes since revision 1.573: +6 -6
lines
make(1): rename Stack to Vector
Both Var_Dump and GetActuallyIncludingFile access more than only the top
item of the stack, therefore it is more honest to rename the data type.
Revision 1.573: download - view: text, markup, annotated - select for diffs
Sun Oct 18 08:47:54 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.572: preferred, colored
Changes since revision 1.572: +23 -13
lines
make(1): sort variables in debug output
This way it's easier to see whether an expected variable is missing, or
to compare the values of related variables, since they usually share a
common prefix. Any sorting criterion is better than the hash code.
Sorting the variables by name changed the order of the output in
varname.mk. That test didn't test anything meaningful, it was just a
playground to understand and demonstrate the current implementation of
how the variables are stored, therefore it has been removed.
Revision 1.572: download - view: text, markup, annotated - select for diffs
Sat Oct 17 21:32:30 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.571: preferred, colored
Changes since revision 1.571: +4 -4
lines
make(1): normalize initialization and cleanup of the modules
Revision 1.571: download - view: text, markup, annotated - select for diffs
Sat Oct 17 17:47:14 2020 UTC (4 years, 1 month ago) by rillig
Branches: MAIN
Diff to: previous 1.570: preferred, colored
Changes since revision 1.570: +15 -15
lines
make(1): fix indentation
Revision 1.570: download - view: text, markup, annotated - select for diffs
Tue Oct 6 08:13:27 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.569: preferred, colored
Changes since revision 1.569: +40 -30
lines
make(1): rework memory allocation for the name of variables
There's more to know about variable names than fits in a one-liner.
While here, enforce that the name is not modified by splitting it into
the established (var + var_freeIt) pattern.
Since the name is not modified and not freed in the middle of evaluating
an expression, there is no need to make a backup copy of it. That code
had been necessary more than 12 years ago, but not anymore since the
code got a lot cleaner since then.
Revision 1.569: download - view: text, markup, annotated - select for diffs
Tue Oct 6 07:52:47 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.568: preferred, colored
Changes since revision 1.568: +19 -31
lines
make(1): remove duplicate code for creating variables
Revision 1.568: download - view: text, markup, annotated - select for diffs
Mon Oct 5 19:39:30 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.567: preferred, colored
Changes since revision 1.567: +3 -3
lines
make(1): fix compilation with GCC 10 and -Wimplicit-fallthrough=4
Revision 1.567: download - view: text, markup, annotated - select for diffs
Mon Oct 5 19:27:47 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.566: preferred, colored
Changes since revision 1.566: +53 -27
lines
make(1): revert previous commit
It had accidentally reverted all the work from the past few days.
Revision 1.566: download - view: text, markup, annotated - select for diffs
Mon Oct 5 19:24:29 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.565: preferred, colored
Changes since revision 1.565: +27 -53
lines
make(1): fix double-free bug in -DCLEANUP mode (since 2020-10-02)
The bug had been introduced with dir.c 1.155 on 2020-10-02 22:20:25. In
that commit, openDirectories was replaced with a combination of a list
with a hash table, for more efficient lookup by name.
Upon cleanup, OpenDirs_Done is called, which in turn called
Dir_ClearPath. Dir_ClearPath takes full ownership of the given list and
empties it. This was no problem before since afterwards the list was
empty and calling Lst_Free just frees the remaining list pointer.
With OpenDirs, this list was combined with a hash table, and the hash
table contains the list nodes, assuming that the OpenDirs functions have
full ownership of both the list and the hash table. This assumption was
generally correct, except for the one moment during cleanup where full
ownership of the list was passed to Dir_ClearPath, while the hash table
still contained pointers to the (now freed) list nodes. This by itself
was not a problem since the hash table would be freed afterwards. But
as part of Dir_ClearPath, OpenDirs_Remove was called, which looked up
the freed directory by name and now found the freed list node, trying to
free it again. Boom.
Fixed by replacing the call to Dir_ClearPath with code that only frees
the directories, without giving up control over the list.
Revision 1.565: download - view: text, markup, annotated - select for diffs
Sun Oct 4 10:35:25 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.564: preferred, colored
Changes since revision 1.564: +3 -7
lines
make(1): only use the VARE_ASSIGN flag if necessary
When checking the right-hand side of a variable assignment for syntax
errors, it does not matter whether a '$$' is expanded to '$' or kept as
'$$'.
Revision 1.564: download - view: text, markup, annotated - select for diffs
Sat Oct 3 21:19:54 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.563: preferred, colored
Changes since revision 1.563: +3 -4
lines
make(1): use consistent pattern for parsing whitespace
The pp and cpp in the function names stand for "parsing position" and
"const parsing position".
Revision 1.563: download - view: text, markup, annotated - select for diffs
Sat Oct 3 14:41:20 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.562: preferred, colored
Changes since revision 1.562: +6 -3
lines
make(1): inline Str_FindSubstring in ModifyWord_Subst
Revision 1.562: download - view: text, markup, annotated - select for diffs
Sat Oct 3 12:51:49 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.561: preferred, colored
Changes since revision 1.561: +13 -6
lines
make(1): extract ApplyModifier_Literal into separate function
Revision 1.561: download - view: text, markup, annotated - select for diffs
Sat Oct 3 12:46:52 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.560: preferred, colored
Changes since revision 1.560: +14 -8
lines
make(1): extract ApplyModifier_Unique into separate function
Revision 1.560: download - view: text, markup, annotated - select for diffs
Sat Oct 3 12:30:17 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.559: preferred, colored
Changes since revision 1.559: +17 -4
lines
make(1): in lint mode, reject modifiers without delimiter
The expression ${VAR:LPL} must now be written as ${VAR:L:P:L}. The
manual page has never documented that some modifiers don't need to be
delimited by ':' and others need to. That would have been unnecessarily
confusing anyway.
Revision 1.559: download - view: text, markup, annotated - select for diffs
Sat Oct 3 10:42:08 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.558: preferred, colored
Changes since revision 1.558: +4 -4
lines
make(1): ignore -env and -literal in assignments to .MAKE.EXPORTED
Previously, assigning the string "-env" to the variable .MAKE.EXPORTED
had the same effect as the .export-env directive. This was only due to
a sloppy implementation, not by design.
For the string "-literal" and the directive .export-literal, the
situation was even worse since the actually executed code was a wild
mixture between .export and .export-literal that in the end exported the
expanded form of the variable. Therefore there was no practical use
case of this implementation flaw.
Revision 1.558: download - view: text, markup, annotated - select for diffs
Sat Oct 3 10:31:05 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.557: preferred, colored
Changes since revision 1.557: +4 -2
lines
make(1): do not export variable names starting with '-'
By convention, names of environment variables consist of uppercase
letters and underscores. Most of them start with an uppercase letter.
In a few cases, the names also contain lowercase letters, such as in
http_proxy.
Variable names starting with a hyphen are confusing and might be
mistaken as command line options. Therefore don't export these.
This also affects a few edge cases that don't occur in practice, such as
setting .MAKE.EXPORTED=-env or .MAKE.EXPORTED=-literal. These had not
worked as expected anyway.
Revision 1.557: download - view: text, markup, annotated - select for diffs
Sat Oct 3 10:13:39 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.556: preferred, colored
Changes since revision 1.556: +5 -5
lines
make(1): clean up confusing code in Var_Export
The generated code stays exactly the same.
Revision 1.556: download - view: text, markup, annotated - select for diffs
Fri Oct 2 17:42:33 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.555: preferred, colored
Changes since revision 1.555: +22 -14
lines
make(1): in ApplyModifier_To, update pp in each branch
Before, the parsing position was updated once at the beginning, which
didn't make sense. Updating it in each branch allows to decide for its
appropriate value in each branch individually.
Revision 1.555: download - view: text, markup, annotated - select for diffs
Wed Sep 30 06:46:43 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.554: preferred, colored
Changes since revision 1.554: +15 -8
lines
make(1): extract ApplyModifier_Quote into separate function
Revision 1.554: download - view: text, markup, annotated - select for diffs
Wed Sep 30 05:58:22 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.553: preferred, colored
Changes since revision 1.553: +3 -3
lines
make(1): fix bug in evaluation of indirect variable modifiers
Since 2020-09-22, when indirect variable modifiers were applied to a
variable expression based on an undefined variable, these modifiers did
not change the state of a variable expression from undefined to defined.
The modifiers that do this are :D, :U, :L, :P. Minimal example:
${VARNAME:${:UL}}
The :L modifier from the inner expression sets the value of the outer
expression to its variable name, in this case "VARNAME". The outer
expression was not marked as being defined though, which resulted in a
"Malformed conditional" error.
In the commit from 2020-09-22, vardebug.exp had changed a lot, and I had
not inspected the change closely. The important detail was in lines 56
and 60, where VAR_JUNK|VAR_KEEP changed into VEF_UNDEF, thereby losing
the VEF_DEF bit.
Revision 1.553: download - view: text, markup, annotated - select for diffs
Tue Sep 29 19:20:08 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.552: preferred, colored
Changes since revision 1.552: +4 -4
lines
make(1): rename ShortVarValue to UndefinedShortVarValue
Revision 1.552: download - view: text, markup, annotated - select for diffs
Tue Sep 29 18:44:30 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.551: preferred, colored
Changes since revision 1.551: +2 -4
lines
make(1): remove unused assignments to local variables
These only became obvious once ApplyModifier had been extracted, which
shrank the source code of ApplyModifiers by about 100 lines.
Even GCC 5 had seen that they are redundant and had not generated any
code for them.
Revision 1.551: download - view: text, markup, annotated - select for diffs
Tue Sep 29 18:31:39 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.550: preferred, colored
Changes since revision 1.550: +82 -101
lines
make(1): extract ApplyModifier from ApplyModifiers
This allows a return, instead of a variable assignment followed by a
break, saving a few lines of source code.
The size of the resulting binary shrinks as well, even though the code
is essentially the same as before.
Revision 1.550: download - view: text, markup, annotated - select for diffs
Mon Sep 28 22:23:35 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.549: preferred, colored
Changes since revision 1.549: +21 -23
lines
make(1): make debug logging simpler
This avoids referring to the debug_file variable in many places where
this implementation detail is not necessary.
Revision 1.549: download - view: text, markup, annotated - select for diffs
Mon Sep 28 21:11:05 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.548: preferred, colored
Changes since revision 1.548: +50 -40
lines
make(1): extract logging from ApplyModifiers into separate functions
These two logging blocks are massive enough to disturb the reading flow
of the remaining code.
Even without these two blocks, ApplyModifiers is still 250 lines long,
which is quite much.
Revision 1.548: download - view: text, markup, annotated - select for diffs
Mon Sep 28 21:01:53 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.547: preferred, colored
Changes since revision 1.547: +24 -14
lines
make(1): move variable modifier :sh into separate function
Revision 1.547: download - view: text, markup, annotated - select for diffs
Mon Sep 28 20:55:20 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.546: preferred, colored
Changes since revision 1.546: +55 -55
lines
make(1): make debug logging in var.c compatible to C90
The ... ellipsis for macros is only available since C99.
Revision 1.546: download - view: text, markup, annotated - select for diffs
Sun Sep 27 21:35:16 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.545: preferred, colored
Changes since revision 1.545: +32 -32
lines
make(1): normalize whitespace in source code
There is no more space tab. Either only tabs or only spaces or tabs
followed by spaces, but not spaces followed by tabs.
Revision 1.545: download - view: text, markup, annotated - select for diffs
Sun Sep 27 16:52:22 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.544: preferred, colored
Changes since revision 1.544: +5 -5
lines
make(1): rename Buf_Size to Buf_Len
The new name better matches the field name Buffer.len as well as the
variables around the calls to this function.
Revision 1.544: download - view: text, markup, annotated - select for diffs
Sun Sep 27 16:10:07 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.543: preferred, colored
Changes since revision 1.543: +4 -5
lines
make(1): replace direct access to Buffer fields with inline function
This way, renaming the fields of the buffer is restricted to only buf.h
and buf.c.
Revision 1.543: download - view: text, markup, annotated - select for diffs
Sat Sep 26 16:00:12 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.542: preferred, colored
Changes since revision 1.542: +3 -3
lines
make(1): clean up API for finding and creating GNodes
The previous API had complicated rules for the cases in which the single
function returned NULL or what it did. The flags for that function were
confusing since passing TARG_NOHASH would create a new node even though
TARG_CREATE was not included in that bit mask.
Splitting the function into 3 separate functions avoids this confusion.
It also reveals several places where the complicated API led to
unreachable code. Such code has been removed.
Revision 1.542: download - view: text, markup, annotated - select for diffs
Sat Sep 26 14:48:31 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.541: preferred, colored
Changes since revision 1.541: +12 -18
lines
make(1): add Hash_FindValue, for direct access to hash table data
Revision 1.541: download - view: text, markup, annotated - select for diffs
Fri Sep 25 15:54:51 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.540: preferred, colored
Changes since revision 1.540: +22 -21
lines
make(1): add tags to some of the unnamed structs
The tags prevent the structs from accidentally becoming compatible
types.
While here, remove a few typedefs for structs that are single-purpose,
since there is no point in abstracting from the actual representation of
these types.
Revision 1.540: download - view: text, markup, annotated - select for diffs
Fri Sep 25 14:10:09 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.539: preferred, colored
Changes since revision 1.539: +3 -3
lines
make(1): fix type of local variable in ParseModifierPart
Thanks, Clang-Tidy.
Revision 1.539: download - view: text, markup, annotated - select for diffs
Fri Sep 25 14:07:12 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.538: preferred, colored
Changes since revision 1.538: +3 -3
lines
make(1): fix type of local variable in ApplyModifiers
Thanks, Clang-Tidy.
Revision 1.538: download - view: text, markup, annotated - select for diffs
Fri Sep 25 06:06:15 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.537: preferred, colored
Changes since revision 1.537: +6 -2
lines
make(1): document expansion of undefined variables in Var_Subst
From reading the code alone, it is not obvious what effects this
innocent-looking code has.
Revision 1.537: download - view: text, markup, annotated - select for diffs
Fri Sep 25 05:04:51 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.536: preferred, colored
Changes since revision 1.536: +18 -17
lines
make(1): rename local variables in Var_Subst
The variable name "str" did not make it clear enough that the pointer is
constantly moving, to parse the given string. The name "p" expresses
this more clearly.
Revision 1.536: download - view: text, markup, annotated - select for diffs
Wed Sep 23 07:50:58 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.535: preferred, colored
Changes since revision 1.535: +37 -37
lines
make(1): fix unexpected behavior in ::= variable modifier
Previously, the ::= modifier had returned an error value, which caused
the variable expression to be preserved. This behavior was not useful
in this case; it had only been intended to be used for undefined
variables.
To fix it, distinguish between parse errors, undefined variables and
regular empty strings.
Revision 1.535: download - view: text, markup, annotated - select for diffs
Wed Sep 23 04:27:39 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.534: preferred, colored
Changes since revision 1.534: +13 -23
lines
make(1): inline local variable delim
Now that ParseModifierPart generates the error message itself, there is
no need to keep this variable around since it is read a single time.
Revision 1.534: download - view: text, markup, annotated - select for diffs
Tue Sep 22 20:23:57 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.533: preferred, colored
Changes since revision 1.533: +3 -7
lines
make(1): condense code in Var_Subst
Revision 1.533: download - view: text, markup, annotated - select for diffs
Tue Sep 22 20:19:46 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.532: preferred, colored
Changes since revision 1.532: +45 -22
lines
make(1): prepare Var_Subst for proper error handling
Returning a VarParseResult instead of a string makes it possible to let
the error bubble up, until it reaches the main expression.
Revision 1.532: download - view: text, markup, annotated - select for diffs
Tue Sep 22 19:08:47 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.531: preferred, colored
Changes since revision 1.531: +2 -8
lines
make(1): remove obsolete fix for PR bin/29985
Revision 1.531: download - view: text, markup, annotated - select for diffs
Tue Sep 22 18:07:58 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.530: preferred, colored
Changes since revision 1.530: +52 -43
lines
make(1): prepare error handling in nested variable expressions
Having ParseModifierPart return VarParseResult allows to report the
errors from nested variable expressions.
Revision 1.530: download - view: text, markup, annotated - select for diffs
Tue Sep 22 17:51:06 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.529: preferred, colored
Changes since revision 1.529: +17 -48
lines
make(1): handle errors about missing delimiter in a single place
Revision 1.529: download - view: text, markup, annotated - select for diffs
Tue Sep 22 17:42:57 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.528: preferred, colored
Changes since revision 1.528: +153 -152
lines
make(1): move ParseModifierPart further down in the code
This way, it can access the ApplyModifierState, which will be used in a
follow-up commit to reduce the code duplication around the error
handling for missing delimiters.
Revision 1.528: download - view: text, markup, annotated - select for diffs
Tue Sep 22 06:23:33 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.527: preferred, colored
Changes since revision 1.527: +11 -14
lines
make(1): remove remaining references to VAR_JUNK and VAR_KEEP
Revision 1.527: download - view: text, markup, annotated - select for diffs
Tue Sep 22 06:13:38 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.526: preferred, colored
Changes since revision 1.526: +57 -35
lines
make(1): move VAR_JUNK and VAR_KEEP away from VarFlags
These two flags have nothing to do with a variable. They are only used
while evaluating a variable expression.
While here, rename the flags and make their documentation more precise.
Revision 1.526: download - view: text, markup, annotated - select for diffs
Tue Sep 22 06:06:18 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.525: preferred, colored
Changes since revision 1.525: +12 -12
lines
make(1): rename VarParseErrors to VarParseResult
The name VPE_OK was confusing since it was not an error at all.
Revision 1.525: download - view: text, markup, annotated - select for diffs
Tue Sep 22 05:55:49 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.524: preferred, colored
Changes since revision 1.524: +15 -12
lines
make(1): extract common code from the ApplyModifier functions
Revision 1.524: download - view: text, markup, annotated - select for diffs
Tue Sep 22 04:05:41 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.523: preferred, colored
Changes since revision 1.523: +3 -3
lines
make(1): use fine-grained type names for lists and their nodes
This is only intended to help the human reader. There is no additional
type safety yet.
Revision 1.523: download - view: text, markup, annotated - select for diffs
Mon Sep 21 05:28:26 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.522: preferred, colored
Changes since revision 1.522: +4 -4
lines
make(1): clean up VarParseErrors, for proper error handling
Having a pure bitset was wrong.
Instead, there are several alternatives (parse error, eval error, undef
error), and each of them can either have an error message printed (good)
or not (bad). In addition, there are VPE_OK for successful expression
evaluation and VPE_UNKNOWN (only used during migration to the correct
error handling scheme).
Revision 1.522: download - view: text, markup, annotated - select for diffs
Mon Sep 14 21:55:53 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.521: preferred, colored
Changes since revision 1.521: +5 -3
lines
make(1): fix wrong error for undefined variables in lint mode
Revision 1.521: download - view: text, markup, annotated - select for diffs
Mon Sep 14 20:43:44 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.520: preferred, colored
Changes since revision 1.520: +7 -12
lines
make(1): inline character constants in var.c
This removes a level of indirection, and the macro names were quite
similar in appearance as well. The macros may have been used by people
whose editors don't recognize C string and character literals when
navigating to the corresponding brace or parenthesis. These editors had
already been confused before this commit since there are also string
literals with unbalanced parentheses, and there are far fewer
compensating comments such as /*{*/ or /*)*/ in the code. In fact, the
only such comment that is left over was in for.c.
This way, there is now a single consistent way of writing these
character literals, which is without macros or comments, since that is
the simplest form.
Revision 1.520: download - view: text, markup, annotated - select for diffs
Mon Sep 14 07:04:56 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.519: preferred, colored
Changes since revision 1.519: +6 -3
lines
make(1): don't require nested variables to be defined in conditions
This code only applies to lint mode (-dL) for now. After a test phase
and a thorough check for possible side effects, it will be activated in
normal mode, too. Having this code in lint mode is required to run
src/build.sh, which relies a lot on using variables with undefined
nested variables in conditions.
In the default mode, any errors about nested undefined variables are not
printed since in Var_Subst, oldVars is true. Therefore, it is not urgent
to properly handle these nested variables correctly there.
Revision 1.519: download - view: text, markup, annotated - select for diffs
Sun Sep 13 21:03:14 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.518: preferred, colored
Changes since revision 1.518: +7 -5
lines
make(1): in Var_Parse, replace bmake_strldup with bmake_strsedup
Revision 1.518: download - view: text, markup, annotated - select for diffs
Sun Sep 13 20:21:24 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.517: preferred, colored
Changes since revision 1.517: +19 -5
lines
make(1): in lint mode, report undefined variables in conditions
Revision 1.517: download - view: text, markup, annotated - select for diffs
Sun Sep 13 19:46:23 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.516: preferred, colored
Changes since revision 1.516: +7 -5
lines
make(1): suppress wrong "Malformed conditional" for undefined variables
This only has an effect in lint mode right now.
Revision 1.516: download - view: text, markup, annotated - select for diffs
Sun Sep 13 19:28:46 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.515: preferred, colored
Changes since revision 1.515: +6 -4
lines
make(1): in lint mode, improve error handling for undefined variables
It's a first step for improving the error message that make prints.
Revision 1.515: download - view: text, markup, annotated - select for diffs
Sun Sep 13 19:16:22 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.514: preferred, colored
Changes since revision 1.514: +3 -5
lines
make(1): make documentation of VarParseErrors more precise
Revision 1.514: download - view: text, markup, annotated - select for diffs
Sun Sep 13 18:27:39 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.513: preferred, colored
Changes since revision 1.513: +37 -19
lines
make(1): prepare Var_Parse for proper error handling and reporting
Right now, Var_Parse swallows many errors during parsing and evaluation.
Ideally, these errors should propagate from the deeply nested
expressions where they occur up to the top-level expressions. When such
an error occurs, the depending expressions should not be evaluated any
further. They may still be parsed, but side effects should be
minimized.
The goal is to prevent incomplete expressions like the "xy}" in
moderrs.exp:106 from being evaluated and eventually passed to the shell
for execution. This expression is a left-over from a parse error in the
mod-t-parse target in moderrs.mk:154.
This commit is a first step in analyzing and verifying the current state
of affairs. The modelling in VarParseErrors already looks complicated
but is expected to closely match reality.
Revision 1.513: download - view: text, markup, annotated - select for diffs
Sun Sep 13 16:47:24 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.512: preferred, colored
Changes since revision 1.512: +4 -6
lines
make(1): shorten debug output of ApplyModifiers
Having the words "eflags" and "vflags" in the debug output was too
repetitive. That they are flags is made obvious by the '|' separator,
and the flags have clearly distinguishable names (VARE_* vs. VAR_*),
which lowers the chance for confusion.
Revision 1.512: download - view: text, markup, annotated - select for diffs
Sun Sep 13 15:15:51 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.511: preferred, colored
Changes since revision 1.511: +4 -14
lines
make(1): clean up RCSID blocks
These blocks mostly consisted of redundant structure, following the same
#ifndef pattern over and over, with only minimal variation.
It's easier to maintain if the common structure is only written once and
encapsulated in a macro.
To avoid "defined but unused" warnings from GCC in the case where
MAKE_NATIVE is not defined, I had to add volatile. Adding
MAKE_ATTR_UNUSED alone would not preserve the rcsid variable in the
resulting binary.
Revision 1.511: download - view: text, markup, annotated - select for diffs
Sun Sep 13 13:50:27 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.510: preferred, colored
Changes since revision 1.510: +4 -4
lines
make(1): clean up API for evaluating conditions
There was no need to make struct If publicly visible.
There was no need to have parameters in the public API that were passed
the same constants all the time.
The former function names had not been distinctive.
Revision 1.510: download - view: text, markup, annotated - select for diffs
Sun Sep 13 09:35:09 2020 UTC (4 years, 2 months ago) by martin
Branches: MAIN
Diff to: previous 1.509: preferred, colored
Changes since revision 1.509: +4 -6
lines
Initialize endc unconditionally, gcc complains and it is not obvious
whether this is a false positive.
Revision 1.509: download - view: text, markup, annotated - select for diffs
Sun Sep 13 08:17:14 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.508: preferred, colored
Changes since revision 1.508: +5 -5
lines
make(1): rename ApplyModifier_Exclam
The names of all other ApplyModifier functions already describe the
effect instead of the spelling.
Revision 1.508: download - view: text, markup, annotated - select for diffs
Sun Sep 13 08:11:40 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.507: preferred, colored
Changes since revision 1.507: +13 -5
lines
make(1): inline call to strchr in ValidShortVarname
It's a pity that neither GCC 5 nor GCC 10 nor Clang 9 inline this code
themselves, even though it would be easy to do.
Clang 9 at least replaces strchr with memchr, but that is still too
complicated for a simple "is this character one of these" question.
For a repeated "if (varname != ...)" instead of the switch, GCC 10
generates really boring and inefficient code, even though it is easy to
see that the order of the comparisons doesn't matter.
Revision 1.507: download - view: text, markup, annotated - select for diffs
Sun Sep 13 07:42:20 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.506: preferred, colored
Changes since revision 1.506: +26 -6
lines
make(1): in lint mode, complain about erroneous $$
Since 2008-12-21, make has silently ignored strange variable names in
constructs like '$$', '$}', '$' followed by nothing. Ignoring these
bugs in makefiles instead of reporting them is not a good idea.
To improve the situation, make complains about these errors now, but
only in lint mode (-dL). This preserves existing behavior while still
allowing to validate existing makefiles that they don't depend on this
bug.
If the test phase goes well, these error messages may be enabled
unconditionally.
https://mail-index.netbsd.org/pkgsrc-users/2020/09/12/msg032229.html
Revision 1.506: download - view: text, markup, annotated - select for diffs
Sun Sep 13 05:55:39 2020 UTC (4 years, 2 months ago) by rillig
Branches: MAIN
Diff to: previous 1.505: preferred, colored
Changes since revision 1.505: +11 -11
lines
make(1): improve implementation comment in Var_Parse
Revision 1.505: download - view: text, markup, annotated - select for diffs
Sat Sep 12 22:12:17 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.504: preferred, colored
Changes since revision 1.504: +4 -4
lines
make(1): fix return type of ApplyModifier_Localtime
Revision 1.504: download - view: text, markup, annotated - select for diffs
Sat Sep 12 20:03:37 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.503: preferred, colored
Changes since revision 1.503: +22 -20
lines
make(1): move buffer from Var_Parse to ParseVarname
There's no reason to keep the buffer in memory after the variable name
has been parsed.
Revision 1.503: download - view: text, markup, annotated - select for diffs
Sat Sep 12 19:41:20 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.502: preferred, colored
Changes since revision 1.502: +6 -6
lines
make(1): reword variable invocation to variable expression
Variables are a passive thing. They cannot be invoked, they can only be
evaluated.
Revision 1.502: download - view: text, markup, annotated - select for diffs
Sat Sep 12 19:33:02 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.501: preferred, colored
Changes since revision 1.501: +31 -25
lines
make(1): extract ShortVarValue from Var_Parse
Revision 1.501: download - view: text, markup, annotated - select for diffs
Sat Sep 12 19:24:59 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.500: preferred, colored
Changes since revision 1.500: +38 -29
lines
make(1): extract ParseVarname from Var_Parse
This was an easy part since it affects only a few variables. 250 lines
for a single function is still quite a lot, so further refactorings will
follow.
Revision 1.500: download - view: text, markup, annotated - select for diffs
Sat Sep 12 19:15:20 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.499: preferred, colored
Changes since revision 1.499: +7 -7
lines
make(1): rename local variable in Var_Subst
Revision 1.499: download - view: text, markup, annotated - select for diffs
Sat Sep 12 19:13:43 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.498: preferred, colored
Changes since revision 1.498: +9 -11
lines
make(1): remove double negation in Var_Parse
Revision 1.498: download - view: text, markup, annotated - select for diffs
Sat Sep 12 18:45:24 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.497: preferred, colored
Changes since revision 1.497: +11 -19
lines
make(1): clean up Var_Parse
Revision 1.497: download - view: text, markup, annotated - select for diffs
Sat Sep 12 18:39:37 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.496: preferred, colored
Changes since revision 1.496: +26 -26
lines
make(1): rename local variables in Var_Parse
The main property of the former "str" is not being a string but pointing
at the start of the expression to be parsed.
The main property of the former "tstr" is not being a string but being
the moving pointer, the current parsing position. No idea what the "t"
in "tstr" stood for.
Revision 1.496: download - view: text, markup, annotated - select for diffs
Sat Sep 12 18:19:50 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.495: preferred, colored
Changes since revision 1.495: +24 -41
lines
make(1): rename Var_ParsePP back to Var_Parse
The migration to the "parsing position" pointer has been done.
Revision 1.495: download - view: text, markup, annotated - select for diffs
Sat Sep 12 18:04:45 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.494: preferred, colored
Changes since revision 1.494: +4 -4
lines
make(1): migrate CondParser_String to Var_ParsePP
Revision 1.494: download - view: text, markup, annotated - select for diffs
Sat Sep 12 14:41:00 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.493: preferred, colored
Changes since revision 1.493: +10 -10
lines
make(1): fix inconsistent code indentation
Revision 1.493: download - view: text, markup, annotated - select for diffs
Fri Sep 11 17:32:36 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.492: preferred, colored
Changes since revision 1.492: +11 -12
lines
make(1): add wrappers around ctype.h functions
This avoids casting the argument to unsigned char, and to cast the
result of toupper/tolower back to char.
Revision 1.492: download - view: text, markup, annotated - select for diffs
Fri Sep 11 04:32:39 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.491: preferred, colored
Changes since revision 1.491: +4 -4
lines
make(1): replace *a->b with a->b[0]
This allows the code to be read strictly from left to right. In most
places this style was already used.
Revision 1.491: download - view: text, markup, annotated - select for diffs
Tue Sep 8 05:26:21 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.490: preferred, colored
Changes since revision 1.490: +14 -3
lines
make(1): fix off-by-one error in SuffExpandChildren
In suff.c r1.144 from yesterday, in the line "cp += nested_p - cp", I
accidentally removed the "- 1". Since these "- 1" lines lead to slow
execution, each branch now increments the pointer separately by the
actually needed amount.
Fixing this bug posed way more new questions than it answered, and it
revealed an inconsistency in the parser about how characters are to be
escaped, and missing details in the documentation of Var_Parse, as well
as a parse error that unexpectedly doesn't stop make from continuing.
Revision 1.490: download - view: text, markup, annotated - select for diffs
Mon Sep 7 07:10:56 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.489: preferred, colored
Changes since revision 1.489: +15 -16
lines
make(1): migrate to Var_ParsePP in Var_Parse and Var_Subst
Revision 1.489: download - view: text, markup, annotated - select for diffs
Mon Sep 7 07:04:30 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.488: preferred, colored
Changes since revision 1.488: +9 -8
lines
make(1): migrate ApplyModifiers to Var_ParsePP
Revision 1.488: download - view: text, markup, annotated - select for diffs
Mon Sep 7 06:20:07 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.487: preferred, colored
Changes since revision 1.487: +3 -4
lines
make(1): remove redundant includes
Revision 1.487: download - view: text, markup, annotated - select for diffs
Fri Sep 4 20:28:15 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.486: preferred, colored
Changes since revision 1.486: +20 -13
lines
make(1): add more explanation for undefined variable expressions
Revision 1.486: download - view: text, markup, annotated - select for diffs
Thu Sep 3 18:53:46 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.485: preferred, colored
Changes since revision 1.485: +8 -10
lines
make(1): migrate ApplyModifier_Defined to Var_ParsePP
Revision 1.485: download - view: text, markup, annotated - select for diffs
Thu Sep 3 18:19:15 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.484: preferred, colored
Changes since revision 1.484: +20 -10
lines
make(1): migrate Var_Parse API to parsing position
The ApplyModifier functions already use this pattern. For simplicity
and consistency Var_Parse should do the same. This saves a parameter to
be passed.
The migration takes place step by step, just like for the Lst functions
a few days ago.
Revision 1.484: download - view: text, markup, annotated - select for diffs
Wed Sep 2 06:25:48 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.483: preferred, colored
Changes since revision 1.483: +10 -15
lines
make(1): fix documentation of Var_Subst
The "var" parameter does not exist anymore.
Revision 1.483: download - view: text, markup, annotated - select for diffs
Wed Sep 2 06:19:11 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.482: preferred, colored
Changes since revision 1.482: +18 -44
lines
make(1): clean up comments in var.c, make VarQuote const-correct
Revision 1.482: download - view: text, markup, annotated - select for diffs
Mon Aug 31 19:09:19 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.481: preferred, colored
Changes since revision 1.481: +5 -6
lines
make(1): inline a local variable in VarUniq
Just to eliminate any remote possibility of aliasing and thereby
forgetting to update all involved variables.
Revision 1.481: download - view: text, markup, annotated - select for diffs
Mon Aug 31 19:05:53 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.480: preferred, colored
Changes since revision 1.480: +7 -6
lines
make(1): add more examples to the documentation of ParseModifierPart
Revision 1.480: download - view: text, markup, annotated - select for diffs
Mon Aug 31 17:41:38 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.479: preferred, colored
Changes since revision 1.479: +6 -7
lines
make(1): fix the :u modifier, which was broken for almost a day
Big thanks go to sjg, who discovered the bug and did the main work to
track it down.
In the unit tests for the :u modifier from the previous commit, I had
forgotten to actually add the :u modifier at the end. I added it now
and also added a few other tests. It's better to have a few more tests
than too few.
Revision 1.479: download - view: text, markup, annotated - select for diffs
Sun Aug 30 19:56:02 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.478: preferred, colored
Changes since revision 1.478: +63 -88
lines
make(1): replace brk_string with Str_Words
The API is much simpler, and there is less detail that is exposed by
default and fewer punctuation to type on the caller's side. To see that
there is some memory to be freed, one would have to look into the
struct. Having part of the return value as the actual return value and
the rest in output parameters was unnecessarily asymmetrical.
Revision 1.478: download - view: text, markup, annotated - select for diffs
Sat Aug 29 13:38:48 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.477: preferred, colored
Changes since revision 1.477: +5 -7
lines
make(1): trust that Var_Parse never returns NULL
That function is quite long, but all its return paths lead either to the
expanded variable expression, or to var_Error or varNoError.
Revision 1.477: download - view: text, markup, annotated - select for diffs
Sat Aug 29 13:16:54 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.476: preferred, colored
Changes since revision 1.476: +9 -12
lines
make(1): trust that Var_Subst never returns NULL
It really never does, and it doesn't even report errors. It just
returns the content of the buffer, up to the first parse error.
Revision 1.476: download - view: text, markup, annotated - select for diffs
Sat Aug 29 12:48:17 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.475: preferred, colored
Changes since revision 1.475: +6 -3
lines
make(1): add comments for ModifyWord_Subst
Without any comments, the code is unnecessarily hard to follow.
Revision 1.475: download - view: text, markup, annotated - select for diffs
Sat Aug 29 12:27:10 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.474: preferred, colored
Changes since revision 1.474: +19 -10
lines
make(1): split ApplyModifier_To into paragraphs
Revision 1.474: download - view: text, markup, annotated - select for diffs
Sat Aug 29 11:24:54 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.473: preferred, colored
Changes since revision 1.473: +4 -8
lines
make(1): add bmake_strsedup for duplicating a substring
Revision 1.473: download - view: text, markup, annotated - select for diffs
Sat Aug 29 07:52:55 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.472: preferred, colored
Changes since revision 1.472: +9 -3
lines
make(1): allow for strict type checking for Boolean
Having Boolean aliased to int creates ambiguities since int is widely
used. Allow to occasionally compile make with -DUSE_DOUBLE_BOOLEAN to
check that the type definitions still agree.
Revision 1.472: download - view: text, markup, annotated - select for diffs
Tue Aug 25 21:16:53 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.471: preferred, colored
Changes since revision 1.471: +4 -4
lines
make(1): fix error message for ::!= modifier with shell error
It's just too easy to confuse st->val and val.
Revision 1.471: download - view: text, markup, annotated - select for diffs
Tue Aug 25 16:27:24 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.470: preferred, colored
Changes since revision 1.470: +8 -16
lines
make(1): distinguish enum flags and values in debugging mode
When printing an enum value in debugging mode, distinguish between
bitsets containing flags and ordinary enums that just contain different
values.
Make the macros in enum.h more uniform. Provide a simple scheme for
defining the run-time type information of enums whose number of values
is a number with more than 2 bits set in the binary representation.
This case was not obvious before, and it was pure luck that the current
interesting enum types only had 3, 10 or 32 different values.
The type with the 32 different values actually only has 31 significant
bits since the enum constant OP_OPMASK is only used when querying the
enum, not for defining or describing the possible values. For this
reason, it was unavoidable to refactor the rtti macros, to support even
this case.
Revision 1.470: download - view: text, markup, annotated - select for diffs
Mon Aug 24 20:15:51 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.469: preferred, colored
Changes since revision 1.469: +13 -13
lines
make(1): in debug mode, print GNode details in symbols
A string like OP_DEPENDS|OP_OPTIONAL|OP_PRECIOUS is much easier to read
and understand than the bit pattern 00000089.
The implementation in enum.h looks really bloated and ugly, but using
this API is as simple and natural as possible. That's the trade-off.
In enum.h, I thought about choosing the numbers in the macros such that
it is always possible to combine two of them in order to reach an
arbitrary number, because of the "part1, part2" in the ENUM__SPEC macro.
The powers of 2 are not these numbers, as 7 cannot be expressed as the
sum of two of them. Neither are the fibonacci numbers since 12 cannot
be expressed as the sum of 2 fibonacci numbers. I tried to find a
general pattern to generate these minimal 2-sum numbers, but failed.
Revision 1.469: download - view: text, markup, annotated - select for diffs
Sun Aug 23 22:49:45 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.468: preferred, colored
Changes since revision 1.468: +3 -5
lines
make(1): remove redundant range restriction
re.re_nsub is at least 0, and (at least 0) + 1 cannot be 0.
Revision 1.468: download - view: text, markup, annotated - select for diffs
Sun Aug 23 22:13:38 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.467: preferred, colored
Changes since revision 1.467: +45 -39
lines
make(1): restructure code of the :ts modifier
Now there is one paragraph per case, as opposed to the highly condensed
code from before.
In the cases of :ts\n and :ts\t, the variables for number parsing are no
longer in the code path, which makes the code easier to understand for
humans. Not sure what the compilers made out of it.
The assignment "base = 0" has gone since it was redundant. An integer
that starts with 0 is always interpreted as octal by strtol, no matter
if the base is 8 or 0.
Revision 1.467: download - view: text, markup, annotated - select for diffs
Sun Aug 23 21:40:30 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.466: preferred, colored
Changes since revision 1.466: +66 -32
lines
make(1): extend the documentation on the ApplyModifier functions
Revision 1.466: download - view: text, markup, annotated - select for diffs
Sun Aug 23 20:57:02 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.465: preferred, colored
Changes since revision 1.465: +21 -22
lines
make(1): split code for parsing the :U modifier into digestible parts
The comment about "unescaped $'s that aren't before the delimiter" was
wrong, as the code didn't contain the "aren't before the delimiter"
part. By splitting the code into paragraphs, the larger structure
becomes easily visible. Having a few short comments in the right place
is more helpful than a big block of text.
Revision 1.465: download - view: text, markup, annotated - select for diffs
Sun Aug 23 18:26:35 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.464: preferred, colored
Changes since revision 1.464: +42 -42
lines
make(1): make brk_string return size_t for the number of words
Revision 1.464: download - view: text, markup, annotated - select for diffs
Sun Aug 23 10:27:22 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.463: preferred, colored
Changes since revision 1.463: +8 -11
lines
make(1): save a variable lookup when adding a read-only variable
Revision 1.463: download - view: text, markup, annotated - select for diffs
Sun Aug 23 09:28:52 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.462: preferred, colored
Changes since revision 1.462: +12 -11
lines
make(1): fix assertion failure in debug output for read-only variables
Revision 1.462: download - view: text, markup, annotated - select for diffs
Sun Aug 23 08:32:57 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.461: preferred, colored
Changes since revision 1.461: +5 -5
lines
make(1): improve variable name in ApplyModifiers
The bare q was too unspecific.
Revision 1.461: download - view: text, markup, annotated - select for diffs
Sun Aug 23 08:31:07 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.460: preferred, colored
Changes since revision 1.460: +11 -8
lines
make(1): use local variable in ApplyModifier_Path
Without this variable, it might seem as if st->newVal could become NULL
in some code paths.
Revision 1.460: download - view: text, markup, annotated - select for diffs
Sun Aug 23 08:29:18 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.459: preferred, colored
Changes since revision 1.459: +12 -6
lines
make(1): add assertions for non-nullness of strings
Verified by manually inspecting all call sites.
Revision 1.459: download - view: text, markup, annotated - select for diffs
Sat Aug 22 21:42:38 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.458: preferred, colored
Changes since revision 1.458: +3 -7
lines
make(1): clean up headers
Remove redundant headers that are already included by "make.h".
Make <assert.h> available to all compilation units that use "make.h".
Revision 1.458: download - view: text, markup, annotated - select for diffs
Sat Aug 22 20:31:50 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.457: preferred, colored
Changes since revision 1.457: +12 -12
lines
make(1): prevent assignment to the variable with the empty name
Revision 1.457: download - view: text, markup, annotated - select for diffs
Sat Aug 22 19:30:58 2020 UTC (4 years, 3 months ago) by sjg
Branches: MAIN
Diff to: previous 1.456: preferred, colored
Changes since revision 1.456: +23 -10
lines
Add .SHELL as read-only variable
The .SHELL variable represents the shellPath used to run
scripts.
Reviewed by: rillig, christos
Revision 1.456: download - view: text, markup, annotated - select for diffs
Sat Aug 22 17:34:25 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.455: preferred, colored
Changes since revision 1.455: +5 -5
lines
make(1): fix indentation
Revision 1.455: download - view: text, markup, annotated - select for diffs
Sat Aug 22 17:32:55 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.454: preferred, colored
Changes since revision 1.454: +11 -15
lines
make(1): fix documentation of Var_Parse
Revision 1.454: download - view: text, markup, annotated - select for diffs
Thu Aug 20 07:15:52 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.453: preferred, colored
Changes since revision 1.453: +11 -12
lines
make(1): make a few comments more precise
Revision 1.453: download - view: text, markup, annotated - select for diffs
Thu Aug 20 07:09:06 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.452: preferred, colored
Changes since revision 1.452: +9 -9
lines
make(1): use more descriptive variable name in ModifyWords
Revision 1.452: download - view: text, markup, annotated - select for diffs
Thu Aug 20 07:01:39 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.451: preferred, colored
Changes since revision 1.451: +16 -13
lines
make(1): remove VARP_SUB_MATCHED
This flag didn't really belong to the other flags. The other flags are
set during parsing and are then left as-is by ModifyWord_Subst and
ModifyWord_SubstRegex.
It's clearer to use a separate variable for storing whether there was a
match already.
Revision 1.451: download - view: text, markup, annotated - select for diffs
Thu Aug 20 06:48:18 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.450: preferred, colored
Changes since revision 1.450: +4 -5
lines
make(1): consistently access args->pflags in ModifyWord_Subst
It was confusing that some accesses were via pflags and some via
args->pflags.
Revision 1.450: download - view: text, markup, annotated - select for diffs
Thu Aug 20 06:35:14 2020 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.449: preferred, colored
Changes since revision 1.449: +7 -7
lines
make(1): remove unreached code from bmake_strndup
The "at most" branch was never taken since all call sites in var.c only
ever need a substring, and the target buffer is not limited. Therefore
rename the function and make it simpler.
It's ok that bmake_strldup is defined as estrndup in case of USE_EMALLOC
since that function's implementation is compatible to the "copy
exactly", it just contains some extra null checks that will never match
since the variable values cannot (well, or should not) contain null
bytes. Theoretically they can, but the behavior then depends on the
exact implementation and is unreliable, therefore nobody does this.
After all, Makefiles are used for text processing, not for binary data.
Revision 1.449: download - view: text, markup, annotated - select for diffs
Thu Aug 13 04:12:13 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.448: preferred, colored
Changes since revision 1.448: +7 -7
lines
make(1): remove type alias Byte = char
This alias was only actually used in very few places, and changing it to
unsigned char or any other type would not be possible without generating
lots of compile-time errors. Therefore there was no abstraction, only
unnecessary complexity.
Revision 1.448: download - view: text, markup, annotated - select for diffs
Wed Aug 12 19:14:38 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.447: preferred, colored
Changes since revision 1.447: +45 -43
lines
make(1): prepare var.c for WARNS=6
I'm unhappy with the (unsigned) casts for the enum constants, but there
is no way around that since the base type of enums is int by definition,
and there is no way in C90 to explicitly specify the base type of an
enum type.
The (size_t) casts on the pointer differences are another pain point,
but for these as well, C90 does not have a ready-made solution. A
possible workaround would be an inline function ptr_diff that returns
size_t instead of ptrdiff_t, but that would make the code look even more
bloated than with the casts.
The remaining casts to (char), (int) and (time_t) look so suspicious
that it's easy enough to stumble upon them, as soon as someone finds the
time to fix these properly by adding a function ParseInt or
ParseSeconds.
Revision 1.447: download - view: text, markup, annotated - select for diffs
Wed Aug 12 18:53:59 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.446: preferred, colored
Changes since revision 1.446: +10 -7
lines
make(1): replace redundant NULL tests with assertions
Revision 1.446: download - view: text, markup, annotated - select for diffs
Mon Aug 10 20:07:14 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.445: preferred, colored
Changes since revision 1.445: +15 -20
lines
make(1): replace snprintf with concat3
This makes the code more predictable for long strings, since the main
action is never skipped.
The code also becomes simpler since there is no %s anymore, and the 3
arguments just appear in the same order as in the result.
Revision 1.445: download - view: text, markup, annotated - select for diffs
Sun Aug 9 15:07:13 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.444: preferred, colored
Changes since revision 1.444: +22 -24
lines
make(1): clean up code for subexpressions in the :C modifier
An ampersand in the replacement string can never produce an
out-of-bounds error or an undefined-subexpression error. This makes the
error message simpler since it only needs to cover the case of a single
digit.
Revision 1.444: download - view: text, markup, annotated - select for diffs
Sun Aug 9 14:30:35 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.443: preferred, colored
Changes since revision 1.443: +8 -8
lines
make(1): use char literals, improve documentation
Revision 1.443: download - view: text, markup, annotated - select for diffs
Sun Aug 9 14:02:15 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.442: preferred, colored
Changes since revision 1.442: +9 -15
lines
make(1): revert C99 initializer in ApplyModifiers
The code of usr.bin/make is supposed to be C90-compatible. That's why
it neither uses line-end comments nor declaration-after-statement nor a
few other features.
The fields that were copied "by name" did not get any additional
comments, only the ones with literal values did, since it's hard to see
what these mean.
This style of initializer has the additional benefit that a missing or
extraneous initializer-item would lead to a compile-time error, rather
than going undetected.
Revision 1.442: download - view: text, markup, annotated - select for diffs
Sun Aug 9 13:16:10 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.441: preferred, colored
Changes since revision 1.441: +6 -5
lines
make(1): mark inconsistent word separators for variable modifiers
Revision 1.441: download - view: text, markup, annotated - select for diffs
Sun Aug 9 13:05:04 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.440: preferred, colored
Changes since revision 1.440: +8 -4
lines
make(1): improve type signature of Var_Export
Revision 1.440: download - view: text, markup, annotated - select for diffs
Sun Aug 9 11:04:05 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.439: preferred, colored
Changes since revision 1.439: +27 -19
lines
make(1): extend the documentation for variable flags
Revision 1.439: download - view: text, markup, annotated - select for diffs
Sun Aug 9 09:44:14 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.438: preferred, colored
Changes since revision 1.438: +4 -4
lines
make(1): clean up indentation, includes, add documentation
Revision 1.438: download - view: text, markup, annotated - select for diffs
Sun Aug 9 09:40:48 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.437: preferred, colored
Changes since revision 1.437: +6 -4
lines
make(1): document a hard-to-understand pointer calculation
Revision 1.437: download - view: text, markup, annotated - select for diffs
Sun Aug 9 07:09:57 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.436: preferred, colored
Changes since revision 1.436: +7 -7
lines
make(1): restrict the type of startc and endc to char
Revision 1.436: download - view: text, markup, annotated - select for diffs
Sun Aug 9 07:03:06 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.435: preferred, colored
Changes since revision 1.435: +8 -8
lines
make(1): use fixed-size arrays for Enum_ToString
Declaring the ToStringSize as "static const size_t" made it an ordinary
integer expression. To avoid variable length arrays, the commonly
accepted way is to declare the length as an enum constant, as that is
considered an integer constant expression, which in turn makes the
declaration a fixed-size array.
Revision 1.435: download - view: text, markup, annotated - select for diffs
Sun Aug 9 02:53:21 2020 UTC (4 years, 4 months ago) by christos
Branches: MAIN
Diff to: previous 1.434: preferred, colored
Changes since revision 1.434: +21 -11
lines
Fix build; gcc does not like VLA's, so hard code the boundary
Use c99 initializers
Revision 1.434: download - view: text, markup, annotated - select for diffs
Sat Aug 8 19:13:39 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.433: preferred, colored
Changes since revision 1.433: +22 -31
lines
make(1): merge duplicate code for the :H :T :R :E modifiers
By setting modifyWord first, the rest of the code becomes exactly the
same and is merged by the compiler.
Revision 1.433: download - view: text, markup, annotated - select for diffs
Sat Aug 8 18:54:04 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.432: preferred, colored
Changes since revision 1.432: +29 -29
lines
make(1): remove trailing Z from buffer functions
This Z had been useful during the migration from int to size_t. This
migration is finished, at least for the Buffer type, so the Z is no
longer necessary.
Revision 1.432: download - view: text, markup, annotated - select for diffs
Sat Aug 8 18:50:11 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.431: preferred, colored
Changes since revision 1.431: +8 -3
lines
make(1): add debug logging for Var_Parse
This will hopefully help with tracking down why the "Undefined variable"
error message is not triggered.
There is some other non-obvious behavior nearby. In Parse_DoVar, the !=
assignment operator evaluates the variable using VARE_UNDEFERR, but
there is not even a warning for the following line:
!= echo err ${UNDEFINED} 1>&2
Revision 1.431: download - view: text, markup, annotated - select for diffs
Sat Aug 8 14:28:46 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.430: preferred, colored
Changes since revision 1.430: +7 -5
lines
make(1): extend debug logging to error values
The error marker var_Error is just an empty string. In the debug log
this empty string was not distinguishable from an otherwise empty
string.
Having this distinction helps in understanding the exact data flow.
Revision 1.430: download - view: text, markup, annotated - select for diffs
Sat Aug 8 13:50:23 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.429: preferred, colored
Changes since revision 1.429: +48 -5
lines
make(1): add more detailed debug logging for variable modifiers
Before a modifier is applied to a variable, it is not yet parsed,
therefore it is only possible to log a rough estimate of the modifier.
But after applying it, the parsing position has advanced, and the full
modifier can be logged.
In addition, to fully understand how the modifiers work, it's not enough
to just know the variable names and values, there are also some flags
that influence how the modifiers behave. The most influential is
VARE_WANTRES.
Thanks to sjg for the extensive review and valuable feedback on the
first drafts.
Revision 1.429: download - view: text, markup, annotated - select for diffs
Sat Aug 8 13:31:24 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.428: preferred, colored
Changes since revision 1.428: +8 -9
lines
make(1): improve documentation of Var_Parse and reorder conditions
Revision 1.428: download - view: text, markup, annotated - select for diffs
Sat Aug 8 13:27:42 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.427: preferred, colored
Changes since revision 1.427: +5 -5
lines
make(1): improve error message in case of unfinished modifiers
The previous error message "Unclosed substitution" was wrong for several
reasons.
It is not about "unclosed", but about "unfinished" since in the
:@var@...@ modifier the missing '@' does not really close anything.
The word "substitution" may have originated in a time where :S and
:from=to were the only modifiers, and these were indeed substitutions,
but several other modifiers aren't.
The :S and :C modifiers allow an arbitrary delimiter, therefore it is
helpful to enclose the delimiter in quotes, just in case someone chooses
')' or '{' or even ' ' as delimiter.
Revision 1.427: download - view: text, markup, annotated - select for diffs
Sat Aug 8 13:17:39 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.426: preferred, colored
Changes since revision 1.426: +11 -11
lines
make(1): align the code in Var_Append with Var_Set
The code has the same effect in both functions, therefore it should also
look the same.
Revision 1.426: download - view: text, markup, annotated - select for diffs
Sat Aug 8 13:13:34 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.425: preferred, colored
Changes since revision 1.425: +8 -8
lines
make(1): consistently use postfix-increment
Revision 1.425: download - view: text, markup, annotated - select for diffs
Sat Aug 8 13:05:24 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.424: preferred, colored
Changes since revision 1.424: +9 -9
lines
make(1): clean up VarStrftime
The parameter names were confusing and had outdated types.
Revision 1.424: download - view: text, markup, annotated - select for diffs
Sat Aug 8 13:03:13 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.423: preferred, colored
Changes since revision 1.423: +4 -4
lines
make(1): add test for unknown sub-modifier of the :S modifier
Revision 1.423: download - view: text, markup, annotated - select for diffs
Sat Aug 8 13:00:07 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.422: preferred, colored
Changes since revision 1.422: +32 -26
lines
make(1): clean up Var_UnExport
Mark the parameter as constant since it is not modified.
Remove tests for '\n' since these can never succeed.
newenv can never be NULL since neither of bmake_malloc or bmake_realloc
returns NULL.
Improve variable names: vlist was too unexpressive.
Add debug logging since unexporting variables is an uncommon operation
that directly affects the observable environment of the child processes.
Fix CRLF line endings in a few unit tests.
Revision 1.422: download - view: text, markup, annotated - select for diffs
Sat Aug 8 12:43:06 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.421: preferred, colored
Changes since revision 1.421: +9 -24
lines
make(1): clean up Var_Export
The string from the .export directive can never be NULL.
The test for local single-char variables is already done in Var_Export1.
Revision 1.421: download - view: text, markup, annotated - select for diffs
Sat Aug 8 12:39:48 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.420: preferred, colored
Changes since revision 1.420: +14 -13
lines
make(1): change return type of Var_Export1 to Boolean
Revision 1.420: download - view: text, markup, annotated - select for diffs
Sat Aug 8 12:37:37 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.419: preferred, colored
Changes since revision 1.419: +6 -6
lines
make(1): fix yoda-style comparisons in var.c
Revision 1.419: download - view: text, markup, annotated - select for diffs
Sat Aug 8 12:35:15 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.418: preferred, colored
Changes since revision 1.418: +4 -69
lines
make(1): condense comment for ApplyModifiers
This comment only repeats what is written in the manual page.
Furthermore, it didn't get updated consistently. The missing modifiers
were :_, :gmtime, :localtime, :hash, :Q, :range, :Or.
Revision 1.418: download - view: text, markup, annotated - select for diffs
Sat Aug 8 12:32:26 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.417: preferred, colored
Changes since revision 1.417: +4 -5
lines
make(1): fix debug output for indirect modifiers
The trailing part after the modifier was confusing at best. It does
make sense to log the string from p to p+rlen, but not from p+len to
p+len+len.
Consistently use double quotes for strings.
Revision 1.417: download - view: text, markup, annotated - select for diffs
Fri Aug 7 20:35:03 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.416: preferred, colored
Changes since revision 1.416: +43 -40
lines
make(1): format the code in var.c a little more consistently
Revision 1.416: download - view: text, markup, annotated - select for diffs
Thu Aug 6 17:51:21 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.415: preferred, colored
Changes since revision 1.415: +16 -16
lines
make(1): use consistent name for result of Cmd_Exec
Revision 1.415: download - view: text, markup, annotated - select for diffs
Thu Aug 6 17:48:41 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.414: preferred, colored
Changes since revision 1.414: +9 -16
lines
make(1): reduce code size in :D and :U modifier
This affects both the source code size and the binary code size, at
least on x86_64.
Revision 1.414: download - view: text, markup, annotated - select for diffs
Thu Aug 6 17:32:40 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.413: preferred, colored
Changes since revision 1.413: +20 -17
lines
make(1): clean up code for variable handling
The VarFlags type doesn't need an underscore. The underscore is
typically only used for exported functions.
Document the memory allocation details for Var.name.
Use consistent names for Hash_Entry variables. Quite possibly one of
them was a Lst_Node in ancient times, but that's not a reason to keep
this variable name forever.
Revision 1.413: download - view: text, markup, annotated - select for diffs
Mon Aug 3 21:44:43 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.412: preferred, colored
Changes since revision 1.412: +4 -4
lines
make(1): fix wrong assertion in ApplyModifiers
The assertion was supposed to validate startc and endc individually.
For unknown reasons (once again), this reduces the code size by 49 bytes
on x86_64.
Revision 1.412: download - view: text, markup, annotated - select for diffs
Mon Aug 3 20:26:09 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.411: preferred, colored
Changes since revision 1.411: +221 -125
lines
make(1): no declaration-after-statement anymore
NetBSD make is intended to be maximally portable, therefore it uses only
C89. This was not declared in the Makefile before.
There are still a few places in parse.c and metachar.c that use
end-of-line comments. These will be fixed in a follow-up commit.
Revision 1.411: download - view: text, markup, annotated - select for diffs
Mon Aug 3 16:45:23 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.410: preferred, colored
Changes since revision 1.410: +36 -65
lines
make(1): use VAR_DEBUG macro instead of if statements
This removes some clutter from the code and reduces the indentation.
Revision 1.410: download - view: text, markup, annotated - select for diffs
Mon Aug 3 15:43:32 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.409: preferred, colored
Changes since revision 1.409: +10 -3
lines
make(1): in lint mode, disallow dynamic variable names in :@ modifier
This is an extremely obscure feature that hopefully nobody ever
considered using.
Revision 1.409: download - view: text, markup, annotated - select for diffs
Mon Aug 3 15:08:00 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.408: preferred, colored
Changes since revision 1.408: +182 -146
lines
make(1): replace st->next with a simple string iterator
This is the same style that OpenBSD's make has been using for 20 years
now. Having one less field in ApplyModifiersState reduces complexity in
that place.
The individual modifiers currently don't handle parse errors
consistently. Some update pp while others leave it as-is. This
behavior may be aligned in a follow-up commit.
Revision 1.408: download - view: text, markup, annotated - select for diffs
Mon Aug 3 14:42:50 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.407: preferred, colored
Changes since revision 1.407: +10 -10
lines
make(1): don't use st->next as a local variable
Revision 1.407: download - view: text, markup, annotated - select for diffs
Sun Aug 2 20:13:05 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.406: preferred, colored
Changes since revision 1.406: +4 -4
lines
make(1): remove duplicate code in :ts modifier
The pointer xp had already been there with the correct value, and
there's no point in not using it. This reduces the code size on x86_64
by 48 bytes, which is more than I had expected.
Revision 1.406: download - view: text, markup, annotated - select for diffs
Sun Aug 2 19:59:17 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.405: preferred, colored
Changes since revision 1.405: +9 -9
lines
make(1): clean up NULL pointer comparisons, use separate variable
st->newVal is not meant to be a general-purpose storage.
Eliminate the unnecessary initialization of freeIt since Var_Parse
initializes it in every case.
Revision 1.405: download - view: text, markup, annotated - select for diffs
Sun Aug 2 19:49:17 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.404: preferred, colored
Changes since revision 1.404: +9 -9
lines
make(1): make :hash modifier more efficient
It's not necessary to allocate a 256-byte buffer just to store 9 bytes
in it, and to null-terminate it after writing every single byte to it.
Revision 1.404: download - view: text, markup, annotated - select for diffs
Sun Aug 2 19:11:57 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.403: preferred, colored
Changes since revision 1.403: +17 -17
lines
make(1): move qsort helper functions closer to ApplyModifier_Order
Revision 1.403: download - view: text, markup, annotated - select for diffs
Sun Aug 2 19:08:54 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.402: preferred, colored
Changes since revision 1.402: +24 -31
lines
make(1): merge duplicate code in the :O and :u modifiers
Revision 1.402: download - view: text, markup, annotated - select for diffs
Sun Aug 2 18:57:55 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.401: preferred, colored
Changes since revision 1.401: +50 -73
lines
make(1): inline VarOrder into ApplyModifier_Order
Removing the extra mapping layer "otype" makes the code both faster and
smaller.
Revision 1.401: download - view: text, markup, annotated - select for diffs
Sun Aug 2 18:23:00 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.400: preferred, colored
Changes since revision 1.400: +79 -95
lines
make(1): reduce scope of variables
This groups the variables by topic and only introduces them when they
are actually needed. The compiler doesn't care, but during a debugging
session this means fewer uninitialized variables.
In VarUniq, the variable i has been split into two. All others remain
exactly as before, just with a smaller scope.
Revision 1.400: download - view: text, markup, annotated - select for diffs
Sun Aug 2 17:10:54 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.399: preferred, colored
Changes since revision 1.399: +35 -100
lines
make(1): clean up comments in var.c
Some of the effects listed in "Side Effects" were really "Main Effects"
and have been moved to the main description.
VarAdd: There's no "front" in a hash table.
VarHash: A const char * is not a "String to modify".
Var_Subst: Even in r1.1 of var.c, there was no "variable structure to
store in" anywhere nearby.
Revision 1.399: download - view: text, markup, annotated - select for diffs
Sun Aug 2 16:06:49 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.398: preferred, colored
Changes since revision 1.398: +18 -18
lines
make(1): remove visual clutter from VarFind
Having fewer { else } around makes the return statements easier to find.
Revision 1.398: download - view: text, markup, annotated - select for diffs
Sun Aug 2 15:26:49 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.397: preferred, colored
Changes since revision 1.397: +3 -4
lines
make(1): remove unnecessary assignment in Var_Parse
In a variable expression without braces or parentheses, it is not
possible to have modifiers. Therefore the assigned endc could not have
been used anywhere.
Revision 1.397: download - view: text, markup, annotated - select for diffs
Sun Aug 2 12:43:40 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.396: preferred, colored
Changes since revision 1.396: +10 -15
lines
make(1): eliminate another unnecessary UNCONST in Var_Delete
Revision 1.396: download - view: text, markup, annotated - select for diffs
Sun Aug 2 10:49:53 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.395: preferred, colored
Changes since revision 1.395: +14 -5
lines
make(1): document almost duplicate code
ParseModifierPart and Var_Parse are very similar, but there might be
subtle differences. Until these differences are documented in the form
of unit tests, merging these code pieces is too dangerous.
Revision 1.395: download - view: text, markup, annotated - select for diffs
Sun Aug 2 10:47:09 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.394: preferred, colored
Changes since revision 1.394: +4 -6
lines
make(1): eliminate local variable in ParseModifierPart
The evaluation flags passed to the nested variables consist of 3 flags.
Therefore, (eflags & VARE_UNDEFERR) | (eflags & VARE_WANTRES) is
equivalent to (eflags & ~VARE_ASSIGN).
The variable name errnum was misleading anyway, just like the other
errnum from a few commits ago that had been renamed to errfmt.
Revision 1.394: download - view: text, markup, annotated - select for diffs
Sun Aug 2 10:01:50 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.393: preferred, colored
Changes since revision 1.393: +12 -9
lines
make(1): don't needlessly chain p-- and p++ in ParseModifierPart
At least GCC 5 didn't optimize this, although I wouldn't have been
surprised if it did.
Revision 1.393: download - view: text, markup, annotated - select for diffs
Sun Aug 2 09:54:44 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.392: preferred, colored
Changes since revision 1.392: +14 -14
lines
make(1): reduce the number of moving variables in ParseModifierPart
Having only the p walk through the string is easier to understand than
assigning between p and cp2 (with its unexpressive name).
Revision 1.392: download - view: text, markup, annotated - select for diffs
Sun Aug 2 09:43:22 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.391: preferred, colored
Changes since revision 1.391: +25 -25
lines
make(1): use shorter local variable names
The c in cp was redundant since the context makes it obvious that this
is a character pointer. In a tight loop where lots of characters are
compared, every letter counts.
Revision 1.391: download - view: text, markup, annotated - select for diffs
Sun Aug 2 09:36:54 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.390: preferred, colored
Changes since revision 1.390: +53 -51
lines
make(1): reduce indentation in ParseModifierPart
Revision 1.390: download - view: text, markup, annotated - select for diffs
Sun Aug 2 09:06:32 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.389: preferred, colored
Changes since revision 1.389: +19 -20
lines
make(1): restructure documentation of ParseModifierPart
Before, the long documentation looked too frightening, and it was not
immediately clear which parts of it had to be read and which could be
skipped.
Revision 1.389: download - view: text, markup, annotated - select for diffs
Sun Aug 2 08:49:43 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.388: preferred, colored
Changes since revision 1.388: +8 -8
lines
make(1): update implementation documentation
Revision 1.388: download - view: text, markup, annotated - select for diffs
Sat Aug 1 21:40:49 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.387: preferred, colored
Changes since revision 1.387: +39 -39
lines
make(1): switch Buffer size from int to size_t
This change helps to make the various integer types compatible and is a
preparational step for setting WARNS=6 in the Makefile.
The documentation of buf.c has been cleaned up and condensed since it
was mostly redundant, and some statements were even slightly wrong.
All code changes are covered by the existing unit tests, except for the
few lines in for.c around for_var_len. These changes have been reviewed
thoroughly and manually, like all the others in this commit.
Those buffer functions that deal with sizes have been renamed by
appending a Z, to make sure that no function call was accidentally
forgotten. They will be renamed back in a follow-up commit.
As usual, the scope of a few affected variables has been reduced, and
some variables had to be split since they had been incorrectly merged
before.
The order of the arguments to Buf_AddBytes has changed from (mem_len,
mem) to (mem, mem_len), in order to make it consistent with the
functions from the C standard library, such as snprintf.
Revision 1.387: download - view: text, markup, annotated - select for diffs
Sat Aug 1 19:19:05 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.386: preferred, colored
Changes since revision 1.386: +6 -6
lines
make(1): start nesting level in ApplyModifier_Match at 0
There is no need to start at 1, and starting at 0 generates smaller code
on x86_64. Reordering the --nest and the following break would increase
the code size though, for unknown reasons.
Revision 1.386: download - view: text, markup, annotated - select for diffs
Sat Aug 1 18:36:49 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.385: preferred, colored
Changes since revision 1.385: +24 -46
lines
make(1): inline and untangle the code for the :range modifier
There's no need to keep the result from brk_string in memory until the
buffer has been filled with the range. The only thing necessary from
brk_string is the number of words.
Revision 1.385: download - view: text, markup, annotated - select for diffs
Sat Aug 1 18:14:08 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.384: preferred, colored
Changes since revision 1.384: +4 -4
lines
make(1): fix error message when regcomp fails
If regcomp fails, it's not the regex substitution that is erroneous, but
the regex compilation.
Revision 1.384: download - view: text, markup, annotated - select for diffs
Sat Aug 1 18:02:37 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.383: preferred, colored
Changes since revision 1.383: +6 -6
lines
make(1): use enum for return values of Cond_Eval and friends
Revision 1.383: download - view: text, markup, annotated - select for diffs
Sat Aug 1 17:29:00 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.382: preferred, colored
Changes since revision 1.382: +9 -9
lines
make(1): fix documentation, use safer fallback value
The variable res is overwritten in every case, but better be safe than
sorry. In case of programming errors it's better to issue an error
message than to continue.
Revision 1.382: download - view: text, markup, annotated - select for diffs
Sat Aug 1 16:27:03 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.381: preferred, colored
Changes since revision 1.381: +4 -6
lines
make(1): make ModifyWords simpler
There is no need to test whether an actual word has been added. The
rule is simply "add a space before every word, except for the very
first".
Revision 1.381: download - view: text, markup, annotated - select for diffs
Sat Aug 1 15:03:43 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.380: preferred, colored
Changes since revision 1.380: +9 -10
lines
make(1): inline literal dollar characters
This reduces the code size when compiling with GCC 5. Apparently GCC
wasn't sure enough that str[0] and str[1] stay the same around the call
to Buf_AddByte.
Revision 1.380: download - view: text, markup, annotated - select for diffs
Sat Aug 1 14:47:49 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.379: preferred, colored
Changes since revision 1.379: +6 -6
lines
make(1): use consistent indentation in source code
Tabs for multiples of 8, then spaces.
The usage string has been kept as-is since the spaces there are
indentional and do influence the output.
Revision 1.379: download - view: text, markup, annotated - select for diffs
Sat Aug 1 13:51:40 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.378: preferred, colored
Changes since revision 1.378: +26 -38
lines
make(1): inline function in SysV modifier processing
Revision 1.378: download - view: text, markup, annotated - select for diffs
Sat Aug 1 13:35:13 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.377: preferred, colored
Changes since revision 1.377: +13 -14
lines
make(1): reduce the number of string comparisons in ${VAR:%.c=%.o}
There is only a single position in the word where the tail ".c" can
match, since it is implicitly anchored at the end. Therefore there's no
need to do several string comparisons.
Revision 1.377: download - view: text, markup, annotated - select for diffs
Sat Aug 1 13:16:29 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.376: preferred, colored
Changes since revision 1.376: +44 -47
lines
make(1): make variable names in SysV modifier more expressive
When matching a word against a substitution having a lhs and a rhs,
including a possible wildcard, there are just too many string variables
around to know what a simple "len" means and where it belongs.
Revision 1.376: download - view: text, markup, annotated - select for diffs
Sat Aug 1 12:04:46 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.375: preferred, colored
Changes since revision 1.375: +10 -11
lines
make(1): more descriptive variable names in Str_SYSVSubst
Revision 1.375: download - view: text, markup, annotated - select for diffs
Sat Aug 1 09:25:36 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.374: preferred, colored
Changes since revision 1.374: +4 -4
lines
make(1): let Var_Value return a const char *
The return value must not be modified anyway, so let the compiler check
this for free.
Revision 1.374: download - view: text, markup, annotated - select for diffs
Sat Aug 1 08:42:33 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.373: preferred, colored
Changes since revision 1.373: +4 -4
lines
make(1): fix documentation of Var_Value
Revision 1.373: download - view: text, markup, annotated - select for diffs
Sat Aug 1 07:29:04 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.372: preferred, colored
Changes since revision 1.372: +8 -9
lines
make(1): use better variable names in Var_Exists
Calling strchr just to initialize a variable to NULL is not as
straight-forward as possible.
The unspecific variable name cp made it unnecessarily difficult to
understand its purpose.
Revision 1.372: download - view: text, markup, annotated - select for diffs
Sat Aug 1 07:14:04 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.371: preferred, colored
Changes since revision 1.371: +5 -7
lines
make(1): make condition in Var_Export1 simpler to read
Revision 1.371: download - view: text, markup, annotated - select for diffs
Sat Aug 1 07:10:37 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.370: preferred, colored
Changes since revision 1.370: +9 -9
lines
make(1): use consistent pattern for testing flags
Revision 1.370: download - view: text, markup, annotated - select for diffs
Sat Aug 1 07:03:50 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.369: preferred, colored
Changes since revision 1.369: +10 -10
lines
make(1): clearly mark a variable in Var_Set_with_flags for freeing
No functional change.
Revision 1.369: download - view: text, markup, annotated - select for diffs
Sat Aug 1 06:35:00 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.368: preferred, colored
Changes since revision 1.368: +12 -18
lines
make(1): remove unnecessary snprintf from Var_ExportVars
String literals can be concatenated at compile time.
Furthermore, MAKE_EXPORTED can now contain percent characters without
invoking undefined behavior. Not that anyone would ever want to do this.
Revision 1.368: download - view: text, markup, annotated - select for diffs
Fri Jul 31 14:59:53 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.367: preferred, colored
Changes since revision 1.367: +8 -8
lines
make(1): mark unmodified part of ApplyModifiersState as constant
Revision 1.367: download - view: text, markup, annotated - select for diffs
Fri Jul 31 14:54:03 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.366: preferred, colored
Changes since revision 1.366: +16 -19
lines
make(1): reduce number of parameters to ApplyModifiers
This saves a call to strlen and some arithmetic operations.
Revision 1.366: download - view: text, markup, annotated - select for diffs
Fri Jul 31 14:26:22 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.365: preferred, colored
Changes since revision 1.365: +8 -11
lines
make(1): clean up Var_Parse
If *freePtr is not NULL, it only makes sense to free that pointer and not
a semmingly unrelated variable.
Revision 1.365: download - view: text, markup, annotated - select for diffs
Fri Jul 31 14:11:21 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.364: preferred, colored
Changes since revision 1.364: +8 -8
lines
make(1): remove some redundant parentheses
Revision 1.364: download - view: text, markup, annotated - select for diffs
Fri Jul 31 14:07:21 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.363: preferred, colored
Changes since revision 1.363: +13 -9
lines
make(1): omit unnecessary memory writes in :tu and :tl modifiers
Revision 1.363: download - view: text, markup, annotated - select for diffs
Fri Jul 31 13:56:19 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.362: preferred, colored
Changes since revision 1.362: +6 -4
lines
make(1): fix undefined behavior when parsing incomplete :t modifier
mod[2] must only ever be accessed if mod[1] != '\0'.
Revision 1.362: download - view: text, markup, annotated - select for diffs
Fri Jul 31 13:43:44 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.361: preferred, colored
Changes since revision 1.361: +7 -11
lines
make(1): reduce scope of local variables in ApplyModifier_Subst
Revision 1.361: download - view: text, markup, annotated - select for diffs
Fri Jul 31 13:39:15 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.360: preferred, colored
Changes since revision 1.360: +6 -7
lines
make(1): reduce scope of local variables in ApplyModifier_Regex
Revision 1.360: download - view: text, markup, annotated - select for diffs
Fri Jul 31 13:30:09 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.359: preferred, colored
Changes since revision 1.359: +8 -3
lines
make(1): fix undefined behavior when parsing malformed :C modifier
Same as in the :S modifier.
Revision 1.359: download - view: text, markup, annotated - select for diffs
Fri Jul 31 07:29:21 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.358: preferred, colored
Changes since revision 1.358: +8 -3
lines
make(1): fix undefined behavior in malformed :S modifier
The unit tests failed on Ubuntu, and by looking closely at the code, it
was trivial to see the out-of-bounds memory read.
Other modifiers may have the same problem and will be inspected later.
Revision 1.358: download - view: text, markup, annotated - select for diffs
Wed Jul 29 21:35:35 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.357: preferred, colored
Changes since revision 1.357: +10 -19
lines
make(1): remove unnecessary assignments to st->next
No change in the size of the resulting binary. Apparently GCC already
knew these assignments were redundant.
Revision 1.357: download - view: text, markup, annotated - select for diffs
Wed Jul 29 21:23:26 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.356: preferred, colored
Changes since revision 1.356: +19 -11
lines
make(1): document parameters to ApplyModifiers
Revision 1.356: download - view: text, markup, annotated - select for diffs
Wed Jul 29 20:57:31 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.355: preferred, colored
Changes since revision 1.355: +154 -161
lines
make(1): use specialized return type for ApplyModifier functions
This makes it immediately obvious what happens after a modifier has been
applied, instead of having to translate single-character mnemonics or
booleans to their actual intention.
This also reduces the size of the binary since there are fewer jumps.
Revision 1.355: download - view: text, markup, annotated - select for diffs
Wed Jul 29 20:33:38 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.354: preferred, colored
Changes since revision 1.354: +8 -5
lines
make(1): fix segfault when evaluating ${::=value}
The bug had been in the handling of the SysV modifier for many years, but
it had not been triggered since the "parsing position for the next
modifier" had been initialized to a non-NULL pointer.
In var.v r1.350, this pointer had been initialized to NULL instead since
every ApplyModifier function must set it in every case where it returns
anything except "default_case".
There might have been a slight chance of tricking make to output a wrong
error message, but nothing worse.
Revision 1.354: download - view: text, markup, annotated - select for diffs
Wed Jul 29 19:48:33 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.353: preferred, colored
Changes since revision 1.353: +4 -4
lines
make(1): add enough tests to cover the ApplyModifier functions
Only a few return statements are still missing from the code coverage.
In ApplyModifier_Assign, the test for an empty variable name is skipped
for now since it segfaults.
In ApplyModifier_SysV after the second ParseModifierPart, the branch for
the missing delimiter is not reached since this case is already checked
for in the first part of the function. To trigger this branch, a
specially crafted, unrealistic string needs to be created, and that's too
complicated for the moment.
Revision 1.353: download - view: text, markup, annotated - select for diffs
Tue Jul 28 17:18:40 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.352: preferred, colored
Changes since revision 1.352: +5 -3
lines
make(1): issue a parse error on unclosed variables
These errors had not been detected before by make.
In pkgsrc, this task as been done by pkglint since 2019-04-07.
Revision 1.352: download - view: text, markup, annotated - select for diffs
Tue Jul 28 16:42:22 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.351: preferred, colored
Changes since revision 1.351: +18 -73
lines
make(1): remove dead code from Var_Subst
The first parameter from Var_Subst had been a literal NULL in all cases.
These have been fixed using this command:
sed -i 's|Var_Subst(NULL, |Var_Subst(|' *.c
The one remaining case was not found because the "NULL," was followed by
a line break instead of a space.
The removed code probably wouldn't have worked as expected anyway.
Expanding a single variable to a literal string would have led to
unexpected behavior for cases like ${VAR:M${pattern}}, in case pattern
would contain an unescaped ':' itself.
Revision 1.351: download - view: text, markup, annotated - select for diffs
Tue Jul 28 00:01:13 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.350: preferred, colored
Changes since revision 1.350: +9 -42
lines
make(1): remove redundant ApplyModifiersState.termc
Revision 1.350: download - view: text, markup, annotated - select for diffs
Mon Jul 27 23:56:15 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.349: preferred, colored
Changes since revision 1.349: +15 -9
lines
make(1): document and reorder ApplyModifiersState
Revision 1.349: download - view: text, markup, annotated - select for diffs
Mon Jul 27 23:37:37 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.348: preferred, colored
Changes since revision 1.348: +82 -82
lines
make(1): rename ApplyModifiersState.nstr and newStr
The old names were too easy to confuse. In Var_Parse, nstr is indeed
used for the "new string", but that was misleading in ApplyModifiers,
especially since there was another variable called newStr.
The new variable names focus on the purpose of the variables, not on
their data types.
Revision 1.348: download - view: text, markup, annotated - select for diffs
Mon Jul 27 23:24:55 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.347: preferred, colored
Changes since revision 1.347: +118 -117
lines
make(1): rename ApplyModifiersState.cp to next
The name "next" is more descriptive than a mere "cp". It's easy to look
up the type of the variable, but not so easy to guess the purpose of the
variable, therefore the new name concentrates on the purpose.
Revision 1.347: download - view: text, markup, annotated - select for diffs
Mon Jul 27 23:04:18 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.346: preferred, colored
Changes since revision 1.346: +13 -14
lines
make(1): in ApplyModifier_Match, use short local variable name
Revision 1.346: download - view: text, markup, annotated - select for diffs
Mon Jul 27 22:59:49 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.345: preferred, colored
Changes since revision 1.345: +16 -14
lines
make(1): in ModifyWord_Match, use different variables
Using the same registers or memory locations for different variables is
the job of the register allocator, not the programmer. For humans, that
practice is rather confusing.
Revision 1.345: download - view: text, markup, annotated - select for diffs
Mon Jul 27 22:50:01 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.344: preferred, colored
Changes since revision 1.344: +6 -11
lines
make(1): replace comment in ApplyModifier_Match with code
Revision 1.344: download - view: text, markup, annotated - select for diffs
Mon Jul 27 22:30:00 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.343: preferred, colored
Changes since revision 1.343: +12 -14
lines
make(1): remove unused lengthPtr and freePtr from ApplyModifiersState
Revision 1.343: download - view: text, markup, annotated - select for diffs
Mon Jul 27 22:24:03 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.342: preferred, colored
Changes since revision 1.342: +7 -9
lines
make(1): remove unnecessary field from ApplyModifiersState
Revision 1.342: download - view: text, markup, annotated - select for diffs
Mon Jul 27 22:21:29 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.341: preferred, colored
Changes since revision 1.341: +3 -4
lines
make(1): remove unnecessary variable assignment
It is not the job of an ApplyModifier function to directly manipulate the
final result of the ApplyModifiers function. In fact, the resulting
pointer was overwritten unconditionally, in such an obvious way that the
compiler could have detected this. GCC 5 didn't though, which reduces
the code size a bit.
Revision 1.341: download - view: text, markup, annotated - select for diffs
Mon Jul 27 22:02:26 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.340: preferred, colored
Changes since revision 1.340: +9 -9
lines
make(1): move modifier character out of ApplyModifiersState
It is only used in the outer part of the loop to apply the modifiers.
Revision 1.340: download - view: text, markup, annotated - select for diffs
Mon Jul 27 21:54:25 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.339: preferred, colored
Changes since revision 1.339: +46 -37
lines
make(1): replace macros with functions
Having the hidden parameter st->endc in the macro made it unnecessarily
difficult to understand the code.
Revision 1.339: download - view: text, markup, annotated - select for diffs
Mon Jul 27 21:08:41 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.338: preferred, colored
Changes since revision 1.338: +15 -15
lines
make(1): use shorter variable name for parsing :D and :U
Revision 1.338: download - view: text, markup, annotated - select for diffs
Mon Jul 27 19:59:59 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.337: preferred, colored
Changes since revision 1.337: +6 -7
lines
make(1): remove unnecessary argument validation
Revision 1.337: download - view: text, markup, annotated - select for diffs
Mon Jul 27 17:41:09 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.336: preferred, colored
Changes since revision 1.336: +13 -13
lines
make(1): document API of Var_Value
Revision 1.336: download - view: text, markup, annotated - select for diffs
Sun Jul 26 23:03:54 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.335: preferred, colored
Changes since revision 1.335: +4 -4
lines
make(1): make test for dynamic variable name more specific
Since all the string literals have either 7 or 8 characters, there is no
need to call strcmp for shorter or longer variable names.
Revision 1.335: download - view: text, markup, annotated - select for diffs
Sun Jul 26 22:43:16 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.334: preferred, colored
Changes since revision 1.334: +43 -36
lines
make(1): extract code for dynamic variable names out of Var_Parse
Revision 1.334: download - view: text, markup, annotated - select for diffs
Sun Jul 26 22:19:11 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.333: preferred, colored
Changes since revision 1.333: +13 -8
lines
make(1): fix off-by-one error in Var_Parse for dynamic variables
Revision 1.333: download - view: text, markup, annotated - select for diffs
Sun Jul 26 21:31:11 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.332: preferred, colored
Changes since revision 1.332: +21 -21
lines
make(1): rename VarEvalFlags variables to eflags
This way, they cannot be confused with other flags, and any mismatch of
mixing eflags with constants other than VARE_* is immediately apparent.
Revision 1.332: download - view: text, markup, annotated - select for diffs
Sun Jul 26 21:19:42 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.331: preferred, colored
Changes since revision 1.331: +14 -14
lines
make(1): rename local variable in Var_Parse
Revision 1.331: download - view: text, markup, annotated - select for diffs
Sun Jul 26 20:21:31 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.330: preferred, colored
Changes since revision 1.330: +13 -13
lines
make(1): make return value of Var_Parse constant
This return value is not supposed to be modified since it can be a string
literal. The modifiable part is returned via freePtr, but only for
freeing, not for actually modifying anything.
Revision 1.330: download - view: text, markup, annotated - select for diffs
Sun Jul 26 19:55:24 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.329: preferred, colored
Changes since revision 1.329: +14 -15
lines
make(1): revert making Var_Parse return a const string
The dependencies between the C files and nonints.h are not declared
properly, which resulted in a successful partial build, but a full "make
clean && make" failed.
Revision 1.329: download - view: text, markup, annotated - select for diffs
Sun Jul 26 19:44:04 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.328: preferred, colored
Changes since revision 1.328: +18 -17
lines
make(1): mark result of Var_Parse as const
Var_Parse can return either a string literal or an allocated string. The
former must not be modified by the caller. If the string is allocated,
it is returned in freePtr as well, but only for freeing it after use.
Revision 1.328: download - view: text, markup, annotated - select for diffs
Sun Jul 26 19:36:24 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.327: preferred, colored
Changes since revision 1.327: +14 -13
lines
make(1): reduce scope and rename local variable in Var_Parse
Revision 1.327: download - view: text, markup, annotated - select for diffs
Sun Jul 26 19:16:17 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.326: preferred, colored
Changes since revision 1.326: +8 -10
lines
make(1): eliminate another local variable in Var_Parse
Revision 1.326: download - view: text, markup, annotated - select for diffs
Sun Jul 26 19:13:42 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.325: preferred, colored
Changes since revision 1.325: +5 -8
lines
make(1): split local variable into two in Var_Parse
Revision 1.325: download - view: text, markup, annotated - select for diffs
Sun Jul 26 19:11:06 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.324: preferred, colored
Changes since revision 1.324: +25 -24
lines
make(1): split local variable into two
Reusing a const char * parameter to store a char * and later free that
string was not a good idea. It made the pretty long code of Var_Parse
more difficult to understand.
Revision 1.324: download - view: text, markup, annotated - select for diffs
Sun Jul 26 18:47:02 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.323: preferred, colored
Changes since revision 1.323: +45 -44
lines
make(1): reorder arguments of ParseModifierPart
First the input parameters, then additional data, then special arguments.
Revision 1.323: download - view: text, markup, annotated - select for diffs
Sun Jul 26 18:11:12 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.322: preferred, colored
Changes since revision 1.322: +7 -8
lines
make(1): merge VARE_NOSUBST into VARE_WANTRES
The flag VARE_NOSUBST is only a few days old. It had grown out of the
VARP_NOSUBST and VAR_NOSUBST flags, not knowing at that time that it
meant the exact opposite of VARE_WANTRES.
Revision 1.322: download - view: text, markup, annotated - select for diffs
Sun Jul 26 17:44:54 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.321: preferred, colored
Changes since revision 1.321: +4 -4
lines
make(1): remove wrong comment from VarOrder
Revision 1.321: download - view: text, markup, annotated - select for diffs
Sun Jul 26 17:23:00 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.320: preferred, colored
Changes since revision 1.320: +6 -6
lines
make(1): reorder code in ParseModifierPart to be more readable
Revision 1.320: download - view: text, markup, annotated - select for diffs
Sun Jul 26 17:21:28 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.319: preferred, colored
Changes since revision 1.319: +15 -15
lines
make(1): in ParseModifierPart, only update length on success
Revision 1.319: download - view: text, markup, annotated - select for diffs
Sun Jul 26 17:10:56 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.318: preferred, colored
Changes since revision 1.318: +4 -19
lines
make(1): remove wrong comment for VarUniq
VarUniq is not about sorting the words.
Revision 1.318: download - view: text, markup, annotated - select for diffs
Sun Jul 26 17:09:23 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.317: preferred, colored
Changes since revision 1.317: +9 -9
lines
make(1): save a few bytes and cycles by comparing against 0
The comparison against ac - 1 could have been optimized by the compilers
as well, but both GCC 5 and Clang produce smaller code for the comparison
against 0.
Revision 1.317: download - view: text, markup, annotated - select for diffs
Sun Jul 26 16:59:08 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.316: preferred, colored
Changes since revision 1.316: +14 -16
lines
make(1): remove unnecessary block scope
Revision 1.316: download - view: text, markup, annotated - select for diffs
Sun Jul 26 15:53:01 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.315: preferred, colored
Changes since revision 1.315: +11 -13
lines
make(1): avoid memory allocation for oneBigWord in modifiers
Revision 1.315: download - view: text, markup, annotated - select for diffs
Sun Jul 26 15:37:44 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.314: preferred, colored
Changes since revision 1.314: +9 -8
lines
make(1): help the compiler to find common subexpressions
Revision 1.314: download - view: text, markup, annotated - select for diffs
Sun Jul 26 15:26:27 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.313: preferred, colored
Changes since revision 1.313: +37 -25
lines
make(1): add convenience functions for adding to a SepBuf
Revision 1.313: download - view: text, markup, annotated - select for diffs
Sun Jul 26 15:09:10 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.312: preferred, colored
Changes since revision 1.312: +22 -32
lines
make(1): add Buffer functions for common tasks
Adding a string or a substring to a buffer are common tasks when handling
variables. There is no need to spell out the strlen call or the pointer
subtraction at every call site.
Subtracting pointers results in a ptrdiff_t, which would have to be
converted to an int in each case for WARNS=6. Having this conversion in a
single place keeps the code clean.
Revision 1.312: download - view: text, markup, annotated - select for diffs
Sun Jul 26 13:39:30 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.311: preferred, colored
Changes since revision 1.311: +12 -23
lines
make(1): add Buf_AddInt to make the calling code simpler
Revision 1.311: download - view: text, markup, annotated - select for diffs
Sun Jul 26 12:27:09 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.310: preferred, colored
Changes since revision 1.310: +4 -5
lines
make(1): make code in the :S modifier simpler
This code path is covered by the "sequences of letters" in modmisc.mk.
Revision 1.310: download - view: text, markup, annotated - select for diffs
Sun Jul 26 12:19:37 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.309: preferred, colored
Changes since revision 1.309: +4 -4
lines
make(1): fix bug in :S modifier from 2020-07-19
Revision 1.309: download - view: text, markup, annotated - select for diffs
Sun Jul 26 10:11:04 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.308: preferred, colored
Changes since revision 1.308: +5 -4
lines
make(1): fix missing error message about missing @ delimiter
This had been broken since 2020-07-03, during a "refactoring".
Revision 1.308: download - view: text, markup, annotated - select for diffs
Fri Jul 24 08:24:23 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.307: preferred, colored
Changes since revision 1.307: +5 -7
lines
make(1): remove redundant condition
If there are multiple words from brk_string, none of them can be empty.
And if there is oneSingleWord that is empty, it doesn't hurt to add 0
bytes.
Revision 1.307: download - view: text, markup, annotated - select for diffs
Fri Jul 24 08:22:05 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.306: preferred, colored
Changes since revision 1.306: +8 -8
lines
make(1): prefer direct jump over indirect variable assignment
Revision 1.306: download - view: text, markup, annotated - select for diffs
Fri Jul 24 08:20:24 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.305: preferred, colored
Changes since revision 1.305: +4 -5
lines
make(1): make condition in ModifyWord_SubstRegex simpler
The generated code is still the same, at least with Clang.
Revision 1.305: download - view: text, markup, annotated - select for diffs
Fri Jul 24 08:12:43 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.304: preferred, colored
Changes since revision 1.304: +11 -14
lines
make(1): reduce lifetime of regmatch_t for :C modifier
Revision 1.304: download - view: text, markup, annotated - select for diffs
Fri Jul 24 08:06:28 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.303: preferred, colored
Changes since revision 1.303: +19 -18
lines
make(1): rename local variable
Revision 1.303: download - view: text, markup, annotated - select for diffs
Fri Jul 24 08:03:27 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.302: preferred, colored
Changes since revision 1.302: +4 -6
lines
make(1): allocate capturing groups for :C modifier statically
Since there are at most 10 capturing groups, it's easier to allocate them
on the stack.
To avoid growing the code size on x86_64, the matches have been moved to
the end of the struct, to keep the other offsets small.
Revision 1.302: download - view: text, markup, annotated - select for diffs
Fri Jul 24 07:59:35 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.301: preferred, colored
Changes since revision 1.301: +8 -9
lines
make(1): clean up Var_Export
Revision 1.301: download - view: text, markup, annotated - select for diffs
Fri Jul 24 07:52:44 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.300: preferred, colored
Changes since revision 1.300: +51 -60
lines
make(1): inline Var_Parse_State into ApplyModifiersState
There was no need to have this as a separate struct. Especially none of
the modifiers used by ModifyWords modify this state, therefore it was
not necessary to pass it by reference. This makes the code easier to
understand since there's less modifiable state.
Revision 1.300: download - view: text, markup, annotated - select for diffs
Fri Jul 24 07:29:18 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.299: preferred, colored
Changes since revision 1.299: +5 -5
lines
make(1): document ApplyModifiersState.cp
Revision 1.299: download - view: text, markup, annotated - select for diffs
Fri Jul 24 07:24:21 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.298: preferred, colored
Changes since revision 1.298: +145 -152
lines
make(1): eliminate ApplyModifiersState.tstr
This field always pointed to the beginning of the current modifier.
Therefore a better name is "mod", and there is no need to store it in the
shared state.
Revision 1.298: download - view: text, markup, annotated - select for diffs
Thu Jul 23 20:24:22 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.297: preferred, colored
Changes since revision 1.297: +62 -47
lines
make(1): only set missing_delim if it is actually missing
Just to make it easier to understand the code.
Revision 1.297: download - view: text, markup, annotated - select for diffs
Thu Jul 23 19:49:39 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.296: preferred, colored
Changes since revision 1.296: +10 -8
lines
make(1): fix wrong warning about missing delimiter
Revision 1.296: download - view: text, markup, annotated - select for diffs
Thu Jul 23 19:32:54 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.295: preferred, colored
Changes since revision 1.295: +4 -6
lines
make(1): reduce code size on x86_64
Revision 1.295: download - view: text, markup, annotated - select for diffs
Tue Jul 21 23:47:50 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.294: preferred, colored
Changes since revision 1.294: +32 -40
lines
make(1): remove parameter from ModifyWordCallback
Most modifiers don't need a variable context, and those that do already
get all their parameters in a custom Args struct.
Revision 1.294: download - view: text, markup, annotated - select for diffs
Tue Jul 21 23:22:45 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.293: preferred, colored
Changes since revision 1.293: +8 -14
lines
make(1): make implementation of the :C modifier simpler
Revision 1.293: download - view: text, markup, annotated - select for diffs
Tue Jul 21 21:32:55 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.292: preferred, colored
Changes since revision 1.292: +8 -12
lines
make(1): only ask for newline if :Q actually needs it
This simple change reduces the binary size of var.o by 96 bytes (Clang,
x86_64). Given that the code is still the same, just in a different
order, this is a bit surprising.
Revision 1.292: download - view: text, markup, annotated - select for diffs
Tue Jul 21 21:13:24 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.291: preferred, colored
Changes since revision 1.291: +52 -58
lines
make(1): clean up various things in var.c
Revision 1.291: download - view: text, markup, annotated - select for diffs
Tue Jul 21 20:56:56 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.290: preferred, colored
Changes since revision 1.290: +142 -158
lines
make(1): use consistent and descriptive names for callback functions
Revision 1.290: download - view: text, markup, annotated - select for diffs
Tue Jul 21 20:08:44 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.289: preferred, colored
Changes since revision 1.289: +20 -27
lines
make(1): remove unnecessary VarSelectWords_t struct
Revision 1.289: download - view: text, markup, annotated - select for diffs
Mon Jul 20 21:33:13 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.288: preferred, colored
Changes since revision 1.288: +92 -92
lines
make(1): extract :ts<separator> modifier into separate function
Revision 1.288: download - view: text, markup, annotated - select for diffs
Mon Jul 20 20:56:39 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.287: preferred, colored
Changes since revision 1.287: +104 -128
lines
make(1): clean up implementation of :[...] and other modifiers
Revision 1.287: download - view: text, markup, annotated - select for diffs
Mon Jul 20 19:53:40 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.286: preferred, colored
Changes since revision 1.286: +11 -19
lines
make(1): fix edge cases with $ at the end of the :@ modifier
In both parts of the :@ modifier, by passing &pflags to
ParseModifierPart, a final $ was interpreted as an anchor, which only
makes sense in the :S and :C modifiers.
This edge case is neither used by src nor by pkgsrc, except for the unit
tests that have been adjusted.
Revision 1.286: download - view: text, markup, annotated - select for diffs
Mon Jul 20 18:12:48 2020 UTC (4 years, 4 months ago) by sjg
Branches: MAIN
Diff to: previous 1.285: preferred, colored
Changes since revision 1.285: +10 -3
lines
Make DEBUG_HASH less of a fire-hose.
Reporting keys on every lookup is overkill unless
playing with a new HASH, so wrap in #ifdef DEBUG_HASH_LOOKUP
Also add some stats at the end so we can see
final size and max chain length - maxchain is a better
variable name than maxlen.
Revision 1.285: download - view: text, markup, annotated - select for diffs
Mon Jul 20 16:55:10 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.284: preferred, colored
Changes since revision 1.284: +13 -16
lines
make(1): make conditions work without pattern flags
The "pattern flag" VARP_NOSUBST was used to prevent evaluating
irrelevant conditions. Omitting the evaluation flag VARE_WANTRES has the
same effect.
Revision 1.284: download - view: text, markup, annotated - select for diffs
Mon Jul 20 16:32:14 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.283: preferred, colored
Changes since revision 1.283: +4 -8
lines
make(1): fix obscure edge case for ${VAR:e$=x}
The characters "$=" do not occur in either src or pkgsrc, therefore this
case is unlikely to occur in practice.
Revision 1.283: download - view: text, markup, annotated - select for diffs
Mon Jul 20 16:12:52 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.282: preferred, colored
Changes since revision 1.282: +25 -23
lines
make(1): move documentation for assignment modifiers
Revision 1.282: download - view: text, markup, annotated - select for diffs
Mon Jul 20 15:48:50 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.281: preferred, colored
Changes since revision 1.281: +5 -4
lines
make(1): prefer memcmp over strncmp
Revision 1.281: download - view: text, markup, annotated - select for diffs
Mon Jul 20 15:44:12 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.280: preferred, colored
Changes since revision 1.280: +55 -60
lines
make(1): fix type of VarPattern.lhsLen and rhsLen
String length is measured in size_t, not int.
Revision 1.280: download - view: text, markup, annotated - select for diffs
Mon Jul 20 15:15:32 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.279: preferred, colored
Changes since revision 1.279: +8 -6
lines
make(1): fix undefined behavior in :S modifier
The expression word + wordLen - leftLen had resulted in an out-of-bounds
pointer before. Luckily the heap addresses were high enough in typical
applications to prevent a wrap-around.
Revision 1.279: download - view: text, markup, annotated - select for diffs
Mon Jul 20 15:10:35 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.278: preferred, colored
Changes since revision 1.278: +44 -85
lines
make(1): make implementation of the :S modifier simpler
Revision 1.278: download - view: text, markup, annotated - select for diffs
Mon Jul 20 14:50:41 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.277: preferred, colored
Changes since revision 1.277: +164 -258
lines
make(1): make modifier handling simpler
Implementing a modifier such as :S or :M should not be concerned with
separating the words of the resulting string. Ideally this should be
done in the same way by all modifiers.
Before, the :R (filename root) modifier added a separator even if the
resulting filename root was an empty string. The chances that this
change in behavior breaks anything are epsilon.
The :@ modifier, if it appeared after a :ts modifier, did not use the
word separator from the :ts modifier (which all other modifiers do) but
always added a space. This behavior has been preserved for now. It's an
unnecessary inconsistency though.
In contrast to Buffer, the newly added SepBuf uses size_t for memory
sizes and also uses the conventional parameter order (mem, memsize)
instead of the unusual (memsize, mem).
Revision 1.277: download - view: text, markup, annotated - select for diffs
Sun Jul 19 22:22:01 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.276: preferred, colored
Changes since revision 1.276: +9 -9
lines
make(1): remove unnecessary UNCONST
Revision 1.276: download - view: text, markup, annotated - select for diffs
Sun Jul 19 22:04:27 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.275: preferred, colored
Changes since revision 1.275: +29 -32
lines
make(1): make ampersand in ${VAR:from=to&} an ordinary character
In SysV substitutions, wildcards are expressed with % instead of &. The
& is not mentioned in the manual page, and having another wildcard for
the whole word would be such an obscure feature that not even pkgsrc uses
it. The easiest way to discover this feature had been to read the source
code of make(1) or to use a fuzzer and accidentally stumble upon this
edge case.
Revision 1.275: download - view: text, markup, annotated - select for diffs
Sun Jul 19 21:30:49 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.274: preferred, colored
Changes since revision 1.274: +16 -16
lines
make(1): don't call VarSubstitute unnecessarily
Revision 1.274: download - view: text, markup, annotated - select for diffs
Sun Jul 19 21:14:56 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.273: preferred, colored
Changes since revision 1.273: +12 -15
lines
make(1): remove wrong VarPattern from ApplyModifier_Exclam
Revision 1.273: download - view: text, markup, annotated - select for diffs
Sun Jul 19 21:10:34 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.272: preferred, colored
Changes since revision 1.272: +16 -20
lines
make(1): remove wrong VarPattern from ApplyModifier_Assign
Revision 1.272: download - view: text, markup, annotated - select for diffs
Sun Jul 19 20:56:34 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.271: preferred, colored
Changes since revision 1.271: +80 -80
lines
make(1): flatten ApplyModifier_Assign
Revision 1.271: download - view: text, markup, annotated - select for diffs
Sun Jul 19 19:27:08 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.270: preferred, colored
Changes since revision 1.270: +4 -4
lines
make(1): fix off-by-one error in :C modifier
Previously this off-by-one error had invoked undefined behavior.
Until today there was no corresponding unit test though.
Revision 1.270: download - view: text, markup, annotated - select for diffs
Sun Jul 19 18:35:53 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.269: preferred, colored
Changes since revision 1.269: +4 -4
lines
make(1): fix double free introduced this morning in r1.258
Revision 1.269: download - view: text, markup, annotated - select for diffs
Sun Jul 19 17:43:36 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.268: preferred, colored
Changes since revision 1.268: +17 -28
lines
make(1): remove redundant loop control variable
Revision 1.268: download - view: text, markup, annotated - select for diffs
Sun Jul 19 17:40:30 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.267: preferred, colored
Changes since revision 1.267: +40 -44
lines
make(1): rename ApplyModifiersState.flags to eflags
There are just too many variables called "flags" in this file, and their
constants must not accidentally overlap.
Revision 1.267: download - view: text, markup, annotated - select for diffs
Sun Jul 19 16:48:48 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.266: preferred, colored
Changes since revision 1.266: +17 -29
lines
make(1): clean up VarLoop structure
Revision 1.266: download - view: text, markup, annotated - select for diffs
Sun Jul 19 16:22:44 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.265: preferred, colored
Changes since revision 1.265: +22 -36
lines
make(1): remove unused parameter from ParseModifierPart
Revision 1.265: download - view: text, markup, annotated - select for diffs
Sun Jul 19 16:08:24 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.264: preferred, colored
Changes since revision 1.264: +35 -42
lines
make(1): rename VarGetPattern to ParseModifierPart
Revision 1.264: download - view: text, markup, annotated - select for diffs
Sun Jul 19 15:51:51 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.263: preferred, colored
Changes since revision 1.263: +5 -7
lines
make(1): eliminate unused local variables
Revision 1.263: download - view: text, markup, annotated - select for diffs
Sun Jul 19 15:47:10 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.262: preferred, colored
Changes since revision 1.262: +6 -8
lines
make(1): eliminate macro from VarGetPattern
Revision 1.262: download - view: text, markup, annotated - select for diffs
Sun Jul 19 14:05:39 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.261: preferred, colored
Changes since revision 1.261: +9 -11
lines
make(1): replace ApplyModifiersState field with local variable
Revision 1.261: download - view: text, markup, annotated - select for diffs
Sun Jul 19 13:21:56 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.260: preferred, colored
Changes since revision 1.260: +68 -57
lines
make(1): rename flags for :S and :C pattern matching
Renaming these flags makes it obvious that VarPattern is used in a few
places where it doesn't belong. These will be fixed in follow-up
commits.
Revision 1.260: download - view: text, markup, annotated - select for diffs
Sun Jul 19 12:51:06 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.259: preferred, colored
Changes since revision 1.259: +14 -13
lines
make(1): convert VarFind flags to typed enum
Revision 1.259: download - view: text, markup, annotated - select for diffs
Sun Jul 19 12:26:17 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.258: preferred, colored
Changes since revision 1.258: +43 -43
lines
make(1): rename Varf_Flags to VarEvalFlags
In var.c there are lots of different flag types. To make any accidental
mixture obvious, each flag group gets its own prefix.
The only flag group that is visible outside of var.c is concerned with
evaluating variables, therefore the "e", which replaces the former "f"
that probably just meant "flag".
Revision 1.258: download - view: text, markup, annotated - select for diffs
Sun Jul 19 10:38:02 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.257: preferred, colored
Changes since revision 1.257: +20 -27
lines
make(1): clean up handling of :? modifier
The VarPattern type had nothing to do with parsing conditions.
Revision 1.257: download - view: text, markup, annotated - select for diffs
Sun Jul 19 10:28:44 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.256: preferred, colored
Changes since revision 1.256: +49 -60
lines
make(1): clean up code in var.c
* use canonical comparison to zero in more cases
* omit unnecessary snprintf for string literal concatenation
* omit a few redundant parentheses and braces
Revision 1.256: download - view: text, markup, annotated - select for diffs
Sun Jul 19 09:26:18 2020 UTC (4 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.255: preferred, colored
Changes since revision 1.255: +106 -4
lines
make(1): move SysV string matching to var.c
This kind of string matching is only used in variable modifiers, and only
if this feature is enabled by SYSVVARSUB.
Revision 1.255: download - view: text, markup, annotated - select for diffs
Sat Jul 4 17:41:04 2020 UTC (4 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.254: preferred, colored
Changes since revision 1.254: +8 -3
lines
make(1): expand the test for variable expansion in the :@ modifier
Revision 1.254: download - view: text, markup, annotated - select for diffs
Sat Jul 4 17:10:33 2020 UTC (4 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.253: preferred, colored
Changes since revision 1.253: +9 -3
lines
make(1): add debugging output for :@ modifier
The inner working of the :@ modifier is quite tricky. To understand what
really happens, it helps to look at each word as it is being modified.
Revision 1.253: download - view: text, markup, annotated - select for diffs
Sat Jul 4 16:30:47 2020 UTC (4 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.252: preferred, colored
Changes since revision 1.252: +18 -18
lines
make(1): constify VarModify parameter
Since var.c r1.238 and r1.239, the callbacks for the :H :T :E :R modifiers
don't modify the word anymore, and the others didn't modify it at all.
Revision 1.252: download - view: text, markup, annotated - select for diffs
Sat Jul 4 15:44:07 2020 UTC (4 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.251: preferred, colored
Changes since revision 1.251: +12 -9
lines
make(1): fix :hash modifier on 16-bit platforms
On platforms where int has only 16 bits the shifts would have been in
16-bit arithmetic, which would invoke undefined behavior for "ustr[3] <<
24" as well as "ustr[2] << 16" (C99, 6.5.7p3).
Revision 1.251: download - view: text, markup, annotated - select for diffs
Sat Jul 4 10:49:09 2020 UTC (4 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.250: preferred, colored
Changes since revision 1.250: +6 -6
lines
make(1): remove unnecessary _t suffix from VarLoop type
Revision 1.250: download - view: text, markup, annotated - select for diffs
Sat Jul 4 10:46:31 2020 UTC (4 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.249: preferred, colored
Changes since revision 1.249: +9 -37
lines
make(1): fix documentation of Var_Subst, clean up other documentation
Revision 1.249: download - view: text, markup, annotated - select for diffs
Sat Jul 4 10:35:30 2020 UTC (4 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.248: preferred, colored
Changes since revision 1.248: +27 -41
lines
make(1): remove unnecessary forward declarations, fix indentation
Revision 1.248: download - view: text, markup, annotated - select for diffs
Sat Jul 4 10:19:39 2020 UTC (4 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.247: preferred, colored
Changes since revision 1.247: +3 -30
lines
make(1): remove unnecessary forward declarations
Revision 1.247: download - view: text, markup, annotated - select for diffs
Sat Jul 4 03:08:20 2020 UTC (4 years, 5 months ago) by lukem
Branches: MAIN
Diff to: previous 1.246: preferred, colored
Changes since revision 1.246: +4 -4
lines
make: fix sign-compare warning
Fix -Wsign-compare warning on amd64, introduced in rev 1.239
Revision 1.246: download - view: text, markup, annotated - select for diffs
Fri Jul 3 22:40:55 2020 UTC (4 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.245: preferred, colored
Changes since revision 1.245: +12 -7
lines
make(1): reduce line length in var.c
Revision 1.245: download - view: text, markup, annotated - select for diffs
Fri Jul 3 22:34:22 2020 UTC (4 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.244: preferred, colored
Changes since revision 1.244: +38 -40
lines
make(1): refactor ApplyModifier_SysV to have less indentation
Revision 1.244: download - view: text, markup, annotated - select for diffs
Fri Jul 3 22:10:42 2020 UTC (4 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.243: preferred, colored
Changes since revision 1.243: +74 -187
lines
make(1): clean up documentation, small refactorings for variables
- document the callback for VarModify
- clearly mark the callbacks
- shorten the documentation for some callback functions
- fix the documentation of VarSYSVMatch
- remove unnecessary null check from VarLoopExpand
- add test for applying modifiers to empty strings
Revision 1.243: download - view: text, markup, annotated - select for diffs
Fri Jul 3 18:41:50 2020 UTC (4 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.242: preferred, colored
Changes since revision 1.242: +5 -5
lines
make(1): fix bug in :E modifier, introduced in r1.239 today
That case was not covered by the tests before.
Revision 1.242: download - view: text, markup, annotated - select for diffs
Fri Jul 3 17:48:47 2020 UTC (4 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.241: preferred, colored
Changes since revision 1.241: +158 -173
lines
make(1): fix indentation in var.c
Fixing the indentation manually is a tedious task. indent(1) was no help
since it has several bugs and is not flexible enough for the original
make code.
Revision 1.241: download - view: text, markup, annotated - select for diffs
Fri Jul 3 17:03:09 2020 UTC (4 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.240: preferred, colored
Changes since revision 1.240: +14 -25
lines
make(1): add Hash_ForEach to avoid duplicate code
Revision 1.240: download - view: text, markup, annotated - select for diffs
Fri Jul 3 17:00:47 2020 UTC (4 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.239: preferred, colored
Changes since revision 1.239: +110 -134
lines
make(1): fix indentation and alignment
Revision 1.239: download - view: text, markup, annotated - select for diffs
Fri Jul 3 15:42:43 2020 UTC (4 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.238: preferred, colored
Changes since revision 1.238: +16 -68
lines
make(1): make code for the :E and :R modifiers simpler
Revision 1.238: download - view: text, markup, annotated - select for diffs
Fri Jul 3 15:24:31 2020 UTC (4 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.237: preferred, colored
Changes since revision 1.237: +15 -70
lines
make(1): clean up code for the :H and :T modifiers
Revision 1.237: download - view: text, markup, annotated - select for diffs
Fri Jul 3 14:59:17 2020 UTC (4 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.236: preferred, colored
Changes since revision 1.236: +4 -6
lines
make(1): add missing test for the :H and :T modifiers
Revision 1.236: download - view: text, markup, annotated - select for diffs
Fri Jul 3 14:14:04 2020 UTC (4 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.235: preferred, colored
Changes since revision 1.235: +1165 -1042
lines
make(1): refactor ApplyModifiers
Previously, ApplyModifiers was 1200 lines long and pretty complicated.
Now each of the complicated modifiers has its own function, which reduces
the indentation and makes it possible to use early returns.
Revision 1.235: download - view: text, markup, annotated - select for diffs
Fri Jul 3 08:13:23 2020 UTC (4 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.234: preferred, colored
Changes since revision 1.234: +5 -5
lines
make(1): remove trailing whitespace
Revision 1.234: download - view: text, markup, annotated - select for diffs
Fri Jul 3 08:02:55 2020 UTC (4 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.233: preferred, colored
Changes since revision 1.233: +4 -4
lines
make(1): remove redundant parentheses around return values
Revision 1.233: download - view: text, markup, annotated - select for diffs
Thu Jul 2 16:52:34 2020 UTC (4 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.232: preferred, colored
Changes since revision 1.232: +6 -6
lines
make(1): fix unnecessary evaluation of variables in :@var@ modifier
Revision 1.232: download - view: text, markup, annotated - select for diffs
Thu Jul 2 16:46:57 2020 UTC (4 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.231: preferred, colored
Changes since revision 1.231: +6 -6
lines
make(1): fix unnecessary evaluation for :S :C := modifiers
Revision 1.231: download - view: text, markup, annotated - select for diffs
Thu Jul 2 16:14:50 2020 UTC (4 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.230: preferred, colored
Changes since revision 1.230: +52 -103
lines
make(1): clean up code in var.c
- remove redundant parentheses in return statements
- add missing space after comma
- remove some redundant parentheses around comparisons
- use hexadecimal numbers for bit mask constants
- remove Var_GetTail and Var_GetHead, which had been unused for 19 years
Revision 1.230: download - view: text, markup, annotated - select for diffs
Thu Jul 2 15:47:38 2020 UTC (4 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.229: preferred, colored
Changes since revision 1.229: +49 -42
lines
make(1): remove useless parameter from Var_Set
The enum corresponding to this int parameter is only defined in var.c,
which makes it impractical for the outside to set this parameter to
anything but 0.
On x86_64, this reduces the size of the resulting executable by 5 kB.
Revision 1.229: download - view: text, markup, annotated - select for diffs
Thu Jul 2 15:26:21 2020 UTC (4 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.228: preferred, colored
Changes since revision 1.228: +24 -23
lines
make(1): use enum instead of #define for VarPattern flags
Revision 1.228: download - view: text, markup, annotated - select for diffs
Thu Jul 2 15:14:38 2020 UTC (4 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.227: preferred, colored
Changes since revision 1.227: +23 -21
lines
make(1): add more type safety for enums
There are several types of flags for variables, and these cannot be
mixed. To prevent accidental typos, these are defined in separate enum
types. Clang warns about direct assignments between distinct types, but
not about mixing distinct types in binary expressions like A | B. GCC
does not warn at all.
Revision 1.227: download - view: text, markup, annotated - select for diffs
Thu Jul 2 13:04:09 2020 UTC (4 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.226: preferred, colored
Changes since revision 1.226: +4 -4
lines
make(1): fix unnecessary evaluation of :M and :N modifiers
Revision 1.226: download - view: text, markup, annotated - select for diffs
Thu Jul 2 12:34:30 2020 UTC (4 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.225: preferred, colored
Changes since revision 1.225: +5 -10
lines
make(1): fix edge case for evaluating unnecessary conditions
Revision 1.225: download - view: text, markup, annotated - select for diffs
Wed Jul 1 18:02:26 2020 UTC (4 years, 5 months ago) by sjg
Branches: MAIN
Diff to: previous 1.224: preferred, colored
Changes since revision 1.224: +10 -5
lines
Fix parsing of nested variables during .for loop
Recent change to cond.c to avoid eval of unnecessary
terms had side effect on constructs like:
.for s in 1 2
.if defined(MAN$s) && !empty(MAN$s)
MAN+= ${MAN$s}
.endif
.endfor
resulting in MAN being flagged as recursive.
When Var_Parse encounters a variable within a variable name
we want to force it to be expanded.
But given the way get_mpt_arg calls Var_Parse we need to check
whether we actually started parsing a variable yet.
Revision 1.224: download - view: text, markup, annotated - select for diffs
Fri Jun 5 19:20:46 2020 UTC (4 years, 6 months ago) by sjg
Branches: MAIN
Diff to: previous 1.223: preferred, colored
Changes since revision 1.223: +14 -4
lines
make: add :Or for reverse sort
:Or is more efficient than :O:[-1..1]
Reviewed by: christos
Revision 1.223: download - view: text, markup, annotated - select for diffs
Sat Apr 25 18:20:57 2020 UTC (4 years, 7 months ago) by christos
Branches: MAIN
Diff to: previous 1.222: preferred, colored
Changes since revision 1.222: +7 -6
lines
- Percent on the rhs is special only if the lhs has one too.
- If the rhs does not have percent, but the lhs has, the result is the rhs
This behavior matches gmake
Revision 1.220.2.1: download - view: text, markup, annotated - select for diffs
Mon Jun 10 22:10:21 2019 UTC (5 years, 6 months ago) by christos
Branches: phil-wifi
Diff to: previous 1.220: preferred, colored; next MAIN 1.221: preferred, colored
Changes since revision 1.220: +7 -4
lines
Sync with HEAD
Revision 1.222: download - view: text, markup, annotated - select for diffs
Sun Feb 3 03:19:29 2019 UTC (5 years, 10 months ago) by mrg
Branches: MAIN
CVS tags: phil-wifi-20200421,
phil-wifi-20200411,
phil-wifi-20200406,
phil-wifi-20191119,
phil-wifi-20190609,
netbsd-9-base,
netbsd-9-4-RELEASE,
netbsd-9-3-RELEASE,
netbsd-9-2-RELEASE,
netbsd-9-1-RELEASE,
netbsd-9-0-RELEASE,
netbsd-9-0-RC2,
netbsd-9-0-RC1,
netbsd-9,
is-mlppp-base,
is-mlppp
Diff to: previous 1.221: preferred, colored
Changes since revision 1.221: +5 -3
lines
- add or adjust /* FALLTHROUGH */ where appropriate
- add __unreachable() after functions that can return but won't in
this case, and thus can't be marked __dead easily
Revision 1.218.2.2: download - view: text, markup, annotated - select for diffs
Wed Dec 26 14:02:10 2018 UTC (5 years, 11 months ago) by pgoyette
Branches: pgoyette-compat
CVS tags: pgoyette-compat-merge-20190127
Diff to: previous 1.218.2.1: preferred, colored; branchpoint 1.218: preferred, colored; next MAIN 1.219: preferred, colored
Changes since revision 1.218.2.1: +5 -4
lines
Sync with HEAD, resolve a few conflicts
Revision 1.221: download - view: text, markup, annotated - select for diffs
Fri Dec 21 05:50:19 2018 UTC (5 years, 11 months ago) by sjg
Branches: MAIN
CVS tags: pgoyette-compat-20190127,
pgoyette-compat-20190118,
pgoyette-compat-1226
Diff to: previous 1.220: preferred, colored
Changes since revision 1.220: +5 -4
lines
unexport-env: avoid SEGFAULT if MAKELEVEL not in env
Revision 1.218.2.1: download - view: text, markup, annotated - select for diffs
Mon Jun 25 07:26:11 2018 UTC (6 years, 5 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.218: preferred, colored
Changes since revision 1.218: +10 -6
lines
Sync with HEAD
Revision 1.215.4.2: download - view: text, markup, annotated - select for diffs
Sat Jun 9 15:35:38 2018 UTC (6 years, 6 months ago) by martin
Branches: netbsd-8
CVS tags: netbsd-8-3-RELEASE,
netbsd-8-2-RELEASE,
netbsd-8-1-RELEASE,
netbsd-8-1-RC1,
netbsd-8-0-RELEASE,
netbsd-8-0-RC2
Diff to: previous 1.215.4.1: preferred, colored; branchpoint 1.215: preferred, colored; next MAIN 1.216: preferred, colored
Changes since revision 1.215.4.1: +9 -7
lines
Pull up following revision(s) (requested by christos in ticket #870):
sys/lib/libgnuefi/Makefile.inc: revision 1.5
external/mit/xorg/xorg-pkg-ver.mk: revision 1.9
sys/arch/i386/stand/lib/Makefile.inc: revision 1.17
sys/compat/common/Makefile.inc: revision 1.25
usr.bin/make/unit-tests/varquote.exp: revision 1.1, 1.2
sys/lib/libsa/Makefile.inc: revision 1.24
usr.bin/make/var.c: revision 1.220
sys/arch/ia64/stand/efi/libefi/Makefile.inc: revision 1.5
sys/arch/hppa/spmath/Makefile.inc: revision 1.10
usr.bin/make/unit-tests/varquote.mk: revision 1.1, 1.2
usr.bin/make/unit-tests/Makefile: revision 1.53
sys/lib/libkern/Makefile.inc: revision 1.45
sys/arch/acorn32/stand/lib/Makefile.inc: revision 1.4
sys/arch/m68k/fpsp/Makefile.inc: revision 1.21
usr.bin/make/make.1: revision 1.273
sys/lib/libz/Makefile.inc: revision 1.17
- Introduce :q modifier for make variables and make it double escape $'s so
that passing variables to recursive makes with :q works as expected.
- Adjust makefiles that use recursive make to use :q
Discussed on tech-toolchain@
XXX: pullup 8
Revision 1.215.4.1: download - view: text, markup, annotated - select for diffs
Thu Jun 7 15:59:27 2018 UTC (6 years, 6 months ago) by martin
Branches: netbsd-8
Diff to: previous 1.215: preferred, colored
Changes since revision 1.215: +5 -3
lines
Pull up following revision(s) (requested by christos in ticket #834):
usr.bin/make/var.c: revision 1.219
share/mk/bsd.obj.mk: revision 1.52
usr.sbin/crash/Makefile: revision 1.40
share/mk/sys.mk: revision 1.131
share/mk/bsd.sys.mk: revision 1.276
share/mk/bsd.sys.mk: revision 1.277
Prevent 'make obj' creating an objdir inside an objdir. This happens the
second time we call 'make obj' in /usr/src/rescue with MAKEOBJDIR set.
XXX: pullup-8
-
Need to delete ${DESTDIR} for lint
XXX: pullup-8
-
Fix reproducible builds
XXX: pullup-8
-
Also substitute ${X11SRCDIR} for the random seed for reproducible builds so
that the random seed is consistent.
XXX: pullup-8
-
Since ${MAKE} converts $$ -> $ during parsing we need to put it back to
preserve the original variable value with :Q.
XXX: pullup-8
-
Be more selective about remapping object directories otherwise we pick
objdump and objcopy with the regex.
XXX: pullup-8
Revision 1.220: download - view: text, markup, annotated - select for diffs
Sun May 27 01:14:51 2018 UTC (6 years, 6 months ago) by christos
Branches: MAIN
CVS tags: phil-wifi-base,
pgoyette-compat-1126,
pgoyette-compat-1020,
pgoyette-compat-0930,
pgoyette-compat-0906,
pgoyette-compat-0728,
pgoyette-compat-0625
Branch point for: phil-wifi
Diff to: previous 1.219: preferred, colored
Changes since revision 1.219: +9 -7
lines
- Introduce :q modifier for make variables and make it double escape $'s so
that passing variables to recursive makes with :q works as expected.
- Revert :Q to work as before.
- Adjust makefiles that use recursive make to use :q
Discussed on tech-toolchain@
XXX: pullup 8
Revision 1.219: download - view: text, markup, annotated - select for diffs
Thu May 24 00:27:24 2018 UTC (6 years, 6 months ago) by christos
Branches: MAIN
Diff to: previous 1.218: preferred, colored
Changes since revision 1.218: +5 -3
lines
Since ${MAKE} converts $$ -> $ during parsing we need to put it back to
preserve the original variable value with :Q.
XXX: pullup-8
Revision 1.218: download - view: text, markup, annotated - select for diffs
Sun Feb 18 00:52:42 2018 UTC (6 years, 9 months ago) by sjg
Branches: MAIN
CVS tags: pgoyette-compat-base,
pgoyette-compat-0521,
pgoyette-compat-0502,
pgoyette-compat-0422,
pgoyette-compat-0415,
pgoyette-compat-0407,
pgoyette-compat-0330,
pgoyette-compat-0322,
pgoyette-compat-0315
Branch point for: pgoyette-compat
Diff to: previous 1.217: preferred, colored
Changes since revision 1.217: +6 -5
lines
Var_Set: avoid SIGSEGV if val is NULL
A NULL val is handled gracefully (by VarAdd) when
var is not previously set, so we ought not crash
the second time.
PR: 53034
Revision 1.217: download - view: text, markup, annotated - select for diffs
Fri Dec 8 03:36:42 2017 UTC (7 years ago) by sjg
Branches: MAIN
Diff to: previous 1.216: preferred, colored
Changes since revision 1.216: +5 -5
lines
Ensure VAR+=val on command line is handled correctly
If VAR is not previously set, call Var_Set to deal with
the special case of VAR_CMD.
If VAR is previously set, and ctxt is VAR_CMD we should do the update
even if VAR_FROM_CMD is set.
Revision 1.216: download - view: text, markup, annotated - select for diffs
Sat Nov 18 22:34:04 2017 UTC (7 years ago) by sjg
Branches: MAIN
Diff to: previous 1.215: preferred, colored
Changes since revision 1.215: +5 -5
lines
Do not append to variable set on command line
POSIX requires that variables set on the command line
be immutable.
Var_Append needs to pass FIND_CMD and skip append
if found variable has VAR_FROM_CMD flag set.
Revision 1.208.2.2: download - view: text, markup, annotated - select for diffs
Wed Apr 26 02:53:35 2017 UTC (7 years, 7 months ago) by pgoyette
Branches: pgoyette-localcount
Diff to: previous 1.208.2.1: preferred, colored; branchpoint 1.208: preferred, colored; next MAIN 1.209: preferred, colored
Changes since revision 1.208.2.1: +12 -12
lines
Sync with HEAD
Revision 1.209.2.1: download - view: text, markup, annotated - select for diffs
Fri Apr 21 16:54:14 2017 UTC (7 years, 7 months ago) by bouyer
Branches: bouyer-socketcan
Diff to: previous 1.209: preferred, colored; next MAIN 1.210: preferred, colored
Changes since revision 1.209: +97 -12
lines
Sync with HEAD
Revision 1.215: download - view: text, markup, annotated - select for diffs
Sun Apr 16 21:39:49 2017 UTC (7 years, 7 months ago) by riastradh
Branches: MAIN
CVS tags: prg-localcount2-base3,
prg-localcount2-base2,
prg-localcount2-base1,
prg-localcount2-base,
prg-localcount2,
pgoyette-localcount-20170426,
perseant-stdc-iso10646-base,
perseant-stdc-iso10646,
netbsd-8-base,
netbsd-8-0-RC1,
matt-nb8-mediatek-base,
matt-nb8-mediatek,
bouyer-socketcan-base1
Branch point for: netbsd-8
Diff to: previous 1.214: preferred, colored
Changes since revision 1.214: +4 -4
lines
Plug memory leak.
CID 978372
Revision 1.214: download - view: text, markup, annotated - select for diffs
Sun Apr 16 19:53:58 2017 UTC (7 years, 7 months ago) by riastradh
Branches: MAIN
Diff to: previous 1.213: preferred, colored
Changes since revision 1.213: +11 -11
lines
Use, don't kludge, MAKE_ATTR_UNUSED.
CID 1300234
CID 1300237
CID 1300238
CID 1300245
CID 1300255
CID 1300267
CID 1300284
Revision 1.208.2.1: download - view: text, markup, annotated - select for diffs
Mon Mar 20 06:58:04 2017 UTC (7 years, 8 months ago) by pgoyette
Branches: pgoyette-localcount
Diff to: previous 1.208: preferred, colored
Changes since revision 1.208: +113 -15
lines
Sync with HEAD
Revision 1.213: download - view: text, markup, annotated - select for diffs
Wed Feb 1 18:39:27 2017 UTC (7 years, 10 months ago) by sjg
Branches: MAIN
CVS tags: pgoyette-localcount-20170320
Diff to: previous 1.212: preferred, colored
Changes since revision 1.212: +20 -7
lines
Since we are avoiding VAR_INTERNAL, allow the variable :_ stores to
to be specified, also allows for multiple stages of modification to
be stashed.
Revision 1.212: download - view: text, markup, annotated - select for diffs
Wed Feb 1 18:00:14 2017 UTC (7 years, 10 months ago) by sjg
Branches: MAIN
Diff to: previous 1.211: preferred, colored
Changes since revision 1.211: +6 -13
lines
Just have :_ use current ctxt, avoid need to force VAR_INTERNAL.
Revision 1.211: download - view: text, markup, annotated - select for diffs
Tue Jan 31 07:00:59 2017 UTC (7 years, 10 months ago) by sjg
Branches: MAIN
Diff to: previous 1.210: preferred, colored
Changes since revision 1.210: +12 -5
lines
Use VAR_INTERNAL when calling ApplyModifiers for VAR_{CMD,GLOBAL} only.
Revision 1.210: download - view: text, markup, annotated - select for diffs
Mon Jan 30 02:46:20 2017 UTC (7 years, 10 months ago) by sjg
Branches: MAIN
Diff to: previous 1.209: preferred, colored
Changes since revision 1.209: +75 -3
lines
Add :range and :_
:range replaces var value with an integer sequence one per word
in the current var value.
:_ stores the current var value in $_ so that it can be referred to
later in the modifier series.
Reviewed by: christos
Revision 1.209: download - view: text, markup, annotated - select for diffs
Sat Jan 14 22:58:04 2017 UTC (7 years, 10 months ago) by sjg
Branches: MAIN
CVS tags: bouyer-socketcan-base
Branch point for: bouyer-socketcan
Diff to: previous 1.208: preferred, colored
Changes since revision 1.208: +28 -15
lines
Allow providing a utc value to :{gm,local}time
Reviewed by: christos
Revision 1.208: download - view: text, markup, annotated - select for diffs
Fri Jun 3 01:21:59 2016 UTC (8 years, 6 months ago) by sjg
Branches: MAIN
CVS tags: pgoyette-localcount-base,
pgoyette-localcount-20170107,
pgoyette-localcount-20161104,
pgoyette-localcount-20160806,
pgoyette-localcount-20160726,
localcount-20160914
Branch point for: pgoyette-localcount
Diff to: previous 1.207: preferred, colored
Changes since revision 1.207: +5 -5
lines
Add cached_realpath()
realpath(3) is expensive, and meta mode at least uses it extensively.
We use cached_realpath() to save the result of successful calls to
realpath(3) in a private variable context.
This improves the worst case performance (eg examining libc with
nothing to do) by a factor of 4.
Reviewed by: christos
Revision 1.207: download - view: text, markup, annotated - select for diffs
Fri Mar 11 15:12:39 2016 UTC (8 years, 9 months ago) by matthias
Branches: MAIN
Diff to: previous 1.206: preferred, colored
Changes since revision 1.206: +5 -5
lines
$% is $(.MEMBER) and not $(.ARCHIVE), $! is $(.ARCHIVE) and not $(.MEMBER)
Revision 1.206: download - view: text, markup, annotated - select for diffs
Mon Mar 7 20:20:35 2016 UTC (8 years, 9 months ago) by sjg
Branches: MAIN
Diff to: previous 1.205: preferred, colored
Changes since revision 1.205: +15 -4
lines
For :ts numeric escapes \x* is hex, anything else is octal.
Revision 1.205: download - view: text, markup, annotated - select for diffs
Sat Feb 20 01:19:03 2016 UTC (8 years, 9 months ago) by sjg
Branches: MAIN
Diff to: previous 1.204: preferred, colored
Changes since revision 1.204: +19 -5
lines
Add a knob .MAKE.SAVE_DOLLARS to control the behavior of $$ during :=
If TRUE '$$' are not consumed (saved).
If FALSE '$$' becomes '$' just like normal expansion rules.
default is TRUE.
Reviewed by: christos
Revision 1.204: download - view: text, markup, annotated - select for diffs
Thu Feb 18 23:33:25 2016 UTC (8 years, 9 months ago) by sjg
Branches: MAIN
Diff to: previous 1.203: preferred, colored
Changes since revision 1.203: +4 -3
lines
Delete :@ loop iterator when done with it
Revision 1.203: download - view: text, markup, annotated - select for diffs
Thu Feb 18 20:25:08 2016 UTC (8 years, 9 months ago) by sjg
Branches: MAIN
Diff to: previous 1.202: preferred, colored
Changes since revision 1.202: +19 -11
lines
Add .export-literal to avoid the need for $$ dance when trying to put
unexpanded variables into environment.
Reviewed by: christos
Revision 1.202: download - view: text, markup, annotated - select for diffs
Thu Feb 18 18:29:14 2016 UTC (8 years, 9 months ago) by christos
Branches: MAIN
Diff to: previous 1.201: preferred, colored
Changes since revision 1.201: +87 -88
lines
Collapse the 3 boolean parameter to 1 flags parameter. No functional change.
Revision 1.201: download - view: text, markup, annotated - select for diffs
Sat Jan 9 00:55:17 2016 UTC (8 years, 11 months ago) by christos
Branches: MAIN
Diff to: previous 1.200: preferred, colored
Changes since revision 1.200: +35 -27
lines
Preserve $$ in := assignments..
FOO=\$$CRAP
BAR:=${FOO}
all:
echo ${FOO}
echo ${BAR}
Revision 1.200: download - view: text, markup, annotated - select for diffs
Tue Dec 1 07:26:08 2015 UTC (9 years ago) by sjg
Branches: MAIN
Diff to: previous 1.199: preferred, colored
Changes since revision 1.199: +36 -32
lines
Avoid calling brk_string() and hence Var_Export1() on
empty strings.
Revision 1.199: download - view: text, markup, annotated - select for diffs
Tue Oct 20 21:30:57 2015 UTC (9 years, 1 month ago) by sjg
Branches: MAIN
Diff to: previous 1.198: preferred, colored
Changes since revision 1.198: +4 -4
lines
Ensure emsg initialized
Revision 1.198: download - view: text, markup, annotated - select for diffs
Mon Oct 12 16:48:13 2015 UTC (9 years, 2 months ago) by sjg
Branches: MAIN
Diff to: previous 1.197: preferred, colored
Changes since revision 1.197: +17 -12
lines
The conditional expressions used with ':?' can be expensive
eg. exists() does stat(2).
If 'wantit' is FALSE, we are going to discard everything anyway,
so skip evaluating the conditional and expanding either lhs or rhs.
Revision 1.197: download - view: text, markup, annotated - select for diffs
Sun Oct 11 04:51:24 2015 UTC (9 years, 2 months ago) by sjg
Branches: MAIN
Diff to: previous 1.196: preferred, colored
Changes since revision 1.196: +90 -62
lines
Add Boolean wantit to Var_Parse and Var_Subst
wantit will be FALSE when we are just consuming to discard
in which case we skip "expensive" things like Cmd_Exec.
Reviewed by: christos
Revision 1.196: download - view: text, markup, annotated - select for diffs
Tue Oct 6 17:36:25 2015 UTC (9 years, 2 months ago) by christos
Branches: MAIN
Diff to: previous 1.195: preferred, colored
Changes since revision 1.195: +18 -35
lines
don't check for NULL before free() (Tilman Sauerbeck)
Revision 1.195: download - view: text, markup, annotated - select for diffs
Fri Jun 19 14:25:16 2015 UTC (9 years, 5 months ago) by christos
Branches: MAIN
Diff to: previous 1.194: preferred, colored
Changes since revision 1.194: +4 -4
lines
use isspace()
Revision 1.194: download - view: text, markup, annotated - select for diffs
Fri Jun 19 08:03:35 2015 UTC (9 years, 5 months ago) by mlelstv
Branches: MAIN
Diff to: previous 1.193: preferred, colored
Changes since revision 1.193: +5 -5
lines
Adjust metachar handling to previous behaviour:
- space and tab are no shell metachars, remove them from generic
metachar function
- add space and tab as to-be-quoted characters for :Q modifier
- add = and : as characters that require command handling by the shell
Revision 1.193: download - view: text, markup, annotated - select for diffs
Wed Jun 17 17:43:23 2015 UTC (9 years, 5 months ago) by christos
Branches: MAIN
Diff to: previous 1.192: preferred, colored
Changes since revision 1.192: +13 -16
lines
Centralize the "is a meta char" test, instead of using two different arrays.
Revision 1.192: download - view: text, markup, annotated - select for diffs
Tue May 5 21:51:09 2015 UTC (9 years, 7 months ago) by sjg
Branches: MAIN
Diff to: previous 1.191: preferred, colored
Changes since revision 1.191: +4 -4
lines
When evaluating condtionals from .if we want to require
that the lhs is a variable reference, a number or a quoted string.
This helps avoid subtle bugs caused by typos.
When conditionals are being evaluated during variable expansion
we cannot be as strict becuase lhs will already have been expanded.
We therefor pass a boolean to Cond_EvalExpression to tell it how
lhs should be treated.
Add unit-tests/cond2.mk to test the above
Reviewed by: christos, joerg
Revision 1.191: download - view: text, markup, annotated - select for diffs
Sun Sep 14 02:32:51 2014 UTC (10 years, 3 months ago) by dholland
Branches: MAIN
Diff to: previous 1.190: preferred, colored
Changes since revision 1.190: +30 -35
lines
Fix handling of the silly $(@D) $(@F) etc. vars so modifiers on them
work. This is issue #1 in PR 49085 from Jarmo Jaakkola, but I've used
a different and cleaner patch this time.
Revision 1.190: download - view: text, markup, annotated - select for diffs
Sat Sep 13 23:21:01 2014 UTC (10 years, 3 months ago) by dholland
Branches: MAIN
Diff to: previous 1.189: preferred, colored
Changes since revision 1.189: +4 -4
lines
Recognize the crazy POSIXisms $(?D) and $(?F); issue 2 in PR 49085
from Jarmo Jaakkola.
Revision 1.189: download - view: text, markup, annotated - select for diffs
Sat Sep 13 23:10:28 2014 UTC (10 years, 3 months ago) by dholland
Branches: MAIN
Diff to: previous 1.188: preferred, colored
Changes since revision 1.188: +4 -4
lines
typo in comment, from the first reverted patch
Revision 1.188: download - view: text, markup, annotated - select for diffs
Sun Sep 7 20:55:34 2014 UTC (10 years, 3 months ago) by joerg
Branches: MAIN
Diff to: previous 1.187: preferred, colored
Changes since revision 1.187: +28 -32
lines
Revert all make changes except the unit tests to the state of three
weeks ago. Individual changes can be reapplied after review.
Revision 1.187: download - view: text, markup, annotated - select for diffs
Sat Aug 23 14:50:24 2014 UTC (10 years, 3 months ago) by christos
Branches: MAIN
Diff to: previous 1.186: preferred, colored
Changes since revision 1.186: +35 -31
lines
PR/49085: Jarmo Jaakkola: fix several parsing errors
Don't exit from var.c:Var_Parse() before possible modifiers are handled
on D and F modified versions of local variables. Properly expand $(?D)
and $(?F) too.
Make line continuations in rule's commands POSIX compliant.
Fix the syntax error caused by lib(member) as the last target before
a dependency operator.
Document the line continuation change in the manual page. Also talk
more about the POSIX style local variables and their modifiers.
Add tests covering the fixed problems into d_posix.mk. The test is
a known failure at the moment because of PR 49086 and PR 49092.
[XXX: unconverted tests]
Revision 1.171.2.3: download - view: text, markup, annotated - select for diffs
Wed Aug 20 00:05:00 2014 UTC (10 years, 3 months ago) by tls
Branches: tls-maxphys
Diff to: previous 1.171.2.2: preferred, colored; branchpoint 1.171: preferred, colored; next MAIN 1.172: preferred, colored
Changes since revision 1.171.2.2: +45 -16
lines
Rebase to HEAD as of a few days ago.
Revision 1.184.2.1: download - view: text, markup, annotated - select for diffs
Sun Aug 10 06:58:27 2014 UTC (10 years, 4 months ago) by tls
Branches: tls-earlyentropy
Diff to: previous 1.184: preferred, colored; next MAIN 1.185: preferred, colored
Changes since revision 1.184: +21 -9
lines
Rebase.
Revision 1.186: download - view: text, markup, annotated - select for diffs
Fri Jun 20 06:13:45 2014 UTC (10 years, 5 months ago) by sjg
Branches: MAIN
CVS tags: tls-maxphys-base,
tls-earlyentropy-base,
netbsd-7-nhusb-base-20170116,
netbsd-7-nhusb-base,
netbsd-7-nhusb,
netbsd-7-base,
netbsd-7-2-RELEASE,
netbsd-7-1-RELEASE,
netbsd-7-1-RC2,
netbsd-7-1-RC1,
netbsd-7-1-2-RELEASE,
netbsd-7-1-1-RELEASE,
netbsd-7-1,
netbsd-7-0-RELEASE,
netbsd-7-0-RC3,
netbsd-7-0-RC2,
netbsd-7-0-RC1,
netbsd-7-0-2-RELEASE,
netbsd-7-0-1-RELEASE,
netbsd-7-0,
netbsd-7
Diff to: previous 1.185: preferred, colored
Changes since revision 1.185: +4 -4
lines
Return varNoError rather than var_Error for ::?= etc.
Revision 1.167.2.4: download - view: text, markup, annotated - select for diffs
Thu May 22 11:42:46 2014 UTC (10 years, 6 months ago) by yamt
Branches: yamt-pagecache
Diff to: previous 1.167.2.3: preferred, colored; branchpoint 1.167: preferred, colored; next MAIN 1.168: preferred, colored
Changes since revision 1.167.2.3: +55 -61
lines
sync with head.
for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.
this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
Revision 1.185: download - view: text, markup, annotated - select for diffs
Mon May 19 22:09:58 2014 UTC (10 years, 6 months ago) by sjg
Branches: MAIN
Diff to: previous 1.184: preferred, colored
Changes since revision 1.184: +20 -8
lines
Var_Parse: endc only counts when at the correct nesting depth.
This ensures we correctly detect errors like:
.if empty(VAR && !empty(FOO)
Var_Subst: if Var_Parse returns var_Error it is an error.
This ensures we detect errors like:
VAR:= ${FOO.${GOO}
Revision 1.184: download - view: text, markup, annotated - select for diffs
Wed Sep 4 15:38:26 2013 UTC (11 years, 3 months ago) by sjg
Branches: MAIN
CVS tags: yamt-pagecache-base9,
riastradh-xf86-video-intel-2-7-1-pre-2-21-15,
riastradh-drm2-base3
Branch point for: tls-earlyentropy
Diff to: previous 1.183: preferred, colored
Changes since revision 1.183: +12 -3
lines
Add VAR_INTERNAL as a context for variables set by make itself,
which should not override those set by makefiles.
Currently MAKEFILE is the only variable affected.
Reviewed by: christos
Revision 1.183: download - view: text, markup, annotated - select for diffs
Tue Jul 16 20:00:56 2013 UTC (11 years, 4 months ago) by sjg
Branches: MAIN
CVS tags: riastradh-drm2-base2,
riastradh-drm2-base1,
riastradh-drm2-base,
riastradh-drm2
Diff to: previous 1.182: preferred, colored
Changes since revision 1.182: +11 -3
lines
When a var is set in the CMD context, it prevents the same name
being set in GLOBAL context. We should also delete any such
variable in GLOBAL context, else make -V will show the wrong value.
Revision 1.182: download - view: text, markup, annotated - select for diffs
Tue Jul 16 14:00:53 2013 UTC (11 years, 4 months ago) by christos
Branches: MAIN
Diff to: previous 1.181: preferred, colored
Changes since revision 1.181: +13 -12
lines
More gmake compatibility:
1. add -w flag to print Entering and Leaving directory name the the beginning
and the end of processing.
2. export MAKELEVEL=$((MAKELEVEL + 1)) only in the child environment.
3. when printing error messages, prefix them with the program name [$MAKELEVEL]
for $MAKELEVEL > 0
4. if $MAKEFLAGS consists only of letters assume it is a set of flags (as
allowed by posix), convert them to -f -l -a -g -s, so that they get parsed
properly.
With those fixes gmake -> bmake -> gmake -> bmake etc. works as expected.
Revision 1.181: download - view: text, markup, annotated - select for diffs
Mon Jul 15 20:33:11 2013 UTC (11 years, 5 months ago) by christos
Branches: MAIN
Diff to: previous 1.180: preferred, colored
Changes since revision 1.180: +5 -11
lines
Make this work again like gmake. sjg: see the test program.
Revision 1.180: download - view: text, markup, annotated -