The NetBSD Project

CVS log for src/usr.bin/make/cond.c

[BACK] Up to [cvs.NetBSD.org] / src / usr.bin / make

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.362 / (download) - annotate - [select for diffs], Wed Feb 7 07:21:22 2024 UTC (7 weeks, 1 day ago) by rillig
Branch: MAIN
CVS Tags: HEAD
Changes since 1.361: +3 -22 lines
Diff to previous 1.361 (colored) to selected 1.247 (colored)

make: remove redundant comments

No functional change.

Revision 1.361 / (download) - annotate - [select for diffs], Sun Jan 21 16:32:41 2024 UTC (2 months ago) by rillig
Branch: MAIN
Changes since 1.360: +9 -17 lines
Diff to previous 1.360 (colored) to selected 1.247 (colored)

make: refactor CondParser_Term to be inlinable

No functional change.

Revision 1.360 / (download) - annotate - [select for diffs], Sun Jan 21 15:22:55 2024 UTC (2 months ago) by rillig
Branch: MAIN
Changes since 1.359: +6 -17 lines
Diff to previous 1.359 (colored) to selected 1.247 (colored)

make: clean up parsing of conditions

No functional change.

Revision 1.359 / (download) - annotate - [select for diffs], Fri Dec 29 12:59:43 2023 UTC (2 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.358: +5 -12 lines
Diff to previous 1.358 (colored) to selected 1.247 (colored)

make: clean up comments

No binary change, except for line numbers in assertions.

Revision 1.358 / (download) - annotate - [select for diffs], Fri Dec 29 12:20:55 2023 UTC (2 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.357: +3 -3 lines
Diff to previous 1.357 (colored) to selected 1.247 (colored)

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.357 / (download) - annotate - [select for diffs], Tue Dec 19 19:33:39 2023 UTC (3 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.356: +11 -35 lines
Diff to previous 1.356 (colored) to selected 1.247 (colored)

make: clean up comments

No binary change, except for line numbers in assertions.

Revision 1.356 / (download) - annotate - [select for diffs], Sun Dec 17 08:53:54 2023 UTC (3 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.355: +20 -20 lines
Diff to previous 1.355 (colored) to selected 1.247 (colored)

make: clean up names of local variables

No binary change.

Revision 1.355 / (download) - annotate - [select for diffs], Sun Nov 19 22:50:11 2023 UTC (4 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.354: +10 -10 lines
Diff to previous 1.354 (colored) to selected 1.247 (colored)

make: replace 'variable expression' with 'expression' in comments

No binary change.

Revision 1.354 / (download) - annotate - [select for diffs], Fri Aug 11 04:56:31 2023 UTC (7 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.353: +8 -15 lines
Diff to previous 1.353 (colored) to selected 1.247 (colored)

make: clean up multiple-inclusion guards

No functional change.

Revision 1.353 / (download) - annotate - [select for diffs], Fri Jun 23 05:21:10 2023 UTC (9 months ago) by rillig
Branch: MAIN
Changes since 1.352: +8 -10 lines
Diff to previous 1.352 (colored) to selected 1.247 (colored)

make: clean up variable and function names

No functional change.

Revision 1.352 / (download) - annotate - [select for diffs], Fri Jun 23 04:56:54 2023 UTC (9 months ago) by rillig
Branch: MAIN
Changes since 1.351: +13 -4 lines
Diff to previous 1.351 (colored) to selected 1.247 (colored)

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.351 / (download) - annotate - [select for diffs], Wed Jun 21 04:20:20 2023 UTC (9 months, 1 week ago) by sjg
Branch: MAIN
Changes since 1.350: +13 -25 lines
Diff to previous 1.350 (colored) to selected 1.247 (colored)

Allow guard targets to use variables.

I commonly use __${.PARSEDIR:tA}__ where a unique guard
is needed, __${.PARSEDIR}__ is also useful in many cases.

Combination of patch from rillig and mine

Revision 1.350 / (download) - annotate - [select for diffs], Tue Jun 20 09:25:33 2023 UTC (9 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.349: +48 -15 lines
Diff to previous 1.349 (colored) to selected 1.247 (colored)

make: allow targets to be used as multiple-inclusion guards

This style is used by FreeBSD, among others.

Revision 1.349 / (download) - annotate - [select for diffs], Mon Jun 19 20:07:35 2023 UTC (9 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.348: +4 -5 lines
Diff to previous 1.348 (colored) to selected 1.247 (colored)

make: add tests for full code coverage of multiple-inclusion guards

Revision 1.348 / (download) - annotate - [select for diffs], Mon Jun 19 17:30:56 2023 UTC (9 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.347: +15 -21 lines
Diff to previous 1.347 (colored) to selected 1.247 (colored)

make: clean up code for skipping files with multiple-inclusion guard

No functional change.

Revision 1.347 / (download) - annotate - [select for diffs], Mon Jun 19 12:53:57 2023 UTC (9 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.346: +56 -2 lines
Diff to previous 1.346 (colored) to selected 1.247 (colored)

make: if a makefile is protected by a guard, only include it once

"looks reasonable" sjg@

Revision 1.346 / (download) - annotate - [select for diffs], Fri Jun 16 07:12:46 2023 UTC (9 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.345: +3 -3 lines
Diff to previous 1.345 (colored) to selected 1.247 (colored)

make: remove parameter names from function declarations

No binary change.

Revision 1.345 / (download) - annotate - [select for diffs], Thu Jun 1 07:44:10 2023 UTC (9 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.344: +9 -9 lines
Diff to previous 1.344 (colored) to selected 1.247 (colored)

make: shorten function names, clean up comments

No functional change.

Revision 1.344 / (download) - annotate - [select for diffs], Tue Feb 14 21:08:00 2023 UTC (13 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.343: +6 -7 lines
Diff to previous 1.343 (colored) to selected 1.247 (colored)

make: reduce complexity of evaluating expressions

No functional change.

Revision 1.343 / (download) - annotate - [select for diffs], Tue Feb 14 20:49:09 2023 UTC (13 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.342: +8 -24 lines
Diff to previous 1.342 (colored) to selected 1.247 (colored)

make: don't interpret the return value of Var_Parse

The return value of Var_Parse is largely redundant to the returned
string.  The idea behind the type VarParseResult was to migrate all call
sites to checking this return value instead of the returned string, but
that hasn't happened.  Instead, the additional type only added more
complexity.

There was a single place where that return value was actually used, when
parsing conditions.  And even in that case, ignoring the VarParseResult
added back an error message that previously hid bugs, in the test
cond-token-plain.mk.

Even though these error messages are redundant in the other tests, they
don't hurt as they don't happen often.

Revision 1.342 / (download) - annotate - [select for diffs], Sat Sep 24 16:13:48 2022 UTC (18 months ago) by rillig
Branch: 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
Changes since 1.341: +12 -39 lines
Diff to previous 1.341 (colored) to selected 1.247 (colored)

make: clean up tracking of depth of nested .if directives

The variable cond_min_depth was redundant.  It was only accessed while
parsing the makefiles.  Merging it into struct IncludedFile removes the
possible confusion between cond_min_depth and including_cond_min_depth.

No functional change.

Revision 1.341 / (download) - annotate - [select for diffs], Sat Sep 24 10:26:31 2022 UTC (18 months ago) by rillig
Branch: MAIN
Changes since 1.340: +10 -10 lines
Diff to previous 1.340 (colored) to selected 1.247 (colored)

make: fix variable and function names relating to .if nesting

The previous names were confusing since they suggested that cond_depth
instead of cond_min_depth would be saved and restored.

No functional change.

Revision 1.340 / (download) - annotate - [select for diffs], Sat Sep 24 10:19:07 2022 UTC (18 months ago) by rillig
Branch: MAIN
Changes since 1.339: +12 -12 lines
Diff to previous 1.339 (colored) to selected 1.247 (colored)

make: move Cond_save_depth above Cond_restore_depth

This puts the functions into chronological order, as saving happens
before restoring.

No functional change.

Revision 1.339 / (download) - annotate - [select for diffs], Sat Sep 24 10:12:46 2022 UTC (18 months ago) by rillig
Branch: MAIN
Changes since 1.338: +4 -3 lines
Diff to previous 1.338 (colored) to selected 1.247 (colored)

make: use assertion for internal error condition

When the nesting level of conditionals is restored to an unreasonably
high value, the error message "0 open conditionals" doesn't make sense.

Revision 1.338 / (download) - annotate - [select for diffs], Fri Sep 23 22:58:15 2022 UTC (18 months ago) by sjg
Branch: MAIN
Changes since 1.337: +4 -4 lines
Diff to previous 1.337 (colored) to selected 1.247 (colored)

Cond_reset_depth just use cond_min_depth

To avoid errors from unclosed conditionals on .break
it is sufficient to just set cond_depth = cond_min_depth.

Patch from rillig

Revision 1.337 / (download) - annotate - [select for diffs], Thu Sep 8 05:52:56 2022 UTC (18 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.336: +5 -5 lines
Diff to previous 1.336 (colored) to selected 1.247 (colored)

make: list comparison operators in declaration order

This allows a tiny optimization in the switch statement.

No functional change.

Revision 1.336 / (download) - annotate - [select for diffs], Sun Sep 4 22:55:00 2022 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.335: +5 -3 lines
Diff to previous 1.335 (colored) to selected 1.247 (colored)

make: add more details to error message for numeric comparison

Before:
String comparison operator must be either == or !=

After:
Comparison with '>=' requires both operands 'no' and '10' to be numeric

Noticed by martin@ in pkgsrc/textproc/py-pygments.

Revision 1.335 / (download) - annotate - [select for diffs], Fri Sep 2 16:24:31 2022 UTC (18 months, 3 weeks ago) by sjg
Branch: MAIN
Changes since 1.334: +13 -2 lines
Diff to previous 1.334 (colored) to selected 1.247 (colored)

make: add .break to terminate .for loop early

When .break is encountered within a .for loop
it causes immediate termination.

Outside of a .for loop .break causes a parse error.

Reviewed by: christos

Revision 1.334 / (download) - annotate - [select for diffs], Fri Apr 15 09:33:20 2022 UTC (23 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.333: +3 -3 lines
Diff to previous 1.333 (colored) to selected 1.247 (colored)

tests/make: adjust expectations to actual behavior

The bug in deptgt-silent-jobs.mk has been fixed, the debug logging for
comparing conditions and for deleting global variables has changed
intentionally.

Revision 1.333 / (download) - annotate - [select for diffs], Thu Mar 3 19:46:31 2022 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.332: +7 -5 lines
Diff to previous 1.332 (colored) to selected 1.247 (colored)

make: improve comments about parsing and evaluating conditions

No binary change.

Revision 1.332 / (download) - annotate - [select for diffs], Thu Mar 3 19:40:54 2022 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.331: +7 -7 lines
Diff to previous 1.331 (colored) to selected 1.247 (colored)

make: improve local variable name in ParseWord in conditions

That function not only parses function arguments but also bare words, so
the name argBuf didn't match anymore.

No binary change.

Revision 1.331 / (download) - annotate - [select for diffs], Thu Mar 3 19:36:35 2022 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.330: +4 -5 lines
Diff to previous 1.330 (colored) to selected 1.247 (colored)

make: make debug logging for comparisons less technical

Revision 1.330 / (download) - annotate - [select for diffs], Fri Feb 11 21:18:09 2022 UTC (2 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.329: +6 -13 lines
Diff to previous 1.329 (colored) to selected 1.247 (colored)

make: simplify control flow in CondParser_Comparison

No functional change.

Revision 1.329 / (download) - annotate - [select for diffs], Wed Feb 9 21:09:24 2022 UTC (2 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.328: +3 -3 lines
Diff to previous 1.328 (colored) to selected 1.247 (colored)

make: fix mistakes, spelling and typos in comments and manual page

No binary change for -DNDEBUG.

Revision 1.328 / (download) - annotate - [select for diffs], Wed Feb 9 21:03:13 2022 UTC (2 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.327: +5 -5 lines
Diff to previous 1.327 (colored) to selected 1.247 (colored)

make: clean up variable names

No binary change.

Revision 1.327 / (download) - annotate - [select for diffs], Sat Jan 29 01:12:36 2022 UTC (2 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.326: +8 -8 lines
Diff to previous 1.326 (colored) to selected 1.247 (colored)

make: rename labels in CondParser_Leaf

No binary change.

Revision 1.326 / (download) - annotate - [select for diffs], Sat Jan 15 19:34:07 2022 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.325: +3 -6 lines
Diff to previous 1.325 (colored) to selected 1.247 (colored)

make: replace Var_Value with Var_Exists where applicable

The latter function already existed in 1993, no idea why it was not
used.

No functional change.

Revision 1.325 / (download) - annotate - [select for diffs], Fri Jan 14 18:25:22 2022 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.324: +4 -11 lines
Diff to previous 1.324 (colored) to selected 1.247 (colored)

make: inline EvalBare

No functional change.

Revision 1.324 / (download) - annotate - [select for diffs], Fri Jan 7 09:19:43 2022 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.323: +25 -31 lines
Diff to previous 1.323 (colored) to selected 1.247 (colored)

make: clean up function argument names and comments

No binary change except for assertion line numbers.

Revision 1.323 / (download) - annotate - [select for diffs], Fri Jan 7 09:02:19 2022 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.322: +3 -3 lines
Diff to previous 1.322 (colored) to selected 1.247 (colored)

make: remove redundant initializer in CondParser_ComparisonOrLeaf

No binary change.

Revision 1.322 / (download) - annotate - [select for diffs], Sun Jan 2 02:57:39 2022 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.321: +4 -4 lines
Diff to previous 1.321 (colored) to selected 1.247 (colored)

make: clean up nitpicks

In ParseWord, the expressions '*p' and 'ch' are the same.

In ParseDependencyTargetWord, clean up a wordy comment and join two
conditions.

In the test cond-token-number, clarify that make doesn't convert from
hex to decimal but only from hex to internal representation.

No functional change.

Revision 1.321 / (download) - annotate - [select for diffs], Thu Dec 30 02:14:55 2021 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.320: +4 -4 lines
Diff to previous 1.320 (colored) to selected 1.247 (colored)

tests/make: demonstrate edge case that evaluates an expression twice

Revision 1.320 / (download) - annotate - [select for diffs], Thu Dec 30 01:34:26 2021 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.319: +3 -7 lines
Diff to previous 1.319 (colored) to selected 1.247 (colored)

make: remove redundant code from CondParser_ComparisonOrLeaf

No functional change.

Revision 1.319 / (download) - annotate - [select for diffs], Thu Dec 30 01:30:33 2021 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.318: +25 -31 lines
Diff to previous 1.318 (colored) to selected 1.247 (colored)

make: split ParseWord into the actual ParseWord and ParseFuncArg

Combining two similar but fundamentally different parsing tasks in a
single function only increased the complexity, of the implementation as
well as the call sites.

The code makes it obvious now that a function argument is a bare word
surrounded by parentheses.

The special case of an empty word is only needed for the function
argument, it cannot occur in a bare word.  The code for that has been
moved to the caller.  Such an empty word not only occurs for 'defined()'
but also for 'defined(${:U})'.

No functional change.

Revision 1.318 / (download) - annotate - [select for diffs], Thu Dec 30 01:06:43 2021 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.317: +22 -17 lines
Diff to previous 1.317 (colored) to selected 1.247 (colored)

make: make ParseWord in condition parser simpler

Merge the two return values (bool, string) into a single return value.
As before, the caller cannot observe the difference between a parse
error and an empty word, both are handled in the same way.

In CondParser_ComparisonOrLeaf, the word cannot be empty since the
calling function CondParser_Token already handles all cases that could
lead to an empty word.

No functional change.

Revision 1.317 / (download) - annotate - [select for diffs], Thu Dec 30 00:22:20 2021 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.316: +4 -4 lines
Diff to previous 1.316 (colored) to selected 1.247 (colored)

make: internally return false for irrelevant leaves in conditions

The result of irrelevant leaves is effectively ignored by CondParser_And
and CondParser_Or.  Use the 'doEval &&' pattern to make the code
consistent with CondParser_Comparison and CondParser_FuncCall.

No functional change.

Revision 1.316 / (download) - annotate - [select for diffs], Wed Dec 29 08:23:40 2021 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.315: +3 -3 lines
Diff to previous 1.315 (colored) to selected 1.247 (colored)

make: in irrelevant function calls in conditions, return false

When a condition contains an irrelevant function call, it doesn't matter
whether the function call evaluates to true or to false, it will be
discarded anyway by either CondParser_And or CondParser_Or.

Returning false instead of true makes the code simpler, plus it is more
common to return false for irrelevant results.

No functional change.

Revision 1.315 / (download) - annotate - [select for diffs], Wed Dec 29 08:15:45 2021 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.314: +11 -11 lines
Diff to previous 1.314 (colored) to selected 1.247 (colored)

make: use simpler return type for ParseWord in conditions

No functional change.

Revision 1.314 / (download) - annotate - [select for diffs], Wed Dec 29 07:40:52 2021 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.313: +55 -55 lines
Diff to previous 1.313 (colored) to selected 1.247 (colored)

make: replace table for function lookup in conditions with simple code

The code for looking up the function from the table forced the compiler
to use a specific memory layout.  Replacing the table with explicit code
provides the compiler more opportunities to optimize the code.  Another
side effect is that there are fewer pointer operations.

Previously, is_token checked that the character after the word does not
continue the word, this is now done separately since for the function
lookup, this check was unnecessary.  The newly added skip_string
provides a higher abstraction level, it is no longer necessary to pass
the string length as a separate, redundant parameter.

No functional change.

Revision 1.313 / (download) - annotate - [select for diffs], Wed Dec 29 05:16:44 2021 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.312: +5 -18 lines
Diff to previous 1.312 (colored) to selected 1.247 (colored)

make: clean up condition parser

No functional change.

Revision 1.312 / (download) - annotate - [select for diffs], Wed Dec 29 05:05:21 2021 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.311: +7 -7 lines
Diff to previous 1.311 (colored) to selected 1.247 (colored)

make: merge duplicate types CondEvalResult and CondResult

No binary change.

Revision 1.311 / (download) - annotate - [select for diffs], Wed Dec 29 05:01:35 2021 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.310: +26 -26 lines
Diff to previous 1.310 (colored) to selected 1.247 (colored)

make: merge duplicate enum constants for CondEvalResult and CondResult

No binary change.

Revision 1.310 / (download) - annotate - [select for diffs], Wed Dec 29 04:50:56 2021 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.309: +12 -13 lines
Diff to previous 1.309 (colored) to selected 1.247 (colored)

make: remove redundant parameter for evaluating conditions

No functional change.

Revision 1.309 / (download) - annotate - [select for diffs], Wed Dec 29 04:41:38 2021 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.308: +2 -6 lines
Diff to previous 1.308 (colored) to selected 1.247 (colored)

make: merge types CondResult and CondEvalResult

No functional change.

Revision 1.308 / (download) - annotate - [select for diffs], Mon Dec 27 21:21:17 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.307: +7 -7 lines
Diff to previous 1.307 (colored) to selected 1.247 (colored)

make: rename local variables to be simpler

No binary change.

Revision 1.307 / (download) - annotate - [select for diffs], Mon Dec 27 18:54:19 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.306: +7 -8 lines
Diff to previous 1.306 (colored) to selected 1.247 (colored)

make: clean up comments

Revision 1.306 / (download) - annotate - [select for diffs], Wed Dec 15 12:58:01 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.305: +15 -9 lines
Diff to previous 1.305 (colored) to selected 1.247 (colored)

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.305 / (download) - annotate - [select for diffs], Wed Dec 15 12:24:13 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.304: +6 -7 lines
Diff to previous 1.304 (colored) to selected 1.247 (colored)

make: use consistent indentation for statements and continuations

No binary change, except for line numbers in assertions in suff.c.

Revision 1.304 / (download) - annotate - [select for diffs], Mon Dec 13 07:47:07 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.303: +14 -28 lines
Diff to previous 1.303 (colored) to selected 1.247 (colored)

make: condense CondParser_ComparisonOp

No functional change.

Revision 1.303 / (download) - annotate - [select for diffs], Mon Dec 13 07:06:39 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.302: +4 -3 lines
Diff to previous 1.302 (colored) to selected 1.247 (colored)

make: fix memory leak when parsing '.if ${expr}' (since 2004-04-13)

$ (
	echo 'VAR=value'
	perl -e 'printf(".if \${VAR}\n.endif\n" x 5000);';
	echo 'all:'
	printf '\t%s\n' \
	    '@pid=$$$$; \' \
	    'ppid=$$(ps -o ppid -p "$$pid" | sed 1d); \' \
	    'ps -o vsz,rsz -p $$ppid | sed 1d'
) > leak-cond2.mk

$ make-2004.04.08.07.24.26 -r -f leak-cond.mk
2668
$ make-2004.04.13.16.06.23 -r -f leak-cond.mk
3964

$ echo $(((3964 - 2668) * 1000 / 5000))
259

This 259 is close enough to the 256 from Buf_Init in CondParser_Leaf.

Revision 1.302 / (download) - annotate - [select for diffs], Sun Dec 12 09:36:00 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.301: +6 -3 lines
Diff to previous 1.301 (colored) to selected 1.247 (colored)

tests/make: refine comments for parsing and evaluating conditions

Revision 1.301 / (download) - annotate - [select for diffs], Sun Dec 12 08:55:28 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.300: +10 -8 lines
Diff to previous 1.300 (colored) to selected 1.247 (colored)

make: rename ParseFuncArg to ParseWord, update comments

No functional change.

Revision 1.300 / (download) - annotate - [select for diffs], Sun Dec 12 08:42:29 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.299: +3 -10 lines
Diff to previous 1.299 (colored) to selected 1.247 (colored)

make: merge duplicate code in CondParser_FuncCall

No functional change.

Revision 1.299 / (download) - annotate - [select for diffs], Sun Dec 12 08:36:21 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.298: +4 -8 lines
Diff to previous 1.298 (colored) to selected 1.247 (colored)

make: generate more specific error message on malformed conditional

Revision 1.298 / (download) - annotate - [select for diffs], Sat Dec 11 11:13:30 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.297: +4 -4 lines
Diff to previous 1.297 (colored) to selected 1.247 (colored)

make: remove dead code in CondParser_FuncCall

The return value (size_t)-1 was only used by the function 'empty', which
moved to CondParser_FuncCallEmpty.

No functional change.

Revision 1.297 / (download) - annotate - [select for diffs], Sat Dec 11 10:57:10 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.296: +18 -24 lines
Diff to previous 1.296 (colored) to selected 1.247 (colored)

make: remove unused function parameter in conditional handling

No functional change.

Revision 1.296 / (download) - annotate - [select for diffs], Sat Dec 11 10:51:03 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.295: +3 -6 lines
Diff to previous 1.295 (colored) to selected 1.247 (colored)

make: clean up CondParser_FuncCallEmpty

No functional change.

Revision 1.295 / (download) - annotate - [select for diffs], Sat Dec 11 10:41:31 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.294: +21 -27 lines
Diff to previous 1.294 (colored) to selected 1.247 (colored)

make: inline ParseEmptyArg into CondParser_FuncCallEmpty

No functional change.

Revision 1.294 / (download) - annotate - [select for diffs], Sat Dec 11 10:28:59 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.293: +5 -9 lines
Diff to previous 1.293 (colored) to selected 1.247 (colored)

make: simplify evaluation of function 'empty'

No functional change.

Revision 1.293 / (download) - annotate - [select for diffs], Sat Dec 11 10:21:02 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.292: +7 -12 lines
Diff to previous 1.292 (colored) to selected 1.247 (colored)

make: merge duplicate code in ParseEmptyArg

No functional change.

Revision 1.292 / (download) - annotate - [select for diffs], Sat Dec 11 10:14:32 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.291: +12 -16 lines
Diff to previous 1.291 (colored) to selected 1.247 (colored)

make: use proper return type for ParseEmptyArg

Now that ParseEmptyArg is no longer bound to have the same prototype as
ParseFuncArg, it can use a more appropriate return type instead of
encoding everything in a size_t.

Since ParseEmptyArg never returned 0, that code path was unused.  It was
only used for all other functions.

No functional change.

Revision 1.291 / (download) - annotate - [select for diffs], Sat Dec 11 10:07:31 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.290: +5 -22 lines
Diff to previous 1.290 (colored) to selected 1.247 (colored)

make: remove unused arguments from CondParser_FuncCallEmpty

No functional change.

Revision 1.290 / (download) - annotate - [select for diffs], Sat Dec 11 10:01:16 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.289: +39 -11 lines
Diff to previous 1.289 (colored) to selected 1.247 (colored)

make: separate handling of 'empty' and the other functions

No functional change.

Revision 1.289 / (download) - annotate - [select for diffs], Fri Dec 10 23:56:17 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.288: +20 -18 lines
Diff to previous 1.288 (colored) to selected 1.247 (colored)

make: merge duplicate code in parsing conditions

No functional change.

Revision 1.288 / (download) - annotate - [select for diffs], Fri Dec 10 23:33:05 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.287: +13 -18 lines
Diff to previous 1.287 (colored) to selected 1.247 (colored)

make: remove recursion from CondParser_And

No functional change intended.  Before cond.c 1.286 from today, there
would have been the functional change that in malformed conditions, the
extra expression would not be evaluated.  Now that CondParser_Token is
always called with doEval == false, there is no change in behavior to be
expected.

Revision 1.287 / (download) - annotate - [select for diffs], Fri Dec 10 23:19:59 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.286: +3 -3 lines
Diff to previous 1.286 (colored) to selected 1.247 (colored)

make: do not expand operator token in CondParser_Or

At the point where CondParser_Or calls CondParser_Token, there was a
previous call to CondParser_And.  Due to this, the next token is already
stored in par->curr, and the parameter doEval is ignored.

Changing the argument from doEval to false makes the code similar to the
corresponding code in CondParser_And.

No functional change.

Revision 1.286 / (download) - annotate - [select for diffs], Fri Dec 10 23:12:44 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.285: +3 -3 lines
Diff to previous 1.285 (colored) to selected 1.247 (colored)

make: do not evaluate misplaced expressions in malformed conditions

This change only affects the behavior for parse errors.  Syntactically
well-formed conditions work exactly as before.

Revision 1.285 / (download) - annotate - [select for diffs], Fri Dec 10 19:47:20 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.284: +13 -18 lines
Diff to previous 1.284 (colored) to selected 1.247 (colored)

make: simplify parsing of '||' in conditions

Previously, the grammar said 'Or -> Or || And', while the code looked
more like 'Or -> And || Or'.  Make the code look like the grammar and
keep track of the resulting value of the condition explicitly.

No functional change intended.

Revision 1.284 / (download) - annotate - [select for diffs], Thu Dec 9 23:02:46 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.283: +13 -8 lines
Diff to previous 1.283 (colored) to selected 1.247 (colored)

make: revert previous commit to CondParser_Or

Even though the unit tests for make cover a lot of cases, they don't
cover all cases.  After the previous commit, the NetBSD build failed
with:

bsd.sys.mk line 247: \
    Malformed conditional (!defined(NOPIE) && \
    (!defined(LDSTATIC) || ${LDSTATIC} != "-static"))

Revision 1.283 / (download) - annotate - [select for diffs], Thu Dec 9 22:25:58 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.282: +10 -15 lines
Diff to previous 1.282 (colored) to selected 1.247 (colored)

make: avoid recursion in CondParser_Or

Previously, a long chain of '1 || 1 || 1 || 1 || ...' led to a deep
recursion.  Furhermore, the code didn't match the grammar on superficial
reading: the grammar said "or || and", the code said "and || or".

No functional change.

Revision 1.282 / (download) - annotate - [select for diffs], Thu Dec 9 20:13:09 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.281: +5 -5 lines
Diff to previous 1.281 (colored) to selected 1.247 (colored)

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.281 / (download) - annotate - [select for diffs], Sun Dec 5 10:11:31 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.280: +4 -4 lines
Diff to previous 1.280 (colored) to selected 1.247 (colored)

make: fix comments

Revision 1.280 / (download) - annotate - [select for diffs], Sun Sep 26 03:23:06 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.279: +4 -4 lines
Diff to previous 1.279 (colored) to selected 1.247 (colored)

make: fix lint warning on i386

cond.c(800): warning: argument #3 is converted from 'unsigned char' to
    'unsigned int' due to prototype [259]

Revision 1.279 / (download) - annotate - [select for diffs], Tue Sep 21 23:06:18 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.278: +4 -4 lines
Diff to previous 1.278 (colored) to selected 1.247 (colored)

make: reduce relocations, thereby reducing .text size

No functional change.

Revision 1.278 / (download) - annotate - [select for diffs], Tue Sep 21 22:53:35 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.277: +3 -3 lines
Diff to previous 1.277 (colored) to selected 1.247 (colored)

make: reduce relocations and thereby .text size, make opname const

No functional change.

Revision 1.277 / (download) - annotate - [select for diffs], Tue Sep 21 22:48:04 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.276: +13 -13 lines
Diff to previous 1.276 (colored) to selected 1.247 (colored)

make: rename and invert CondParser.lhsStrict to leftUnquotedOK

The new name is easier to grasp than the rather abstract word 'strict'.

No functional change.

Revision 1.276 / (download) - annotate - [select for diffs], Tue Sep 21 22:38:25 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.275: +18 -17 lines
Diff to previous 1.275 (colored) to selected 1.247 (colored)

make: do not allow unquoted 'left == right' after modifier ':?'

Having a static variable for state that clearly belongs in the parser
looked suspicious, and indeed it was wrong.

When the distinction between .if conditions and expressions of the form
${condition:?:} was added in cond.c 1.68 from 2015-05-05, a new unit
test was added, but it didn't cover this edge case.  At that time, the
state of the condition parser consisted of a few global variables
instead of a separate data type, as would have been appropriate for
parsing nested conditions.

Revision 1.275 / (download) - annotate - [select for diffs], Tue Sep 21 21:43:32 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.274: +4 -5 lines
Diff to previous 1.274 (colored) to selected 1.247 (colored)

make: remove unnecessary negation from CondParser_StringExpr

No functional change.

Revision 1.274 / (download) - annotate - [select for diffs], Tue Sep 21 21:39:32 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.273: +4 -4 lines
Diff to previous 1.273 (colored) to selected 1.247 (colored)

make: remove unnecessary const from parameters

These were leftovers from earlier refactorings, when extracting code to
separate functions.

No functional change.

Revision 1.273 / (download) - annotate - [select for diffs], Tue Sep 21 21:03:36 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.272: +4 -4 lines
Diff to previous 1.272 (colored) to selected 1.247 (colored)

make: fix out-of-bounds memory read (since previous commit)

Revision 1.272 / (download) - annotate - [select for diffs], Tue Sep 21 20:54:42 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.271: +18 -21 lines
Diff to previous 1.271 (colored) to selected 1.247 (colored)

make: reduce indentation in CondParser_FuncCall

No functional change.

Revision 1.271 / (download) - annotate - [select for diffs], Tue Sep 21 20:51:38 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.270: +6 -6 lines
Diff to previous 1.270 (colored) to selected 1.247 (colored)

make: fix documentation about operator associativity in conditions

Revision 1.270 / (download) - annotate - [select for diffs], Thu Jul 29 06:35:20 2021 UTC (2 years, 8 months ago) by rillig
Branch: MAIN
Changes since 1.269: +3 -3 lines
Diff to previous 1.269 (colored) to selected 1.247 (colored)

make: in TryParseNumber, reset errno as late as possible

No functional change.

Revision 1.269 / (download) - annotate - [select for diffs], Mon Jun 21 21:10:01 2021 UTC (2 years, 9 months ago) by rillig
Branch: MAIN
Changes since 1.268: +3 -3 lines
Diff to previous 1.268 (colored) to selected 1.247 (colored)

make: fix grammar in error message for malformed conditional

Revision 1.268 / (download) - annotate - [select for diffs], Mon Jun 21 21:07:35 2021 UTC (2 years, 9 months ago) by rillig
Branch: MAIN
Changes since 1.267: +4 -7 lines
Diff to previous 1.267 (colored) to selected 1.247 (colored)

make: clean up comments in cond.c

Revision 1.267 / (download) - annotate - [select for diffs], Fri Jun 11 14:52:03 2021 UTC (2 years, 9 months ago) by rillig
Branch: MAIN
Changes since 1.266: +4 -3 lines
Diff to previous 1.266 (colored) to selected 1.247 (colored)

make: inline strcmp when parsing conditions

GCC 10 does not do that even though it could easily.

No functional change.

Revision 1.266 / (download) - annotate - [select for diffs], Fri Jun 11 14:42:52 2021 UTC (2 years, 9 months ago) by rillig
Branch: MAIN
Changes since 1.265: +15 -10 lines
Diff to previous 1.265 (colored) to selected 1.247 (colored)

make: clean up function names and documentation for conditions

No functional change.

Revision 1.265 / (download) - annotate - [select for diffs], Fri Jun 11 14:37:51 2021 UTC (2 years, 9 months ago) by rillig
Branch: MAIN
Changes since 1.264: +5 -5 lines
Diff to previous 1.264 (colored) to selected 1.247 (colored)

make: rename If_Eval to EvalBare

No functional change.

Revision 1.264 / (download) - annotate - [select for diffs], Fri Jun 11 13:09:10 2021 UTC (2 years, 9 months ago) by rillig
Branch: MAIN
Changes since 1.263: +4 -5 lines
Diff to previous 1.263 (colored) to selected 1.247 (colored)

make: move parsing of function calls out of CondParser_LeafToken

The grammar above the parsing code says that a Leaf has nothing to do
with function calls, so don't mix these in the actual code.

No functional change.

Revision 1.263 / (download) - annotate - [select for diffs], Fri Jun 11 12:23:00 2021 UTC (2 years, 9 months ago) by rillig
Branch: MAIN
Changes since 1.262: +8 -7 lines
Diff to previous 1.262 (colored) to selected 1.247 (colored)

make: improve function names for parsing conditions

No functional change.

Revision 1.262 / (download) - annotate - [select for diffs], Mon Apr 19 23:51:42 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
CVS Tags: cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Changes since 1.261: +3 -3 lines
Diff to previous 1.261 (colored) to selected 1.247 (colored)

make: do not complain when skipping the condition 'no >= 10'

Seen in external/bsd/tmux when building with Clang.  See
varmod-ifelse.mk for the detailed story.

Revision 1.261 / (download) - annotate - [select for diffs], Sun Apr 4 11:56:43 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.260: +7 -7 lines
Diff to previous 1.260 (colored) to selected 1.247 (colored)

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.260 / (download) - annotate - [select for diffs], Sat Apr 3 11:08:40 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.259: +109 -109 lines
Diff to previous 1.259 (colored) to selected 1.247 (colored)

make: use C99 bool type instead of defining its own

No functional change.

Revision 1.259 / (download) - annotate - [select for diffs], Mon Mar 15 12:15:03 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.258: +4 -4 lines
Diff to previous 1.258 (colored) to selected 1.247 (colored)

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.258 / (download) - annotate - [select for diffs], Mon Mar 15 11:41:07 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.257: +6 -6 lines
Diff to previous 1.257 (colored) to selected 1.247 (colored)

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.257 / (download) - annotate - [select for diffs], Mon Feb 22 23:21:33 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.256: +3 -4 lines
Diff to previous 1.256 (colored) to selected 1.247 (colored)

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.256 / (download) - annotate - [select for diffs], Fri Feb 5 05:15:12 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.255: +3 -3 lines
Diff to previous 1.255 (colored) to selected 1.247 (colored)

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.255 / (download) - annotate - [select for diffs], Thu Feb 4 21:33:13 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.254: +6 -6 lines
Diff to previous 1.254 (colored) to selected 1.247 (colored)

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.254 / (download) - annotate - [select for diffs], Sat Jan 30 20:53:29 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.253: +6 -6 lines
Diff to previous 1.253 (colored) to selected 1.247 (colored)

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.253 / (download) - annotate - [select for diffs], Fri Jan 22 00:12:01 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.252: +13 -13 lines
Diff to previous 1.252 (colored) to selected 1.247 (colored)

make(1): remove "warning" from missing closing parenthesis

This only affects the diagnostics for parse errors that involve a
missing closing parenthesis.  Whether or not this is a parse error is
still the same.

It may look redundant to pass both the CondParser and the parsing
position pp to the functions, but that's necessary since during parsing,
not every code path updates the main parsing position immediately.

Revision 1.252 / (download) - annotate - [select for diffs], Thu Jan 21 23:32:28 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.251: +13 -12 lines
Diff to previous 1.251 (colored) to selected 1.247 (colored)

make(1): replace warning + error with just an error in conditionals

Before, there was a "warning" for comparing strings using '<', which was
wrong.  That warning was then followed by an error, after parsing the
whole conditional.  This was only because it was easier to implement.

Replace the warning with an actual error.  This only affects
conditionals in .if lines, the conditionals in the :? modifier such as
${"A" < "B":?smaller:greater} still print 2 errors.

Revision 1.251 / (download) - annotate - [select for diffs], Thu Jan 21 23:25:08 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.250: +68 -48 lines
Diff to previous 1.250 (colored) to selected 1.247 (colored)

make(1): fix debug output for comparison operators in conditionals

This produces fewer warnings than before, but these were edge cases that
probably didn't matter in practice.  The "Malformaed conditional" is
still generated, the set of accepted conditionals is still the same.

Revision 1.250 / (download) - annotate - [select for diffs], Thu Jan 21 23:06:06 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.249: +4 -2 lines
Diff to previous 1.249 (colored) to selected 1.247 (colored)

make(1): document wrong debug output in evaluation of conditionals

Revision 1.249 / (download) - annotate - [select for diffs], Thu Jan 21 22:54:13 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.248: +14 -18 lines
Diff to previous 1.248 (colored) to selected 1.247 (colored)

make(1): reformat CondParser_StringExpr

Revision 1.248 / (download) - annotate - [select for diffs], Thu Jan 21 14:24:25 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.247: +71 -54 lines
Diff to previous 1.247 (colored)

make(1): extract CondParser_StringExpr from CondParser_String

Revision 1.247 / (download) - annotate - [selected], Thu Jan 21 14:08:09 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.246: +11 -3 lines
Diff to previous 1.246 (colored)

make(1): demonstrate parse error without error message in conditional

Revision 1.246 / (download) - annotate - [select for diffs], Thu Jan 21 13:51:24 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.245: +5 -7 lines
Diff to previous 1.245 (colored) to selected 1.247 (colored)

make(1): make CondParser_String simpler

No functional change.

Revision 1.245 / (download) - annotate - [select for diffs], Thu Jan 21 13:31:38 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.244: +2 -3 lines
Diff to previous 1.244 (colored) to selected 1.247 (colored)

make(1): fix Coverity annotation

FStr is not an allocated data type.

Revision 1.244 / (download) - annotate - [select for diffs], Tue Jan 19 22:12:44 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.243: +40 -31 lines
Diff to previous 1.243 (colored) to selected 1.247 (colored)

make(1): extract DetermineKindOfConditional from Cond_EvalLine

Revision 1.243 / (download) - annotate - [select for diffs], Tue Jan 19 21:55:20 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.242: +59 -56 lines
Diff to previous 1.242 (colored) to selected 1.247 (colored)

make(1): remove struct If from evaluation of conditionals

The variant of the .if directive can be stored in the CondParser
directly, instead of pointing to a struct If.

The type CondParser may have to be renamed since the condition is not
only parsed, it is evaluated as well.

No functional change.

Revision 1.242 / (download) - annotate - [select for diffs], Tue Jan 19 20:51:46 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.241: +3 -3 lines
Diff to previous 1.241 (colored) to selected 1.247 (colored)

make(1): remove do-not-format markers from comments

These markers had been used inconsistently.  Furthermore the source code
had not been formatted automatically before 2020 at all, otherwise there
wouldn't have been any trailing whitespace left.

Revision 1.241 / (download) - annotate - [select for diffs], Tue Jan 19 19:29:35 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.240: +45 -48 lines
Diff to previous 1.240 (colored) to selected 1.247 (colored)

make(1): distinguish between tokens and results in conditionals

No functional change.

Revision 1.240 / (download) - annotate - [select for diffs], Tue Jan 19 18:20:30 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.239: +3 -3 lines
Diff to previous 1.239 (colored) to selected 1.247 (colored)

make(1): update references to the renamed CondParser functions

Revision 1.239 / (download) - annotate - [select for diffs], Tue Jan 19 18:18:43 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.238: +75 -111 lines
Diff to previous 1.238 (colored) to selected 1.247 (colored)

make(1): condense code for parsing and evaluating conditionals

Revision 1.238 / (download) - annotate - [select for diffs], Tue Jan 19 18:13:37 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.237: +6 -4 lines
Diff to previous 1.237 (colored) to selected 1.247 (colored)

make(1): add error handling for edge case in malformed conditions

Revision 1.237 / (download) - annotate - [select for diffs], Tue Jan 19 17:57:07 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.236: +8 -15 lines
Diff to previous 1.236 (colored) to selected 1.247 (colored)

make(1): fix possible return values for CondParser_Term

The invalid return values didn't do any harm since CondParser_Factor and
CondParser_Expr passed them through, and CondParser_Eval carefully
checks for TOK_TRUE or TOK_FALSE and treats everything else as an error.

No change in observable behavior since there is no debug logging in that
part of the code.

Revision 1.236 / (download) - annotate - [select for diffs], Tue Jan 19 17:49:13 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.235: +8 -2 lines
Diff to previous 1.235 (colored) to selected 1.247 (colored)

make(1): demonstrate wrong return value in CondParser_Term

Revision 1.235 / (download) - annotate - [select for diffs], Sun Jan 10 21:20:46 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.234: +3 -3 lines
Diff to previous 1.234 (colored) to selected 1.247 (colored)

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.234 / (download) - annotate - [select for diffs], Sat Jan 9 16:06:09 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.233: +9 -2 lines
Diff to previous 1.233 (colored) to selected 1.247 (colored)

make(1): fix lint warnings

Revision 1.233 / (download) - annotate - [select for diffs], Wed Dec 30 10:03:16 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.232: +40 -21 lines
Diff to previous 1.232 (colored) to selected 1.247 (colored)

make(1): format multi-line comments

Revision 1.232 / (download) - annotate - [select for diffs], Sun Dec 27 10:53:23 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.231: +3 -3 lines
Diff to previous 1.231 (colored) to selected 1.247 (colored)

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.231 / (download) - annotate - [select for diffs], Wed Dec 23 13:50:54 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.230: +4 -4 lines
Diff to previous 1.230 (colored) to selected 1.247 (colored)

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.230 / (download) - annotate - [select for diffs], Sun Dec 20 14:32:13 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.229: +5 -5 lines
Diff to previous 1.229 (colored) to selected 1.247 (colored)

make(1): change return type of Var_Value to FStr

Revision 1.229 / (download) - annotate - [select for diffs], Sun Dec 20 13:38:43 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.228: +14 -17 lines
Diff to previous 1.228 (colored) to selected 1.247 (colored)

make(1): return FStr from Var_Parse

This reduces the number of variable declarations at the call sites.

Revision 1.228 / (download) - annotate - [select for diffs], Sun Dec 20 13:03:48 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.227: +29 -45 lines
Diff to previous 1.227 (colored) to selected 1.247 (colored)

make(1): clean up memory handling in CondParser_String

Revision 1.227 / (download) - annotate - [select for diffs], Sun Dec 20 12:46:49 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.226: +25 -19 lines
Diff to previous 1.226 (colored) to selected 1.247 (colored)

make(1): clean up memory handling in CondParser_String

Revision 1.226 / (download) - annotate - [select for diffs], Mon Dec 14 22:17:11 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.225: +3 -3 lines
Diff to previous 1.225 (colored) to selected 1.247 (colored)

make(1): error out on .else with extraneous text

Revision 1.225 / (download) - annotate - [select for diffs], Mon Dec 14 21:56:17 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.224: +6 -3 lines
Diff to previous 1.224 (colored) to selected 1.247 (colored)

make(1): error out if an '.endif' contains extraneous text

Revision 1.224 / (download) - annotate - [select for diffs], Mon Dec 14 21:35:21 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.223: +29 -23 lines
Diff to previous 1.223 (colored) to selected 1.247 (colored)

make(1): make structure of the code in Cond_EvalLine clearer

Revision 1.223 / (download) - annotate - [select for diffs], Mon Dec 14 20:39:35 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.222: +3 -3 lines
Diff to previous 1.222 (colored) to selected 1.247 (colored)

make(1): don't pretend to expand CondParser_Eval

At that point, the variable expression has already been expanded.  To
avoid the impression that the token might be relevant, pass FALSE
instead of TRUE.  No change of behavior.

Revision 1.222 / (download) - annotate - [select for diffs], Sat Dec 12 00:33:25 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.221: +3 -3 lines
Diff to previous 1.221 (colored) to selected 1.247 (colored)

make(1): remove const from function parameters

These have been left-overs from refactoring, when these pieces were
extracted to separate functions.

Revision 1.221 / (download) - annotate - [select for diffs], Sat Dec 5 18:15:40 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.220: +3 -3 lines
Diff to previous 1.220 (colored) to selected 1.247 (colored)

make(1): remove redundant assignments

Revision 1.220 / (download) - annotate - [select for diffs], Sun Nov 29 01:40:26 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.219: +3 -3 lines
Diff to previous 1.219 (colored) to selected 1.247 (colored)

make(1): reduce memory allocation for dirSearchPath

Revision 1.219 / (download) - annotate - [select for diffs], Sat Nov 28 23:39:58 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.218: +3 -3 lines
Diff to previous 1.218 (colored) to selected 1.247 (colored)

make(1): reduce memory allocation for CmdOpts.create

Revision 1.218 / (download) - annotate - [select for diffs], Sat Nov 28 18:55:52 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.217: +3 -3 lines
Diff to previous 1.217 (colored) to selected 1.247 (colored)

make(1): remove pointer indirection from GNode.commands

Just to save a few memory allocations.  No noticeable effect on the
performance though.

Revision 1.217 / (download) - annotate - [select for diffs], Mon Nov 23 20:52:59 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.216: +3 -3 lines
Diff to previous 1.216 (colored) to selected 1.247 (colored)

make(1): use properly typed comparisons in boolean contexts

Revision 1.216 / (download) - annotate - [select for diffs], Mon Nov 23 20:41:20 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.215: +3 -3 lines
Diff to previous 1.215 (colored) to selected 1.247 (colored)

make(1): align end-of-line comments with tabs

Revision 1.215 / (download) - annotate - [select for diffs], Mon Nov 23 20:05:31 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.214: +809 -764 lines
Diff to previous 1.214 (colored) to selected 1.247 (colored)

make(1): indent cond.c with tabs instead of spaces

Revision 1.214 / (download) - annotate - [select for diffs], Fri Nov 13 09:01:59 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.213: +5 -3 lines
Diff to previous 1.213 (colored) to selected 1.247 (colored)

make(1): in lint mode, check for ".else <cond>"

Revision 1.213 / (download) - annotate - [select for diffs], Fri Nov 13 07:52:03 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.212: +34 -41 lines
Diff to previous 1.212 (colored) to selected 1.247 (colored)

make(1): use bitset for IfState

Previously, the individual IfStates contained redundant information,
which was apparent in the documentation.  This led to expressions like
(state > ELSE_ACTIVE) that are hard to read since the reader has to look
up the order of the enum.

To avoid this, the state of an '.if' block is now encoded using a bitset,
encoding the properties of each state directly.  This replaces the
previous (state > ELSE_ACTIVE) with !(state & IFS_ACTIVE), which is
easier to understand.

No change in behavior.

Revision 1.212 / (download) - annotate - [select for diffs], Fri Nov 13 07:35:27 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.211: +8 -15 lines
Diff to previous 1.211 (colored) to selected 1.247 (colored)

make(1): replace large switch with if-else in Cond_EvalLine

Revision 1.211 / (download) - annotate - [select for diffs], Fri Nov 13 06:19:27 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.210: +14 -8 lines
Diff to previous 1.210 (colored) to selected 1.247 (colored)

make(1): move the comment about ".else <cond>" to the correct place

Revision 1.210 / (download) - annotate - [select for diffs], Thu Nov 12 22:27:55 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.209: +3 -3 lines
Diff to previous 1.209 (colored) to selected 1.247 (colored)

make(1): improve readability of IfState documentation

The words "None" and "One" looked and sounded too similar.

Revision 1.209 / (download) - annotate - [select for diffs], Thu Nov 12 20:16:20 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.208: +19 -17 lines
Diff to previous 1.208 (colored) to selected 1.247 (colored)

make(1): rename local variable in Cond_EvalLine

A variable called line is not supposed to be a moving target, that's what
the name p is reserved for.

Revision 1.208 / (download) - annotate - [select for diffs], Thu Nov 12 20:06:37 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.207: +4 -13 lines
Diff to previous 1.207 (colored) to selected 1.247 (colored)

make(1): remove complicated code to find the definition for plain .if

Revision 1.207 / (download) - annotate - [select for diffs], Thu Nov 12 20:01:27 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.206: +33 -17 lines
Diff to previous 1.206 (colored) to selected 1.247 (colored)

make(1): document IfState in more detail

Revision 1.206 / (download) - annotate - [select for diffs], Thu Nov 12 08:12:07 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.205: +63 -41 lines
Diff to previous 1.205 (colored) to selected 1.247 (colored)

make(1): clean up Cond_EvalLine

The constant MAXIF was not a maximum but an initial capacity.  Inline it
to remove the misleading name.  Likewise, MAXIF_BUMP was an unnecessary
and wrong name.

Rename the enum since it only describes a single state, not multiple.

Rename the stack of states since it describes multiple states, not one.

Add markers where to add the missing error messages for unknown
directives or extraneous cond, such as in ".else cond" or ".endif cond".

Revision 1.205 / (download) - annotate - [select for diffs], Wed Nov 11 07:34:55 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.204: +6 -3 lines
Diff to previous 1.204 (colored) to selected 1.247 (colored)

make(1): document non-obvious special case in EvalNotEmpty

Revision 1.204 / (download) - annotate - [select for diffs], Wed Nov 11 07:13:42 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.203: +4 -4 lines
Diff to previous 1.203 (colored) to selected 1.247 (colored)

make(1): add test to cover the If_Eval call in EvalNotEmpty

Revision 1.203 / (download) - annotate - [select for diffs], Tue Nov 10 22:25:38 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.202: +4 -6 lines
Diff to previous 1.202 (colored) to selected 1.247 (colored)

make(1): remove unreachable code from CondParser_String

The code that has been removed was not reachable from after the Var_Parse
call.  All branches after the Var_Parse are either freed properly or
return the expanded value.

Revision 1.202 / (download) - annotate - [select for diffs], Tue Nov 10 20:52:28 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.201: +3 -3 lines
Diff to previous 1.201 (colored) to selected 1.247 (colored)

make(1): fix error message when parsing unknown .if (since 2005-05-01)

Revision 1.201 / (download) - annotate - [select for diffs], Tue Nov 10 20:44:18 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.200: +4 -10 lines
Diff to previous 1.200 (colored) to selected 1.247 (colored)

make(1): add tests for parsing conditionals, document a parsing bug

Revision 1.200 / (download) - annotate - [select for diffs], Tue Nov 10 08:02:35 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.199: +5 -2 lines
Diff to previous 1.199 (colored) to selected 1.247 (colored)

make(1): document ParseEmptyArg

Revision 1.199 / (download) - annotate - [select for diffs], Tue Nov 10 07:40:30 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.198: +11 -11 lines
Diff to previous 1.198 (colored) to selected 1.247 (colored)

make(1): remove unnecessary NULL marker from functions list

Comparing the pointer works equally well and uses less memory.

Revision 1.198 / (download) - annotate - [select for diffs], Mon Nov 9 00:07:06 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.197: +5 -4 lines
Diff to previous 1.197 (colored) to selected 1.247 (colored)

make(1): document handling of '#' and '\n' in conditionals

Revision 1.197 / (download) - annotate - [select for diffs], Sun Nov 8 23:54:28 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.196: +12 -4 lines
Diff to previous 1.196 (colored) to selected 1.247 (colored)

make(1): in lint mode, only allow '&&' and '||', not '&' and '|'

These variants of the condition operators are neither documented in the
manual page nor are they used in practice.

Revision 1.196 / (download) - annotate - [select for diffs], Sun Nov 8 23:20:19 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.195: +26 -12 lines
Diff to previous 1.195 (colored) to selected 1.247 (colored)

make(1): extract CondParser_Func from CondParser_LeafToken

Revision 1.195 / (download) - annotate - [select for diffs], Sun Nov 8 23:10:22 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.194: +3 -3 lines
Diff to previous 1.194 (colored) to selected 1.247 (colored)

make(1): inline strchr call in CondParser_LeafToken

Revision 1.194 / (download) - annotate - [select for diffs], Sun Nov 8 23:08:49 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.193: +6 -4 lines
Diff to previous 1.193 (colored) to selected 1.247 (colored)

make(1): rename CondParser_Func to CondParser_LeafToken

The previous name was misleading since the function did not only parse
function call expressions.

Revision 1.193 / (download) - annotate - [select for diffs], Sun Nov 8 23:05:47 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.192: +4 -4 lines
Diff to previous 1.192 (colored) to selected 1.247 (colored)

make(1): fix type mismatch between int and Token

Revision 1.192 / (download) - annotate - [select for diffs], Sun Nov 8 22:44:05 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.191: +5 -5 lines
Diff to previous 1.191 (colored) to selected 1.247 (colored)

make(1): improve local variable name in EvalNotEmpty

Revision 1.191 / (download) - annotate - [select for diffs], Sun Nov 8 22:41:40 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.190: +11 -11 lines
Diff to previous 1.190 (colored) to selected 1.247 (colored)

make(1): improve variable names in EvalNotEmpty

In a unary expression, there is no left-hand side.

Revision 1.190 / (download) - annotate - [select for diffs], Sun Nov 8 22:37:52 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.189: +12 -12 lines
Diff to previous 1.189 (colored) to selected 1.247 (colored)

make(1): rename local variable in CondParser_String

Revision 1.189 / (download) - annotate - [select for diffs], Sun Nov 8 22:22:03 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.188: +22 -21 lines
Diff to previous 1.188 (colored) to selected 1.247 (colored)

make(1): clean up TryParseNumber in conditions

More descriptive variable names, more appropriate literals for
comparisons, one task per paragraph of code.

Revision 1.188 / (download) - annotate - [select for diffs], Sun Nov 8 21:10:18 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.187: +6 -9 lines
Diff to previous 1.187 (colored) to selected 1.247 (colored)

make(1): clean up FuncExists

Revision 1.187 / (download) - annotate - [select for diffs], Sun Nov 8 19:53:11 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.186: +3 -3 lines
Diff to previous 1.186 (colored) to selected 1.247 (colored)

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.186 / (download) - annotate - [select for diffs], Sun Nov 8 19:24:19 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.185: +4 -3 lines
Diff to previous 1.185 (colored) to selected 1.247 (colored)

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.185 / (download) - annotate - [select for diffs], Sat Nov 7 20:39:56 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.184: +19 -27 lines
Diff to previous 1.184 (colored) to selected 1.247 (colored)

make(1): clean up CondParser_Comparison

Revision 1.184 / (download) - annotate - [select for diffs], Sat Nov 7 20:35:04 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.183: +6 -4 lines
Diff to previous 1.183 (colored) to selected 1.247 (colored)

make(1): reword condition in CondParser_String

The parentheses were confusing for human readers.

The compiler doesn't really care about the wording of the condition, GCC
5 on amd64 generates non-obvious but nice code anyway, replacing the
logical or with a logical and.

Revision 1.183 / (download) - annotate - [select for diffs], Sat Nov 7 20:14:15 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.182: +16 -10 lines
Diff to previous 1.182 (colored) to selected 1.247 (colored)

make(1): fix type mismatch between Boolean and Token

Even though the C boolean and Token are encoded the same, the code should
still distinguish them, for the benefit of human readers.

Revision 1.182 / (download) - annotate - [select for diffs], Sat Nov 7 20:11:32 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.181: +3 -3 lines
Diff to previous 1.181 (colored) to selected 1.247 (colored)

make(1): fix type mismatch in If_Eval

No practical consequences since TOK_FALSE == 0 and TOK_TRUE == 1.

Revision 1.181 / (download) - annotate - [select for diffs], Sat Nov 7 14:40:51 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.180: +3 -3 lines
Diff to previous 1.180 (colored) to selected 1.247 (colored)

make(1): add test for parse error in function defined()

Revision 1.180 / (download) - annotate - [select for diffs], Sat Nov 7 14:37:30 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.179: +3 -3 lines
Diff to previous 1.179 (colored) to selected 1.247 (colored)

make(1): add test for parse error in condition using empty()

Revision 1.179 / (download) - annotate - [select for diffs], Sat Nov 7 14:11:58 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.178: +4 -4 lines
Diff to previous 1.178 (colored) to selected 1.247 (colored)

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.178 / (download) - annotate - [select for diffs], Sat Nov 7 10:16:18 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.177: +26 -27 lines
Diff to previous 1.177 (colored) to selected 1.247 (colored)

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.177 / (download) - annotate - [select for diffs], Fri Nov 6 22:39:10 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.176: +8 -16 lines
Diff to previous 1.176 (colored) to selected 1.247 (colored)

make(1): merge duplicate code for skipping horizontal whitespace

Revision 1.176 / (download) - annotate - [select for diffs], Fri Nov 6 20:50:48 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.175: +16 -7 lines
Diff to previous 1.175 (colored) to selected 1.247 (colored)

make(1): fix tests directive-ifmake and varcmd with custom boolean

When make is compiled with -DUSE_UCHAR_BOOLEAN, these tests failed.
Merge duplicate code and don't depend on the actual value of TRUE when
evaluating conditions.

Revision 1.175 / (download) - annotate - [select for diffs], Thu Nov 5 17:27:16 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.174: +4 -4 lines
Diff to previous 1.174 (colored) to selected 1.247 (colored)

make(1): remove redundant parentheses from sizeof operator

The parentheses are only needed if the argument is a type, not an
expression.

Revision 1.174 / (download) - annotate - [select for diffs], Mon Nov 2 19:07:09 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.173: +8 -8 lines
Diff to previous 1.173 (colored) to selected 1.247 (colored)

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.173 / (download) - annotate - [select for diffs], Fri Oct 30 20:30:44 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.172: +3 -3 lines
Diff to previous 1.172 (colored) to selected 1.247 (colored)

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.172 / (download) - annotate - [select for diffs], Fri Oct 30 14:56:23 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.171: +3 -3 lines
Diff to previous 1.171 (colored) to selected 1.247 (colored)

make(1): clean up is_separator

Revision 1.171 / (download) - annotate - [select for diffs], Fri Oct 30 14:51:47 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.170: +3 -3 lines
Diff to previous 1.170 (colored) to selected 1.247 (colored)

make(1): fix parse error in string literal in conditional

The string literal "${VAR} " had produced a "Malformed conditional", at
least since 2003.  (That's the oldest make I have available for testing.)
Strange that nobody else noticed that in the last 17 years.

Revision 1.170 / (download) - annotate - [select for diffs], Fri Oct 30 07:19:30 2020 UTC (3 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.169: +8 -6 lines
Diff to previous 1.169 (colored) to selected 1.247 (colored)

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.169 / (download) - annotate - [select for diffs], Mon Oct 26 21:34:10 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.168: +3 -3 lines
Diff to previous 1.168 (colored) to selected 1.247 (colored)

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.168 / (download) - annotate - [select for diffs], Sat Oct 24 04:51:19 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.167: +6 -6 lines
Diff to previous 1.167 (colored) to selected 1.247 (colored)

make(1): clean up comments in cond.c

Revision 1.167 / (download) - annotate - [select for diffs], Fri Oct 23 18:36:09 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.166: +4 -4 lines
Diff to previous 1.166 (colored) to selected 1.247 (colored)

make(1): negate OP_NOP and rename it to GNode_IsTarget

Revision 1.166 / (download) - annotate - [select for diffs], Fri Oct 23 06:57:41 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.165: +8 -10 lines
Diff to previous 1.165 (colored) to selected 1.247 (colored)

make(1): inline CondFindStrMatch into FuncMake

Revision 1.165 / (download) - annotate - [select for diffs], Thu Oct 22 05:50:02 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.164: +3 -3 lines
Diff to previous 1.164 (colored) to selected 1.247 (colored)

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.164 / (download) - annotate - [select for diffs], Sun Oct 18 17:19:54 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.163: +3 -3 lines
Diff to previous 1.163 (colored) to selected 1.247 (colored)

make(1): add tags to enum types

This allows IDEs to offer better type information than "anonymous enum".

Revision 1.163 / (download) - annotate - [select for diffs], Sat Oct 17 17:47:14 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.162: +4 -4 lines
Diff to previous 1.162 (colored) to selected 1.247 (colored)

make(1): fix indentation

Revision 1.162 / (download) - annotate - [select for diffs], Mon Oct 5 19:59:07 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.161: +5 -5 lines
Diff to previous 1.161 (colored) to selected 1.247 (colored)

make(1): make cond.c ready for WARNS=6, part 2

Revision 1.161 / (download) - annotate - [select for diffs], Mon Oct 5 19:56:08 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.160: +18 -18 lines
Diff to previous 1.160 (colored) to selected 1.247 (colored)

make(1): make cond.c ready for WARNS=6

Revision 1.160 / (download) - annotate - [select for diffs], Mon Oct 5 19:27:47 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.159: +9 -12 lines
Diff to previous 1.159 (colored) to selected 1.247 (colored)

make(1): revert previous commit

It had accidentally reverted all the work from the past few days.

Revision 1.159 / (download) - annotate - [select for diffs], Mon Oct 5 19:24:29 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.158: +12 -9 lines
Diff to previous 1.158 (colored) to selected 1.247 (colored)

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.158 / (download) - annotate - [select for diffs], Mon Oct 5 18:29:20 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.157: +4 -4 lines
Diff to previous 1.157 (colored) to selected 1.247 (colored)

make(1): fix test for .ifndef when compiled with -DUSE_UCHAR_BOOLEAN

In that compilation variant, TRUE is defined to 255, to see whether all
boolean expressions evaluate to either 1 or 0.  The field If.doNot in
cond.c doesn't do this since it uses the actual value of TRUE.
Therefore, change the evaluation slightly to also handle this case.

Revision 1.157 / (download) - annotate - [select for diffs], Sat Oct 3 21:19:54 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.156: +7 -10 lines
Diff to previous 1.156 (colored) to selected 1.247 (colored)

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.156 / (download) - annotate - [select for diffs], Thu Oct 1 22:42:00 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.155: +2 -3 lines
Diff to previous 1.155 (colored) to selected 1.247 (colored)

make(1): remove redundant function prototypes

Revision 1.155 / (download) - annotate - [select for diffs], Mon Sep 28 23:13:57 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.154: +3 -3 lines
Diff to previous 1.154 (colored) to selected 1.247 (colored)

make(1): replace += 1 with ++ and -= 1 with --

Just for visual consistency.  The generated code stays exactly the same.

Revision 1.154 / (download) - annotate - [select for diffs], Mon Sep 28 20:46:11 2020 UTC (3 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.153: +6 -14 lines
Diff to previous 1.153 (colored) to selected 1.247 (colored)

make(1): make debugging code shorter

Revision 1.153 / (download) - annotate - [select for diffs], Sun Sep 27 21:35:16 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.152: +5 -5 lines
Diff to previous 1.152 (colored) to selected 1.247 (colored)

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.152 / (download) - annotate - [select for diffs], Sat Sep 26 16:00:12 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.151: +4 -8 lines
Diff to previous 1.151 (colored) to selected 1.247 (colored)

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.151 / (download) - annotate - [select for diffs], Fri Sep 25 20:48:23 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.150: +7 -7 lines
Diff to previous 1.150 (colored) to selected 1.247 (colored)

make(1): rename variables cp2 to be more expressive

Revision 1.150 / (download) - annotate - [select for diffs], Fri Sep 25 15:54:50 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.149: +3 -3 lines
Diff to previous 1.149 (colored) to selected 1.247 (colored)

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.149 / (download) - annotate - [select for diffs], Fri Sep 25 15:40:06 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.148: +24 -31 lines
Diff to previous 1.148 (colored) to selected 1.247 (colored)

make(1): rename local variables in ParseFuncArg

Revision 1.148 / (download) - annotate - [select for diffs], Tue Sep 22 06:06:18 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.147: +5 -5 lines
Diff to previous 1.147 (colored) to selected 1.247 (colored)

make(1): rename VarParseErrors to VarParseResult

The name VPE_OK was confusing since it was not an error at all.

Revision 1.147 / (download) - annotate - [select for diffs], Mon Sep 14 23:09:34 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.146: +3 -3 lines
Diff to previous 1.146 (colored) to selected 1.247 (colored)

make(1): fix coverity annotation for CondParser_String

It had been broken since 2020-09-08, when CondLexer (now CondParser) was
added.

Revision 1.146 / (download) - annotate - [select for diffs], Sun Sep 13 19:46:23 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.145: +14 -4 lines
Diff to previous 1.145 (colored) to selected 1.247 (colored)

make(1): suppress wrong "Malformed conditional" for undefined variables

This only has an effect in lint mode right now.

Revision 1.145 / (download) - annotate - [select for diffs], Sun Sep 13 18:27:39 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.144: +10 -5 lines
Diff to previous 1.144 (colored) to selected 1.247 (colored)

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.144 / (download) - annotate - [select for diffs], Sun Sep 13 15:15:51 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.143: +4 -14 lines
Diff to previous 1.143 (colored) to selected 1.247 (colored)

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.143 / (download) - annotate - [select for diffs], Sun Sep 13 13:53:55 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.142: +6 -6 lines
Diff to previous 1.142 (colored) to selected 1.247 (colored)

make(1): fix parameter type of CondEvalExpression

Revision 1.142 / (download) - annotate - [select for diffs], Sun Sep 13 13:50:27 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.141: +21 -16 lines
Diff to previous 1.141 (colored) to selected 1.247 (colored)

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.141 / (download) - annotate - [select for diffs], Sat Sep 12 18:19:50 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.140: +6 -6 lines
Diff to previous 1.140 (colored) to selected 1.247 (colored)

make(1): rename Var_ParsePP back to Var_Parse

The migration to the "parsing position" pointer has been done.

Revision 1.140 / (download) - annotate - [select for diffs], Sat Sep 12 18:04:45 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.139: +22 -15 lines
Diff to previous 1.139 (colored) to selected 1.247 (colored)

make(1): migrate CondParser_String to Var_ParsePP

Revision 1.139 / (download) - annotate - [select for diffs], Sat Sep 12 18:02:43 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.138: +5 -5 lines
Diff to previous 1.138 (colored) to selected 1.247 (colored)

make(1): use correct character literals in TryParseNumber

Revision 1.138 / (download) - annotate - [select for diffs], Sat Sep 12 17:14:40 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.137: +5 -4 lines
Diff to previous 1.137 (colored) to selected 1.247 (colored)

make(1): clean up code in CondParser_String

The two parts of the for loop were not related in any way, which made
the code more confusing than necessary.

Revision 1.137 / (download) - annotate - [select for diffs], Sat Sep 12 14:41:00 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.136: +6 -6 lines
Diff to previous 1.136 (colored) to selected 1.247 (colored)

make(1): fix inconsistent code indentation

Revision 1.136 / (download) - annotate - [select for diffs], Sat Sep 12 10:41:43 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.135: +6 -8 lines
Diff to previous 1.135 (colored) to selected 1.247 (colored)

make(1): inline local variable in Cond_Eval

Revision 1.135 / (download) - annotate - [select for diffs], Sat Sep 12 10:38:52 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.134: +11 -6 lines
Diff to previous 1.134 (colored) to selected 1.247 (colored)

make(1): fix wording of parse error in conditionals

The word "should" is not appropriate for situations that eventually lead
to a parse error.

Revision 1.134 / (download) - annotate - [select for diffs], Fri Sep 11 17:32:36 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.133: +11 -12 lines
Diff to previous 1.133 (colored) to selected 1.247 (colored)

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.133 / (download) - annotate - [select for diffs], Fri Sep 11 16:37:48 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.132: +42 -39 lines
Diff to previous 1.132 (colored) to selected 1.247 (colored)

make(1): split EvalComparison into smaller functions

Revision 1.132 / (download) - annotate - [select for diffs], Fri Sep 11 16:23:47 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.131: +14 -30 lines
Diff to previous 1.131 (colored) to selected 1.247 (colored)

make(1): clean up code for evaluating conditions

Revision 1.131 / (download) - annotate - [select for diffs], Fri Sep 11 16:22:15 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.130: +28 -27 lines
Diff to previous 1.130 (colored) to selected 1.247 (colored)

make(1): extract EvalNotEmpty from CondParser_Comparison

Revision 1.130 / (download) - annotate - [select for diffs], Fri Sep 11 13:58:45 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.129: +74 -74 lines
Diff to previous 1.129 (colored) to selected 1.247 (colored)

make(1): split CondParser_Comparison into 2 parts

Revision 1.129 / (download) - annotate - [select for diffs], Fri Sep 11 07:09:40 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.128: +10 -3 lines
Diff to previous 1.128 (colored) to selected 1.247 (colored)

make(1): document CondParser_Comparison

Revision 1.128 / (download) - annotate - [select for diffs], Fri Sep 11 06:47:42 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.127: +17 -12 lines
Diff to previous 1.127 (colored) to selected 1.247 (colored)

make(1): add tests for really strange edge cases in conditions

Revision 1.127 / (download) - annotate - [select for diffs], Fri Sep 11 06:08:10 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.126: +14 -14 lines
Diff to previous 1.126 (colored) to selected 1.247 (colored)

make(1): reorder parameters of condition parsing functions

First the subject, then the options, then the output parameters.

Revision 1.126 / (download) - annotate - [select for diffs], Fri Sep 11 05:03:20 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.125: +10 -21 lines
Diff to previous 1.125 (colored) to selected 1.247 (colored)

make(1): reduce code size in CondParser_Eval

Revision 1.125 / (download) - annotate - [select for diffs], Fri Sep 11 04:57:15 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.124: +59 -59 lines
Diff to previous 1.124 (colored) to selected 1.247 (colored)

make(1): use consistent naming scheme for condition parsing functions

Revision 1.124 / (download) - annotate - [select for diffs], Fri Sep 11 04:40:26 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.123: +8 -8 lines
Diff to previous 1.123 (colored) to selected 1.247 (colored)

make(1): rename CondGetString to CondParser_String

This describes the function's effect more accurately.  The verb "get" is
not commonly associated to having side effects.

Revision 1.123 / (download) - annotate - [select for diffs], Fri Sep 11 04:22:22 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.122: +15 -15 lines
Diff to previous 1.122 (colored) to selected 1.247 (colored)

make(1): replace *par->p with par->p[0]

It's a few characters more code than before but can be read strictly
from left to right, which was not possible before.

Revision 1.122 / (download) - annotate - [select for diffs], Fri Sep 11 04:18:44 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.121: +53 -53 lines
Diff to previous 1.121 (colored) to selected 1.247 (colored)

make(1): rename CondParser.condExpr to p

The prefix "cond" was needed when this struct field was a global
variable.  The main name "expr" was not precise enough since this code is
about parsing a condition, not an expression.

During parsing, this variable does not contain the whole expression but
a pointer to the remaining part of the condition, therefore the name
"expr" had been confusing.

Revision 1.121 / (download) - annotate - [select for diffs], Fri Sep 11 04:07:44 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.120: +111 -108 lines
Diff to previous 1.120 (colored) to selected 1.247 (colored)

make(1): rename CondLexer to CondParser

The name CondLexer was wrong since this type is about parsing conditions
that can be arbitrarily nested.

Revision 1.120 / (download) - annotate - [select for diffs], Thu Sep 10 23:37:54 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.119: +9 -10 lines
Diff to previous 1.119 (colored) to selected 1.247 (colored)

make(1): reduce code size in CondGetString

The pattern is now the usual "test the character, then increment the
pointer", throughout the whole function.

Revision 1.119 / (download) - annotate - [select for diffs], Thu Sep 10 23:27:27 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.118: +13 -11 lines
Diff to previous 1.118 (colored) to selected 1.247 (colored)

make(1): skip redundant condExpr-- in CondGetString

Revision 1.118 / (download) - annotate - [select for diffs], Thu Sep 10 22:47:22 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.117: +9 -9 lines
Diff to previous 1.117 (colored) to selected 1.247 (colored)

make(1): reduce code size for parsing the || or && operators

On x86_64, accessing [0] generates less code than [1].

Revision 1.117 / (download) - annotate - [select for diffs], Tue Sep 8 18:51:23 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.116: +40 -60 lines
Diff to previous 1.116 (colored) to selected 1.247 (colored)

make(1): clean up comments in cond.c

Revision 1.116 / (download) - annotate - [select for diffs], Tue Sep 8 18:10:34 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.115: +12 -10 lines
Diff to previous 1.115 (colored) to selected 1.247 (colored)

make(1): add CondLexer_SkipWhitespace

Revision 1.115 / (download) - annotate - [select for diffs], Tue Sep 8 18:06:27 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.114: +15 -14 lines
Diff to previous 1.114 (colored) to selected 1.247 (colored)

make(1): rename CondLexer.condPushBack to curr

This variable has some context information from the struct now,
therefore its name can be shorter.

Revision 1.114 / (download) - annotate - [select for diffs], Tue Sep 8 17:55:23 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.113: +101 -103 lines
Diff to previous 1.113 (colored) to selected 1.247 (colored)

make(1): group the condition parsing state into a struct

Instead of having 3 global variables, the struct clearly communicates
that the 3 variables belong together. During debugging, it's easy to
just "p *lex" instead of remembering the names of the 3 former global
variables.

Converting the global variables into a local variable makes it
immediately clear that the functions in this file operate on this
struct.  Keeping the global variables in mind is more difficult.  Having
a local variable also gets rid of the 3 sv_* variables in
Cond_EvalExpression, which were also a sign that these "global
variables" were not that global at all.

This commit only contains the minimal code changes for converting the
variables into a local struct.  It was tempting to add functions like
CondLexer_SkipWhitespace, but this is better left for a follow-up
commit.

Revision 1.113 / (download) - annotate - [select for diffs], Tue Sep 8 14:51:43 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.112: +5 -10 lines
Diff to previous 1.112 (colored) to selected 1.247 (colored)

make(1): in CondGetString, replace repeated Buf_Add with Buf_AddStr

Revision 1.112 / (download) - annotate - [select for diffs], Fri Sep 4 21:08:44 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.111: +31 -25 lines
Diff to previous 1.111 (colored) to selected 1.247 (colored)

make(1): rename local functions for parsing conditions

The word "get" implies a cheap operation without side effects.  Parsing
instead has lots of side effects, even if it's only that the parsing
position is updated.

Revision 1.111 / (download) - annotate - [select for diffs], Fri Sep 4 20:51:01 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.110: +9 -18 lines
Diff to previous 1.110 (colored) to selected 1.247 (colored)

make(1): migrate get_mpt_arg to Var_ParsePP

This part is covered well by the unit tests.  When I forgot to decrement
the linePtr, several of them failed reliably.

Revision 1.110 / (download) - annotate - [select for diffs], Fri Sep 4 20:32:34 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.109: +4 -6 lines
Diff to previous 1.109 (colored) to selected 1.247 (colored)

make(1): migrate Var_Parse in CondGetArg to Var_ParsePP

Revision 1.109 / (download) - annotate - [select for diffs], Thu Sep 3 17:16:01 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.108: +5 -4 lines
Diff to previous 1.108 (colored) to selected 1.247 (colored)

make(1): document use of magic values in CondDoEmpty

Revision 1.108 / (download) - annotate - [select for diffs], Thu Sep 3 16:14:58 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.107: +22 -32 lines
Diff to previous 1.107 (colored) to selected 1.247 (colored)

make(1): update documentation for Cond_EvalExpression and Cond_Eval

Revision 1.107 / (download) - annotate - [select for diffs], Thu Sep 3 16:02:02 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.106: +5 -5 lines
Diff to previous 1.106 (colored) to selected 1.247 (colored)

make(1): make parameter of Cond_Eval and Cond_EvalExpression const

Revision 1.106 / (download) - annotate - [select for diffs], Sat Aug 29 13:38:48 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.105: +7 -7 lines
Diff to previous 1.105 (colored) to selected 1.247 (colored)

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.105 / (download) - annotate - [select for diffs], Sat Aug 29 10:12:06 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.104: +5 -5 lines
Diff to previous 1.104 (colored) to selected 1.247 (colored)

make(1): rename Lst_FindB back to Lst_Find

The migration from "comparison function" to "match function" is done,
the "B" in the names is no longer needed.

Revision 1.104 / (download) - annotate - [select for diffs], Sat Aug 29 09:30:10 2020 UTC (3 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.103: +7 -8 lines
Diff to previous 1.103 (colored) to selected 1.247 (colored)

make(1): start replacing Lst_Find with Lst_FindB

Lst_Find is called with a "comparison" function that returns the integer
0 if the desired node is found.  This leads to confusion since there are
so many different return value conventions for int, such as 0/1 for
mimicking false/true, -1/0 as in close(2), and the sign as in strcmp(3).
This API is much easier to understand if the "comparison" function is
not called a comparison function (since that is too close to strcmp),
but a "match" function that just returns a boolean.

In Lst_FindFromB, the node argument may be null.  This deviates from the
other Lst functions, which require Lst and LstNode to generally be
non-null.  In this case it is useful though to make the calling code
simpler.

In arch.c, this makes a lot of the previous documentation redundant.

In cond.c, the documentation is reduced a little bit since it had
already been cleaned up before.  It also removes the strange negation
from CondFindStrMatch.

In dir.c, the documentation collapses as well.

In main.c, separating the ReadMakefile function from the callbacks for
Lst_FindB allows the former to get back its natural function signature,
with proper types and no unused parameters.

To catch any accidental mistakes during the migration from Lst_Find to
Lst_FindB, the code can be compiled with -DUSE_DOUBLE_BOOLEAN, which
will complain about incompatible function pointer types.

Revision 1.103 / (download) - annotate - [select for diffs], Fri Aug 28 04:48:56 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.102: +5 -5 lines
Diff to previous 1.102 (colored) to selected 1.247 (colored)

make(1): remove trailing 'S' from names of Lst functions

The migration from null-passing Lst functions to argument-checking Lst
functions is completed.

There were 2 surprises: The targets list may be NULL, and in Dir_AddDir,
the path may be NULL.  The latter case is especially surprising since
that function turns into an almost-nop in that case.  This is another
case where probably 2 independent functions have been squeezed into a
single function.  This may be improved in a follow-up commit.

All other lists were fine.  They were always defined and thus didn't
need much work.

Revision 1.102 / (download) - annotate - [select for diffs], Fri Aug 28 04:28:45 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.101: +4 -4 lines
Diff to previous 1.101 (colored) to selected 1.247 (colored)

make(1): migrate Lst_Find to Lst_FindS

Revision 1.101 / (download) - annotate - [select for diffs], Thu Aug 27 19:15:35 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.100: +4 -4 lines
Diff to previous 1.100 (colored) to selected 1.247 (colored)

make(1): migrate Lst_IsEmpty to Lst_IsEmptyS

Revision 1.100 / (download) - annotate - [select for diffs], Sun Aug 23 16:58:02 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.99: +4 -4 lines
Diff to previous 1.99 (colored) to selected 1.247 (colored)

make(1): reverse order of the Lst_Find parameters

The other callbacks all have (function, param), only the Lst_Find had
(param, function), which was inconsistent.

Revision 1.99 / (download) - annotate - [select for diffs], Sat Aug 22 21:42:38 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.98: +7 -11 lines
Diff to previous 1.98 (colored) to selected 1.247 (colored)

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.98 / (download) - annotate - [select for diffs], Thu Aug 20 18:47:57 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.97: +7 -6 lines
Diff to previous 1.97 (colored) to selected 1.247 (colored)

make(1): move complicated boolean expression out of the function call

It's easier to inspect in a debugger this way.

Revision 1.97 / (download) - annotate - [select for diffs], Thu Aug 20 17:11:47 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.96: +5 -5 lines
Diff to previous 1.96 (colored) to selected 1.247 (colored)

make(1): fix type of string length variables

Revision 1.96 / (download) - annotate - [select for diffs], Thu Aug 20 17:06:26 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.95: +5 -9 lines
Diff to previous 1.95 (colored) to selected 1.247 (colored)

make(1): fix wrong or outdated comments

Revision 1.95 / (download) - annotate - [select for diffs], Thu Aug 13 20:13:46 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.94: +4 -4 lines
Diff to previous 1.94 (colored) to selected 1.247 (colored)

make(1): fix type mismatch in compare_expression

This was caught by a simple "typedef double Boolean" in sprite.h.

If only there were a C compiler with "strict" mode, where pointers,
numbers and booleans were separate and unassignable data types, this
copy-and-paste typo would have been caught much earlier.

Revision 1.94 / (download) - annotate - [select for diffs], Thu Aug 13 19:30:37 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.93: +4 -4 lines
Diff to previous 1.93 (colored) to selected 1.247 (colored)

make(1): fix type of local variable in CondGetString

When the Boolean type from sprite.h is replaced with C99's standard bool
type, the chained assignment leads to the following compile error with
GCC 5:

cond.c:404:5: error: suggest parentheses around assignment used as truth
                     value [-Werror=parentheses]
     *quoted = qt = *condExpr == '"' ? 1 : 0;

Changing the type of qt from int to bool fixes this.

Revision 1.93 / (download) - annotate - [select for diffs], Sun Aug 9 19:51:02 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.92: +122 -120 lines
Diff to previous 1.92 (colored) to selected 1.247 (colored)

make(1): format the source code consistently, at least per file

Some files use 4 spaces per indentation level, others use 8.  At least
for the few files from this commit, they use a consistent style
throughout each file now.

In Cond_Eval, the #define has changed into an enum since the identifiers
need not be visible to the C preprocessor.

Revision 1.92 / (download) - annotate - [select for diffs], Sat Aug 8 18:54:04 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.91: +7 -7 lines
Diff to previous 1.91 (colored) to selected 1.247 (colored)

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.91 / (download) - annotate - [select for diffs], Sat Aug 8 17:03:04 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.90: +18 -16 lines
Diff to previous 1.90 (colored) to selected 1.247 (colored)

make(1): mark condition strings as constant

Revision 1.90 / (download) - annotate - [select for diffs], Sat Aug 8 16:57:59 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.89: +41 -168 lines
Diff to previous 1.89 (colored) to selected 1.247 (colored)

make(1): remove redundant documentation from cond.c

Many of the functions in cond.c are so small that it's faster to read
their code instead of a large block of documentation.

There are other functions that actually need a detailed description.
These have been left as-is.

Revision 1.89 / (download) - annotate - [select for diffs], Sat Aug 8 16:31:37 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.88: +43 -55 lines
Diff to previous 1.88 (colored) to selected 1.247 (colored)

make(1): remove redundant function prototypes from cond.c

Revision 1.88 / (download) - annotate - [select for diffs], Mon Aug 3 20:26:09 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.87: +4 -4 lines
Diff to previous 1.87 (colored) to selected 1.247 (colored)

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.87 / (download) - annotate - [select for diffs], Sat Aug 1 21:40:49 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.86: +10 -10 lines
Diff to previous 1.86 (colored) to selected 1.247 (colored)

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.86 / (download) - annotate - [select for diffs], Sat Aug 1 18:02:37 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.85: +8 -12 lines
Diff to previous 1.85 (colored) to selected 1.247 (colored)

make(1): use enum for return values of Cond_Eval and friends

Revision 1.85 / (download) - annotate - [select for diffs], Sat Aug 1 14:47:49 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.84: +4 -4 lines
Diff to previous 1.84 (colored) to selected 1.247 (colored)

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.84 / (download) - annotate - [select for diffs], Sat Aug 1 09:55:00 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.83: +4 -4 lines
Diff to previous 1.83 (colored) to selected 1.247 (colored)

make(1): avoid calls to free(3) in the common case of a NULL pointer

Revision 1.83 / (download) - annotate - [select for diffs], Sat Aug 1 09:30:17 2020 UTC (3 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.82: +6 -13 lines
Diff to previous 1.82 (colored) to selected 1.247 (colored)

make(1): make CondDoDefined simpler

Revision 1.82 / (download) - annotate - [select for diffs], Sun Jul 26 20:21:31 2020 UTC (3 years, 8 months ago) by rillig
Branch: MAIN
Changes since 1.81: +15 -15 lines
Diff to previous 1.81 (colored) to selected 1.247 (colored)

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.81 / (download) - annotate - [select for diffs], Sun Jul 19 12:35:30 2020 UTC (3 years, 8 months ago) by rillig
Branch: MAIN
Changes since 1.80: +5 -8 lines
Diff to previous 1.80 (colored) to selected 1.247 (colored)

make(1): clean up unnecessary snprintf and multi-line function calls

Revision 1.80 / (download) - annotate - [select for diffs], Sun Jul 19 12:26:17 2020 UTC (3 years, 8 months ago) by rillig
Branch: MAIN
Changes since 1.79: +8 -8 lines
Diff to previous 1.79 (colored) to selected 1.247 (colored)

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.79 / (download) - annotate - [select for diffs], Thu Jul 9 22:34:08 2020 UTC (3 years, 8 months ago) by sjg
Branch: MAIN
Changes since 1.78: +8 -3 lines
Diff to previous 1.78 (colored) to selected 1.247 (colored)

compare_expression: return after fetch lhs and rhs if !doEval

Otherwise we end up throwing warings/errors for valid
conditionals due to not expanding variables fully.

Add tests to catch this.

Reviewed by: rillig

Revision 1.78 / (download) - annotate - [select for diffs], Fri Jul 3 08:13:23 2020 UTC (3 years, 8 months ago) by rillig
Branch: MAIN
Changes since 1.77: +8 -8 lines
Diff to previous 1.77 (colored) to selected 1.247 (colored)

make(1): remove trailing whitespace

Revision 1.77 / (download) - annotate - [select for diffs], Fri Jul 3 08:02:55 2020 UTC (3 years, 8 months ago) by rillig
Branch: MAIN
Changes since 1.76: +14 -14 lines
Diff to previous 1.76 (colored) to selected 1.247 (colored)

make(1): remove redundant parentheses around return values

Revision 1.76 / (download) - annotate - [select for diffs], Sun Jun 28 11:06:26 2020 UTC (3 years, 9 months ago) by rillig
Branch: MAIN
Changes since 1.75: +13 -15 lines
Diff to previous 1.75 (colored) to selected 1.247 (colored)

make(1): fix evaluation of unreachable conditions

Since 2015-10-11, make had evaluated unreachable conditions even though
the manual page said it didn't.

Revision 1.74.2.1 / (download) - annotate - [select for diffs], Wed Apr 26 02:53:35 2017 UTC (6 years, 11 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.74: +6 -4 lines
Diff to previous 1.74 (colored) next main 1.75 (colored) to selected 1.247 (colored)

Sync with HEAD

Revision 1.74.4.1 / (download) - annotate - [select for diffs], Fri Apr 21 16:54:14 2017 UTC (6 years, 11 months ago) by bouyer
Branch: bouyer-socketcan
Changes since 1.74: +6 -4 lines
Diff to previous 1.74 (colored) next main 1.75 (colored) to selected 1.247 (colored)

Sync with HEAD

Revision 1.75 / (download) - annotate - [select for diffs], Sun Apr 16 20:59:04 2017 UTC (6 years, 11 months ago) by riastradh
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, phil-wifi-base, phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, phil-wifi-20191119, phil-wifi-20190609, phil-wifi, pgoyette-localcount-20170426, pgoyette-compat-merge-20190127, pgoyette-compat-base, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315, pgoyette-compat, perseant-stdc-iso10646-base, perseant-stdc-iso10646, netbsd-9-base, 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, netbsd-8-base, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, netbsd-8, matt-nb8-mediatek-base, matt-nb8-mediatek, is-mlppp-base, is-mlppp, bouyer-socketcan-base1
Changes since 1.74: +6 -4 lines
Diff to previous 1.74 (colored) to selected 1.247 (colored)

Replace dead conditional by assert.

CID 975995

Revision 1.74 / (download) - annotate - [select for diffs], Thu Feb 18 18:29:14 2016 UTC (8 years, 1 month ago) by christos
Branch: MAIN
CVS Tags: pgoyette-localcount-base, pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, localcount-20160914, bouyer-socketcan-base
Branch point for: pgoyette-localcount, bouyer-socketcan
Changes since 1.73: +9 -7 lines
Diff to previous 1.73 (colored) to selected 1.247 (colored)

Collapse the 3 boolean parameter to 1 flags parameter. No functional change.

Revision 1.73 / (download) - annotate - [select for diffs], Sun Jan 17 17:45:21 2016 UTC (8 years, 2 months ago) by christos
Branch: MAIN
Changes since 1.72: +11 -17 lines
Diff to previous 1.72 (colored) to selected 1.247 (colored)

remove free NULL checks (Tilman Sauerbeck)

Revision 1.72 / (download) - annotate - [select for diffs], Sat Jan 9 00:55:17 2016 UTC (8 years, 2 months ago) by christos
Branch: MAIN
Changes since 1.71: +6 -6 lines
Diff to previous 1.71 (colored) to selected 1.247 (colored)

Preserve $$ in := assignments..

FOO=\$$CRAP
BAR:=${FOO}

all:
	echo ${FOO}
	echo ${BAR}

Revision 1.71 / (download) - annotate - [select for diffs], Wed Dec 2 00:28:24 2015 UTC (8 years, 3 months ago) by sjg
Branch: MAIN
Changes since 1.70: +6 -6 lines
Diff to previous 1.70 (colored) to selected 1.247 (colored)

Fix evaluation of defined(FOO) and ${FOO} > 0
add a unit-test to catch it.

Revision 1.70 / (download) - annotate - [select for diffs], Mon Nov 30 23:15:43 2015 UTC (8 years, 3 months ago) by sjg
Branch: MAIN
Changes since 1.69: +7 -3 lines
Diff to previous 1.69 (colored) to selected 1.247 (colored)

Avoid accessing beyond end of empty string.

Detected by Address Sanitizer - dim at FreeBSD.org

Revision 1.69 / (download) - annotate - [select for diffs], Sun Oct 11 04:51:24 2015 UTC (8 years, 5 months ago) by sjg
Branch: MAIN
Changes since 1.68: +6 -6 lines
Diff to previous 1.68 (colored) to selected 1.247 (colored)

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.68 / (download) - annotate - [select for diffs], Tue May 5 21:51:09 2015 UTC (8 years, 10 months ago) by sjg
Branch: MAIN
Changes since 1.67: +29 -8 lines
Diff to previous 1.67 (colored) to selected 1.247 (colored)

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.62.4.3 / (download) - annotate - [select for diffs], Wed Jan 16 05:34:06 2013 UTC (11 years, 2 months ago) by yamt
Branch: yamt-pagecache
CVS Tags: yamt-pagecache-tag8
Changes since 1.62.4.2: +20 -17 lines
Diff to previous 1.62.4.2 (colored) to branchpoint 1.62 (colored) next main 1.63 (colored) to selected 1.247 (colored)

sync with (a bit old) head

Revision 1.64.2.1 / (download) - annotate - [select for diffs], Tue Nov 20 03:02:57 2012 UTC (11 years, 4 months ago) by tls
Branch: tls-maxphys
Changes since 1.64: +20 -17 lines
Diff to previous 1.64 (colored) next main 1.65 (colored) to selected 1.247 (colored)

Resync to 2012-11-19 00:00:00 UTC

Revision 1.67 / (download) - annotate - [select for diffs], Sat Nov 3 13:59:27 2012 UTC (11 years, 4 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pagecache-base9, yamt-pagecache-base8, yamt-pagecache-base7, tls-maxphys-base, tls-earlyentropy-base, tls-earlyentropy, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, 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, dholland-make-base, agc-symver-base, agc-symver
Changes since 1.66: +8 -8 lines
Diff to previous 1.66 (colored) to selected 1.247 (colored)

off-by-one

Revision 1.66 / (download) - annotate - [select for diffs], Sat Nov 3 04:51:17 2012 UTC (11 years, 4 months ago) by pgoyette
Branch: MAIN
Changes since 1.65: +4 -4 lines
Diff to previous 1.65 (colored) to selected 1.247 (colored)

Fix build break due to signed/unsigned comparison

Revision 1.65 / (download) - annotate - [select for diffs], Sat Nov 3 02:25:13 2012 UTC (11 years, 4 months ago) by sjg
Branch: MAIN
Changes since 1.64: +19 -16 lines
Diff to previous 1.64 (colored) to selected 1.247 (colored)

Allow cond_state[] to grow.
The need is rare, but real.

Reviewed by: christos

Revision 1.62.4.2 / (download) - annotate - [select for diffs], Tue Oct 30 19:00:21 2012 UTC (11 years, 5 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.62.4.1: +10 -10 lines
Diff to previous 1.62.4.1 (colored) to branchpoint 1.62 (colored) to selected 1.247 (colored)

sync with head

Revision 1.64 / (download) - annotate - [select for diffs], Tue Jun 12 19:21:50 2012 UTC (11 years, 9 months ago) by joerg
Branch: MAIN
CVS Tags: yamt-pagecache-base6
Branch point for: tls-maxphys
Changes since 1.63: +10 -10 lines
Diff to previous 1.63 (colored) to selected 1.247 (colored)

Replace __dead, __unused and the various printf format attributes
with versions prefixed by MAKE_ATTR_* to avoid modifying the
implementation namespace. Make sure they are available in all places
using nonints.h to fix bootstrap on Linux.

Revision 1.62.4.1 / (download) - annotate - [select for diffs], Wed May 23 10:08:25 2012 UTC (11 years, 10 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.62: +4 -4 lines
Diff to previous 1.62 (colored) to selected 1.247 (colored)

sync with head.

Revision 1.63 / (download) - annotate - [select for diffs], Mon May 21 06:30:02 2012 UTC (11 years, 10 months ago) by sjg
Branch: MAIN
CVS Tags: yamt-pagecache-base5
Changes since 1.62: +4 -4 lines
Diff to previous 1.62 (colored) to selected 1.247 (colored)

In meta mode, level 0 can legitimately see > 64 nested .if's

Revision 1.62 / (download) - annotate - [select for diffs], Tue Mar 29 17:19:22 2011 UTC (13 years ago) by sjg
Branch: MAIN
CVS Tags: yamt-pagecache-base4, yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, netbsd-6, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, cherry-xenmp-base, cherry-xenmp
Branch point for: yamt-pagecache
Changes since 1.61: +7 -7 lines
Diff to previous 1.61 (colored) to selected 1.247 (colored)

CondDoExists: Avoid use after free()

Revision 1.60.2.1 / (download) - annotate - [select for diffs], Thu Feb 17 12:00:56 2011 UTC (13 years, 1 month ago) by bouyer
Branch: bouyer-quota2
Changes since 1.60: +10 -10 lines
Diff to previous 1.60 (colored) next main 1.61 (colored) to selected 1.247 (colored)

Sync with HEAD

Revision 1.61 / (download) - annotate - [select for diffs], Sun Feb 13 21:24:42 2011 UTC (13 years, 1 month ago) by sjg
Branch: MAIN
CVS Tags: bouyer-quota2-nbase, bouyer-quota2-base
Changes since 1.60: +10 -10 lines
Diff to previous 1.60 (colored) to selected 1.247 (colored)

Mark unused args.

Revision 1.60 / (download) - annotate - [select for diffs], Fri Nov 6 19:44:06 2009 UTC (14 years, 4 months ago) by dsl
Branch: MAIN
CVS Tags: matt-premerge-20091211, matt-mips64-premerge-20101231
Branch point for: bouyer-quota2
Changes since 1.59: +28 -24 lines
Diff to previous 1.59 (colored) to selected 1.247 (colored)

Change enum values so that TOK_FALSE is 0 and TOK_TRUE is 1.
Use this fact to remove loads of ? : clauses.

Revision 1.59 / (download) - annotate - [select for diffs], Fri Jan 30 23:07:17 2009 UTC (15 years, 2 months ago) by dsl
Branch: MAIN
CVS Tags: jym-xensuspend-nbase, jym-xensuspend-base, jym-xensuspend
Changes since 1.58: +69 -68 lines
Diff to previous 1.58 (colored) to selected 1.247 (colored)

Rename all the members of 'enum Token' to TOK_FOO.
Makes it rather more obvious wherethey belong - especially since
two of them were 'True' and 'False' (and not 1 and 0 either).

Revision 1.58 / (download) - annotate - [select for diffs], Fri Jan 30 22:35:10 2009 UTC (15 years, 2 months ago) by dsl
Branch: MAIN
Changes since 1.57: +48 -36 lines
Diff to previous 1.57 (colored) to selected 1.247 (colored)

Treat .ifdef ${foo} as .if defined(${foo}) not .if "${foo}" != "".
(and similarly for the other .ifxxx).
Do comparison against "" or 0 for .if "foo" and .if <numeric> directly
instead of faking up the operator string.
Rename error: to done: and use it for more exit paths.
Elucidate and correct some comments.

Fixes problems with makefiles that do:
.for var in var_1 var_2
.ifdef ${var}
...
which used to check whether var_1 was defined - because the .ifdef saw the
literal var_1, not a variable expansion due to the way .for loop variables
were substituted.

Revision 1.57 / (download) - annotate - [select for diffs], Thu Jan 29 07:48:39 2009 UTC (15 years, 2 months ago) by enami
Branch: MAIN
Changes since 1.56: +4 -4 lines
Diff to previous 1.56 (colored) to selected 1.247 (colored)

Avoid infinite loop.

Revision 1.56 / (download) - annotate - [select for diffs], Wed Jan 28 21:38:12 2009 UTC (15 years, 2 months ago) by dsl
Branch: MAIN
Changes since 1.55: +67 -46 lines
Diff to previous 1.55 (colored) to selected 1.247 (colored)

Allow for () in the argument to .ifdef et al.
Save/restore current values of global data across expression evaluation
to give ${foo:? ...} a change of working inside another .if.

Revision 1.55 / (download) - annotate - [select for diffs], Fri Jan 23 21:58:27 2009 UTC (15 years, 2 months ago) by dsl
Branch: MAIN
Changes since 1.54: +19 -19 lines
Diff to previous 1.54 (colored) to selected 1.247 (colored)

Sprinkle some const.
In particular for Lst_Find() and Lst_FindFrom().
Remove some unneeded casts and some now-undeeded UNCONST().

Revision 1.54 / (download) - annotate - [select for diffs], Fri Jan 23 21:26:30 2009 UTC (15 years, 2 months ago) by dsl
Branch: MAIN
Changes since 1.53: +6 -6 lines
Diff to previous 1.53 (colored) to selected 1.247 (colored)

Change 'ClientData' to 'void *' so that relevant parameters can
be made 'const void *'.

Revision 1.53 / (download) - annotate - [select for diffs], Fri Jan 23 20:22:50 2009 UTC (15 years, 2 months ago) by dsl
Branch: MAIN
Changes since 1.52: +6 -40 lines
Diff to previous 1.52 (colored) to selected 1.247 (colored)

There is no point in saving the last character of a NUL-terminated
string in order to overwrite with a NUL, then restore the original value!
Remove and simplify the CondDoFoo() functions.

Revision 1.52 / (download) - annotate - [select for diffs], Sun Jan 18 17:30:19 2009 UTC (15 years, 2 months ago) by dsl
Branch: MAIN
Changes since 1.51: +7 -12 lines
Diff to previous 1.51 (colored) to selected 1.247 (colored)

Revert previous - cause grief with .ifdef (foo)
Instead return False for exists(), defined(), make() etc when the
argument has length zero.

Revision 1.51 / (download) - annotate - [select for diffs], Sun Jan 18 12:50:15 2009 UTC (15 years, 2 months ago) by dsl
Branch: MAIN
Changes since 1.50: +16 -17 lines
Diff to previous 1.50 (colored) to selected 1.247 (colored)

Only terminate a conditional function argument on ')' if we expect the
argument to be exclosed in (...).
'.if exists()' is parsed as '.ifdef exists()' and the ')' must not be
left over at the end.
I have no idea why any of my recent changes have affected this.
But pkgsrc/mk/compiler/gcc.mk (line 488) does .if exists(${FCPATH})
even though FCPATH is only set when the file exists.

Revision 1.50 / (download) - annotate - [select for diffs], Sat Jan 17 13:29:37 2009 UTC (15 years, 2 months ago) by dsl
Branch: MAIN
Changes since 1.49: +19 -19 lines
Diff to previous 1.49 (colored) to selected 1.247 (colored)

Change 'Buffer' so that it is the actual struct, not a pointer to it.
Saves having to malloc/free a fixed size structure.
Buf_Init() now takes ptr to Buffer to initialiase.
Change Buf_Destroy() to return ptr to string when not freed.
Remove large number of casts to (Byte) and (Byte *) - 'Byte' is 'char' here.
Buf_AddByte[s] guarantees that the data is 0 termininated, so never add '\0'.
Keep 'count' not 'left' and 'inPtr', code is simplier with only one update.
Fix fallou, no functional change.

Revision 1.49 / (download) - annotate - [select for diffs], Sat Dec 13 15:19:29 2008 UTC (15 years, 3 months ago) by dsl
Branch: MAIN
Changes since 1.48: +6 -6 lines
Diff to previous 1.48 (colored) to selected 1.247 (colored)

Use NULL instead of -1 cast to the relavant type (usually via NIL).
This was a suggestion from christos - so blame him if there is a deep
reason for using -1 :-)

Revision 1.48 / (download) - annotate - [select for diffs], Sat Nov 29 14:42:21 2008 UTC (15 years, 4 months ago) by dsl
Branch: MAIN
Changes since 1.47: +22 -5 lines
Diff to previous 1.47 (colored) to selected 1.247 (colored)

Before deciding to use the default function in a .if, check whether the
token that follows the argument might be '==' or '!='.
If so then treat as a string comparison instead.
Fixes bin/15233 and bin/30967 provided some whitespace is present.
".if A==A" remains a check for defined(A==A) since make places no
restrictions on the names of variables!

Revision 1.47 / (download) - annotate - [select for diffs], Sat Nov 29 14:12:48 2008 UTC (15 years, 4 months ago) by dsl
Branch: MAIN
Changes since 1.46: +142 -190 lines
Diff to previous 1.46 (colored) to selected 1.247 (colored)

Common up parsing .if defined() make() exists() target() commands() and empty()
Add a check for the '(' following the function name, if absent then treat
as if the function name is unknown - usually leading to a syntax error.
No other functional changes intended.

Revision 1.46 / (download) - annotate - [select for diffs], Sun Nov 23 10:52:58 2008 UTC (15 years, 4 months ago) by dsl
Branch: MAIN
Changes since 1.45: +30 -40 lines
Diff to previous 1.45 (colored) to selected 1.247 (colored)

Do a string compare if the rh argument doesn't completely convert to a number
(instead of silently ignoring the chars that failed to convert).
Use strtoul() instead of homebrew copy.
Only use strtod() if strtoul() fails because the value is too large or
contains '.', 'e' or 'E'.
Do a compare for strings that start '-' or '+' as well as digits.

Revision 1.45 / (download) - annotate - [select for diffs], Sat Nov 22 23:42:16 2008 UTC (15 years, 4 months ago) by dsl
Branch: MAIN
Changes since 1.44: +4 -4 lines
Diff to previous 1.44 (colored) to selected 1.247 (colored)

Fix conversion of hex numerics in comparisons.
Broken by a fix from christos 14 years ago.

Revision 1.44 / (download) - annotate - [select for diffs], Sat Nov 22 18:47:47 2008 UTC (15 years, 4 months ago) by dsl
Branch: MAIN
Changes since 1.43: +323 -311 lines
Diff to previous 1.43 (colored) to selected 1.247 (colored)

Move two great chunks of code out of a switch statement and into
separate functions.
No functional change.

Revision 1.43 / (download) - annotate - [select for diffs], Sat Nov 22 18:05:13 2008 UTC (15 years, 4 months ago) by dsl
Branch: MAIN
Changes since 1.42: +25 -11 lines
Diff to previous 1.42 (colored) to selected 1.247 (colored)

If there is a syntax error in a .if expression then ignore the entire
conditional block (ie down to the matching .endif) instead of passing
the input line back to the normal parsing code.
Do the same if the maximum .if nesting (64 levels) is breached.

Revision 1.42 / (download) - annotate - [select for diffs], Wed Oct 29 15:37:08 2008 UTC (15 years, 5 months ago) by sjg
Branch: MAIN
CVS Tags: netbsd-5-base, netbsd-5-2-RELEASE, netbsd-5-2-RC1, netbsd-5-2-3-RELEASE, netbsd-5-2-2-RELEASE, netbsd-5-2-1-RELEASE, netbsd-5-2, netbsd-5-1-RELEASE, netbsd-5-1-RC4, netbsd-5-1-RC3, netbsd-5-1-RC2, netbsd-5-1-RC1, netbsd-5-1-5-RELEASE, netbsd-5-1-4-RELEASE, netbsd-5-1-3-RELEASE, netbsd-5-1-2-RELEASE, netbsd-5-1-1-RELEASE, netbsd-5-1, netbsd-5-0-RELEASE, netbsd-5-0-RC4, netbsd-5-0-RC3, netbsd-5-0-RC2, netbsd-5-0-RC1, netbsd-5-0-2-RELEASE, netbsd-5-0-1-RELEASE, netbsd-5-0, netbsd-5, matt-nb5-pq3-base, matt-nb5-pq3, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-premerge-20091211, matt-nb5-mips64-k15, matt-nb5-mips64, matt-nb4-mips64-k7-u2a-k9b
Changes since 1.41: +12 -3 lines
Diff to previous 1.41 (colored) to selected 1.247 (colored)

If Parse_Error is called after curFile is invalid, set it to a dummy
to avoid seg-fault.  Also the NULL filename will cause ParseVErrorInternal
to skip trying to report file and line number info.

If CondToken is called outside the context of a .if etc, variables in
the expression being parsed will already be expanded, so allow for
an unqouted number to jump us back into the compare logic.
This allows ${${SomeNumber:U42} > 0:?True:False} to work anywhere.

Job_Finish should process postCommands if it has commands or children.

Revision 1.37.4.1 / (download) - annotate - [select for diffs], Sun Mar 23 00:49:02 2008 UTC (16 years ago) by matt
Branch: matt-armv6
Changes since 1.37: +16 -8 lines
Diff to previous 1.37 (colored) next main 1.38 (colored) to selected 1.247 (colored)

sync with HEAD

Revision 1.41 / (download) - annotate - [select for diffs], Fri Feb 15 21:29:50 2008 UTC (16 years, 1 month ago) by christos
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base4, yamt-pf42-base3, yamt-pf42-base2, yamt-pf42-base, yamt-pf42, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, wrstuden-revivesa-base-1, wrstuden-revivesa-base, wrstuden-revivesa, mjf-devfs2-base, mjf-devfs2, matt-mips64-base2, matt-armv6-nbase, keiichi-mipv6-nbase, keiichi-mipv6-base, keiichi-mipv6, hpcarm-cleanup-nbase, hpcarm-cleanup-base
Changes since 1.40: +5 -6 lines
Diff to previous 1.40 (colored) to selected 1.247 (colored)

back all changes out until I fix it properly.

Revision 1.40 / (download) - annotate - [select for diffs], Thu Feb 14 22:11:20 2008 UTC (16 years, 1 month ago) by christos
Branch: MAIN
CVS Tags: christos-broken
Changes since 1.39: +9 -8 lines
Diff to previous 1.39 (colored) to selected 1.247 (colored)

- use pid_t/size_t as appropriate instead of int.
- use %ld to print pids.
- fix a bit of lint.
- WARNS=4

Revision 1.39 / (download) - annotate - [select for diffs], Thu Feb 7 00:49:38 2008 UTC (16 years, 1 month ago) by joerg
Branch: MAIN
Changes since 1.38: +10 -5 lines
Diff to previous 1.38 (colored) to selected 1.247 (colored)

Print the complain about random stuff after empty only once.

Revision 1.38 / (download) - annotate - [select for diffs], Wed Feb 6 18:26:37 2008 UTC (16 years, 1 month ago) by joerg
Branch: MAIN
Changes since 1.37: +10 -7 lines
Diff to previous 1.37 (colored) to selected 1.247 (colored)

Warn for constructs like
.if empty xxx(foo)
which are interpreted as
.if empty(foo)
or
.if empty (foo)

This is based on rillig's commit to pkgsrc/devel/bmake, but doesn't warn
for the third case. Discussed with sjg.

Revision 1.35.2.1.2.1 / (download) - annotate - [select for diffs], Mon Sep 3 07:05:28 2007 UTC (16 years, 6 months ago) by wrstuden
Branch: wrstuden-fixsa
Changes since 1.35.2.1: +26 -12 lines
Diff to previous 1.35.2.1 (colored) next main 1.35.2.2 (colored) to selected 1.247 (colored)

Sync w/ NetBSD-4-RC_1

Revision 1.35.2.2 / (download) - annotate - [select for diffs], Tue Jun 5 20:53:28 2007 UTC (16 years, 9 months ago) by bouyer
Branch: netbsd-4
CVS Tags: wrstuden-fixsa-newbase, wrstuden-fixsa-base-1, wrstuden-fixsa-base, netbsd-4-0-RELEASE, netbsd-4-0-RC5, netbsd-4-0-RC4, netbsd-4-0-RC3, netbsd-4-0-RC2, netbsd-4-0-RC1, netbsd-4-0-1-RELEASE, netbsd-4-0
Changes since 1.35.2.1: +26 -12 lines
Diff to previous 1.35.2.1 (colored) to branchpoint 1.35 (colored) next main 1.36 (colored) to selected 1.247 (colored)

Apply patch (requested by tron in ticket #696):
	usr.bin/make/compat.c		patch
	usr.bin/make/cond.c		patch
	usr.bin/make/dir.c		patch
	usr.bin/make/for.c		patch
	usr.bin/make/main.c		patch
	usr.bin/make/make.1		patch
	usr.bin/make/make.c		patch
	usr.bin/make/make.h		patch
	usr.bin/make/nonints.h		patch
	usr.bin/make/parse.c		patch
	usr.bin/make/str.c		patch
	usr.bin/make/targ.c		patch
	usr.bin/make/util.c		patch
	usr.bin/make/var.c		patch

Synchronize make(1) with HEAD branch to increase perfomance and
improve stability.

Revision 1.37 / (download) - annotate - [select for diffs], Sun Feb 4 19:23:49 2007 UTC (17 years, 1 month ago) by dsl
Branch: MAIN
CVS Tags: matt-mips64-base, matt-mips64, matt-armv6-prevmlocking, matt-armv6-base, hpcarm-cleanup, cube-autoconf-base, cube-autoconf
Branch point for: matt-armv6
Changes since 1.36: +26 -12 lines
Diff to previous 1.36 (colored) to selected 1.247 (colored)

Add code to ensure that .if/.endif are correctly nested with .for/.endfor
and also include files don't have mismatched .if/.endif
It has been suggested that make used to have this test, but I can't
remember removing any code that might have performed it.

Revision 1.35.2.1 / (download) - annotate - [select for diffs], Wed Dec 20 22:42:11 2006 UTC (17 years, 3 months ago) by bouyer
Branch: netbsd-4
Branch point for: wrstuden-fixsa
Changes since 1.35: +126 -142 lines
Diff to previous 1.35 (colored) to selected 1.247 (colored)

Pull up following revision(s) (requested by dsl in ticket #285):
	usr.bin/make/cond.c: revision 1.36
	usr.bin/make/parse.c: revision 1.121-1.124
	usr.bin/make/make.h: revision 1.65
	usr.bin/make/targ.c: revision 1.46
	usr.bin/make/main.c: revision 1.138-1.139
Simplify the code that processes .if lines.
It doesn't need a two-dimensional array to remember the states of .if lines.
It would be even simpler if we didn't try to detect .else and .elif lines
that follow .else lines.
Unfortunately this isn't the code that is stupendously slow...
Unknot this code slightly by avoiding 'break/return; else' and by putting
the short parts of some conditionals first.
First step towards speeding up the parsing of makefiles (esp. the unwanted
parts of .if clauses).
There should be no changes to the logic.
There really is no point calling estrdup() to get a copy of the makefile name
into every 'gnode' (aka target), instead just copy a pointer to the string
and avoid freeing the original name when we close the file.
I can't imagine any makefile set where this gives a larger footprint!
Add anewline to the end of the error message output when the debug log
file cannot be opened.
Put the big block of code that was common to ParseDoInclude() and
ParseTraditionalInclude() into a separate routine.
Fix the 'use after free' and 'free on item not malloced' that got added
to ParseTraditionalInclude() in Feb 2006 (rev 1.111).
Kill the 'PTR' struct and put both its members into IFile.
Remove the parameter from ParseEOF(), 1 of the 3 calls passed the wrong value!
Fortunately another test stopped anything nasty happening, we'll use that
test instead.
Revert part of a recent commit.
ParseEOF() shouldn't close the original file.
Some minor changes:
- Only test 'printVars' once.
  Has side effect of not trying to find the 'main' target for '-V varname'.
- Only reap the single child process in Cmd_Exec(),
  I think this is for 'xx != cmd' so probobably no other children should exist.
- Don't read and parse .depend if '-r' and '-V varname' are set.
  I suspect that .depend shouldn't affect the output of any -V command...

Revision 1.36 / (download) - annotate - [select for diffs], Sat Dec 2 15:50:45 2006 UTC (17 years, 3 months ago) by dsl
Branch: MAIN
Changes since 1.35: +126 -142 lines
Diff to previous 1.35 (colored) to selected 1.247 (colored)

Simplify the code that processes .if lines.
It doesn't need a two-dimensional array to remember the states of .if lines.
It would be even simpler if we didn't try to detect .else and .elif lines
that follow .else lines.
Unfortunately this isn't the code that is stupendously slow...

Revision 1.35 / (download) - annotate - [select for diffs], Fri Oct 27 21:00:18 2006 UTC (17 years, 5 months ago) by dsl
Branch: MAIN
CVS Tags: netbsd-4-base
Branch point for: netbsd-4
Changes since 1.34: +4 -4 lines
Diff to previous 1.34 (colored) to selected 1.247 (colored)

Since 'ClientData' is 'void *', nuke almost all the (ClientData) casts.

Revision 1.34 / (download) - annotate - [select for diffs], Sun Oct 15 08:38:21 2006 UTC (17 years, 5 months ago) by dsl
Branch: MAIN
Changes since 1.33: +6 -6 lines
Diff to previous 1.33 (colored) to selected 1.247 (colored)

Output all debug trace output through 'debug_file' defaulting to 'stdout'.
(Almost all the debug output went there, but some went to stderr.)
Split the parsing of -d (debug flags) out into its own routine.
Allow the output filename to be changed by specifying -dF<file> to create
a log file, or -dF+<file> to append to it. <file> may be stdout or stderr.
Also change so that -d-<flags> acts on <flags> locally but doesn't copy
them to MAKEFLAGS so they aren't inherited by child makes.
I'm not 100% happy with the command line syntax for the above, so they are
currently undocumented.

Revision 1.33 / (download) - annotate - [select for diffs], Fri Jul 28 17:07:33 2006 UTC (17 years, 8 months ago) by sjg
Branch: MAIN
CVS Tags: abandoned-netbsd-4-base, abandoned-netbsd-4
Changes since 1.32: +7 -3 lines
Diff to previous 1.32 (colored) to selected 1.247 (colored)

Add debug output for CondDoExists() - the results can be surprising.

Revision 1.32 / (download) - annotate - [select for diffs], Sat Apr 22 18:53:32 2006 UTC (17 years, 11 months ago) by christos
Branch: MAIN
CVS Tags: chap-midi-nbase, chap-midi-base, chap-midi
Changes since 1.31: +14 -15 lines
Diff to previous 1.31 (colored) to selected 1.247 (colored)

Coverity CID 526: Check for condTop < 0 where we decrement it, not later
when the damage is already done.

Revision 1.31 / (download) - annotate - [select for diffs], Sun Apr 2 00:15:53 2006 UTC (18 years ago) by christos
Branch: MAIN
Changes since 1.30: +6 -7 lines
Diff to previous 1.30 (colored) to selected 1.247 (colored)

Remove bogus debugging code I accidentally committed.

Revision 1.30 / (download) - annotate - [select for diffs], Fri Mar 31 21:58:08 2006 UTC (18 years ago) by christos
Branch: MAIN
Changes since 1.29: +46 -31 lines
Diff to previous 1.29 (colored) to selected 1.247 (colored)

Add some coverity allocation comments, and change the way the allocator
functions work. When they allocate storage that needs to be freed, instead
of setting a boolean, set the pointer to be freed. Plug some more memory
leaks found by inspection.

Revision 1.29 / (download) - annotate - [select for diffs], Mon Aug 8 16:42:54 2005 UTC (18 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.28: +9 -9 lines
Diff to previous 1.28 (colored) to selected 1.247 (colored)

From Max Okumoto:
- Remove casts to NULL.
- Remove space between cast and object.

Revision 1.28 / (download) - annotate - [select for diffs], Mon Jul 25 22:55:58 2005 UTC (18 years, 8 months ago) by christos
Branch: MAIN
Changes since 1.27: +5 -5 lines
Diff to previous 1.27 (colored) to selected 1.247 (colored)

Whitespace KNF cleanup from Max Okumoto

Revision 1.27 / (download) - annotate - [select for diffs], Thu Jun 2 02:03:19 2005 UTC (18 years, 10 months ago) by lukem
Branch: MAIN
Changes since 1.26: +4 -3 lines
Diff to previous 1.26 (colored) to selected 1.247 (colored)

appease gcc -Wuninitialized

Revision 1.26 / (download) - annotate - [select for diffs], Tue Mar 1 04:34:55 2005 UTC (19 years, 1 month ago) by christos
Branch: MAIN
CVS Tags: netbsd-3-base, netbsd-3-1-RELEASE, netbsd-3-1-RC4, netbsd-3-1-RC3, netbsd-3-1-RC2, netbsd-3-1-RC1, netbsd-3-1-1-RELEASE, netbsd-3-1, netbsd-3-0-RELEASE, netbsd-3-0-RC6, netbsd-3-0-RC5, netbsd-3-0-RC4, netbsd-3-0-RC3, netbsd-3-0-RC2, netbsd-3-0-RC1, netbsd-3-0-3-RELEASE, netbsd-3-0-2-RELEASE, netbsd-3-0-1-RELEASE, netbsd-3-0, netbsd-3
Changes since 1.25: +18 -12 lines
Diff to previous 1.25 (colored) to selected 1.247 (colored)

When parsing conditional tokens, make sure that the token is followed by
a non-alpha character, so that .elsefoo is not parsed as .else leading
to confusion later.

Revision 1.25 / (download) - annotate - [select for diffs], Wed Feb 16 15:11:52 2005 UTC (19 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.24: +17 -17 lines
Diff to previous 1.24 (colored) to selected 1.247 (colored)

PR/29203, PR/29204: Max Okumoto: KNF changes to make [no functional changes]

Revision 1.19.2.5 / (download) - annotate - [select for diffs], Mon May 10 15:44:10 2004 UTC (19 years, 10 months ago) by tron
Branch: netbsd-2-0
CVS Tags: netbsd-2-base, netbsd-2-1-RELEASE, netbsd-2-1-RC6, netbsd-2-1-RC5, netbsd-2-1-RC4, netbsd-2-1-RC3, netbsd-2-1-RC2, netbsd-2-1-RC1, netbsd-2-1, netbsd-2-0-RELEASE, netbsd-2-0-RC5, netbsd-2-0-RC4, netbsd-2-0-RC3, netbsd-2-0-RC2, netbsd-2-0-RC1, netbsd-2-0-3-RELEASE, netbsd-2-0-2-RELEASE, netbsd-2-0-1-RELEASE, netbsd-2
Changes since 1.19.2.4: +4 -4 lines
Diff to previous 1.19.2.4 (colored) to branchpoint 1.19 (colored) next main 1.20 (colored) to selected 1.247 (colored)

Pull up revision 1.24 (requested by sjg in ticket #282):
Simplify build, no functional changes.
Instead of adding MAKE_BOOTSTRAP for hosted environments, i.e., when
you want things simple, instead add MAKE_NATIVE to get those hugely
important features like __RCSID().
It's now possible to build make on some hosts with: cc *.c */*.c

Revision 1.19.2.4 / (download) - annotate - [select for diffs], Mon May 10 15:32:16 2004 UTC (19 years, 10 months ago) by tron
Branch: netbsd-2-0
Changes since 1.19.2.3: +144 -136 lines
Diff to previous 1.19.2.3 (colored) to branchpoint 1.19 (colored) to selected 1.247 (colored)

Pull up revision 1.23 (requested by sjg in ticket #282):
Allow "string" and "${varspec}" on lhs of conditionals.
This makes it possible to use expressions like
${("${LIST:Msomething"}):?present:absent}
it also makes treatment of lhs and rhs more consistent, and
makes CondToken easier to read.
Update unit-test/cond1 to test new features.

Revision 1.19.2.3 / (download) - annotate - [select for diffs], Mon May 10 15:27:41 2004 UTC (19 years, 10 months ago) by tron
Branch: netbsd-2-0
Changes since 1.19.2.2: +17 -4 lines
Diff to previous 1.19.2.2 (colored) to branchpoint 1.19 (colored) to selected 1.247 (colored)

Pull up revision 1.22 (requested by sjg in ticket #282):
Revised patch for catching extraneous .else's
We actually need to tack condTop and skipIfLevel.
Bump MAXIF while here.
Enhance the unit-test for conditionals to exercise more code.
PR: 24420

Revision 1.19.2.2 / (download) - annotate - [select for diffs], Mon May 10 15:25:15 2004 UTC (19 years, 10 months ago) by tron
Branch: netbsd-2-0
Changes since 1.19.2.1: +3 -11 lines
Diff to previous 1.19.2.1 (colored) to branchpoint 1.19 (colored) to selected 1.247 (colored)

Pull up revision 1.21 (requested by sjg in ticket #282):
Back out previous patch for now.
Breaks bsd.obj.mk

Revision 1.19.2.1 / (download) - annotate - [select for diffs], Mon May 10 15:23:41 2004 UTC (19 years, 10 months ago) by tron
Branch: netbsd-2-0
Changes since 1.19: +11 -3 lines
Diff to previous 1.19 (colored) to selected 1.247 (colored)

Pull up revision 1.20 (requested by sjg in ticket #282):
Add check for extraneous .else's - based on patch from Arne H. Juul
in PR/24420.
Add a unit-test for conditionals.
Also in the unit-test makefile strip any .CURDIR in output.
PR: 24420

Revision 1.24 / (download) - annotate - [select for diffs], Fri May 7 00:04:38 2004 UTC (19 years, 10 months ago) by ross
Branch: MAIN
Changes since 1.23: +4 -4 lines
Diff to previous 1.23 (colored) to selected 1.247 (colored)

Simplify build, no functional changes.

Instead of adding MAKE_BOOTSTRAP for hosted environments, i.e., when
you want things simple, instead add MAKE_NATIVE to get those hugely
important features like __RCSID().

It's now possible to build make on some hosts with: cc *.c */*.c

Revision 1.23 / (download) - annotate - [select for diffs], Tue Apr 13 16:06:23 2004 UTC (19 years, 11 months ago) by sjg
Branch: MAIN
Changes since 1.22: +144 -136 lines
Diff to previous 1.22 (colored) to selected 1.247 (colored)

Allow "string" and "${varspec}" on lhs of conditionals.
This makes it possible to use expressions like
${("${LIST:Msomething"}):?present:absent}
it also makes treatment of lhs and rhs more consistent, and
makes CondToken easier to read.

Update unit-test/cond1 to test new features.

Revision 1.22 / (download) - annotate - [select for diffs], Thu Apr 8 07:24:26 2004 UTC (19 years, 11 months ago) by sjg
Branch: MAIN
Changes since 1.21: +17 -4 lines
Diff to previous 1.21 (colored) to selected 1.247 (colored)

Revised patch for catching extraneous .else's
We actually need to tack condTop and skipIfLevel.
Bump MAXIF while here.
Enhance the unit-test for conditionals to exercise more code.

PR: 24420

Revision 1.21 / (download) - annotate - [select for diffs], Thu Apr 8 01:35:33 2004 UTC (19 years, 11 months ago) by sjg
Branch: MAIN
Changes since 1.20: +3 -11 lines
Diff to previous 1.20 (colored) to selected 1.247 (colored)

Back out previous patch for now.
Breaks bsd.obj.mk

Revision 1.20 / (download) - annotate - [select for diffs], Thu Apr 8 00:59:01 2004 UTC (19 years, 11 months ago) by sjg
Branch: MAIN
Changes since 1.19: +11 -3 lines
Diff to previous 1.19 (colored) to selected 1.247 (colored)

Add check for extraneous .else's - based on patch from Arne H. Juul
in PR/24420.
Add a unit-test for conditionals.
Also in the unit-test makefile strip any .CURDIR in output.

PR: 24420

Revision 1.19 / (download) - annotate - [select for diffs], Tue Jan 6 01:18:52 2004 UTC (20 years, 2 months ago) by sjg
Branch: MAIN
CVS Tags: netbsd-2-0-base
Branch point for: netbsd-2-0
Changes since 1.18: +21 -18 lines
Diff to previous 1.18 (colored) to selected 1.247 (colored)

Handle more complex conditional expressions.
CondCvtArg now returns NULL if it consumed all input, or a pointer
to any left overs.

Revision 1.18 / (download) - annotate - [select for diffs], Sat Sep 6 06:52:08 2003 UTC (20 years, 6 months ago) by sjg
Branch: MAIN
Changes since 1.17: +4 -4 lines
Diff to previous 1.17 (colored) to selected 1.247 (colored)

Make empty() consider an undefined variable as empty,
rather than throw a syntax error.

Revision 1.17 / (download) - annotate - [select for diffs], Thu Aug 7 11:14:49 2003 UTC (20 years, 7 months ago) by agc
Branch: MAIN
Changes since 1.16: +34 -3 lines
Diff to previous 1.16 (colored) to selected 1.247 (colored)

Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22365, verified by myself.

Revision 1.16 / (download) - annotate - [select for diffs], Mon Jul 14 18:19:11 2003 UTC (20 years, 8 months ago) by christos
Branch: MAIN
Changes since 1.15: +8 -8 lines
Diff to previous 1.15 (colored) to selected 1.247 (colored)

Pass WARNS=3

Revision 1.15 / (download) - annotate - [select for diffs], Thu Apr 17 15:57:52 2003 UTC (20 years, 11 months ago) by sjg
Branch: MAIN
Changes since 1.14: +3 -4 lines
Diff to previous 1.14 (colored) to selected 1.247 (colored)

math.h is not needed and including it introduces uncessary dependencies
on some systems.

PR: 21204

Revision 1.14 / (download) - annotate - [select for diffs], Mon Dec 30 18:03:09 2002 UTC (21 years, 3 months ago) by sjg
Branch: MAIN
CVS Tags: fvdl_fs64_base
Changes since 1.13: +4 -3 lines
Diff to previous 1.13 (colored) to selected 1.247 (colored)

Treat an unquoted '#' as end of line when parsing conditionals.
This ensures that comments are ok at the end of line.

PR: 19596
Reviewed by: christos

Revision 1.13 / (download) - annotate - [select for diffs], Sat Jun 15 18:24:56 2002 UTC (21 years, 9 months ago) by wiz
Branch: MAIN
Changes since 1.12: +48 -67 lines
Diff to previous 1.12 (colored) to selected 1.247 (colored)

Remove !__STDC__ stuff, de-__P(), ANSIfy, and de-register.

Revision 1.12 / (download) - annotate - [select for diffs], Sun Jan 14 20:44:26 2001 UTC (23 years, 2 months ago) by christos
Branch: MAIN
CVS Tags: netbsd-1-6-base, netbsd-1-6-RELEASE, netbsd-1-6-RC3, netbsd-1-6-RC2, netbsd-1-6-RC1, netbsd-1-6-PATCH002-RELEASE, netbsd-1-6-PATCH002-RC4, netbsd-1-6-PATCH002-RC3, netbsd-1-6-PATCH002-RC2, netbsd-1-6-PATCH002-RC1, netbsd-1-6-PATCH002, netbsd-1-6-PATCH001-RELEASE, netbsd-1-6-PATCH001-RC3, netbsd-1-6-PATCH001-RC2, netbsd-1-6-PATCH001-RC1, netbsd-1-6-PATCH001, netbsd-1-6
Changes since 1.11: +52 -3 lines
Diff to previous 1.11 (colored) to selected 1.247 (colored)

Provide a new .if commands(<target>) primitive that returns true if the
target has commands associated with it.

Revision 1.11 / (download) - annotate - [select for diffs], Fri Sep 18 20:35:11 1998 UTC (25 years, 6 months ago) by christos
Branch: MAIN
CVS Tags: wrstuden-devbsize-base, wrstuden-devbsize-19991221, wrstuden-devbsize, netbsd-1-5-base, netbsd-1-5-RELEASE, netbsd-1-5-PATCH003, netbsd-1-5-PATCH002, netbsd-1-5-PATCH001, netbsd-1-5-BETA2, netbsd-1-5-BETA, netbsd-1-5-ALPHA2, netbsd-1-5, netbsd-1-4-base, netbsd-1-4-RELEASE, netbsd-1-4-PATCH003, netbsd-1-4-PATCH002, netbsd-1-4-PATCH001, netbsd-1-4, minoura-xpg4dl-base, minoura-xpg4dl, comdex-fall-1999-base, comdex-fall-1999
Changes since 1.10: +41 -37 lines
Diff to previous 1.10 (colored) to selected 1.247 (colored)

Fix conditional variable expression parsing (reported by cgd)

Revision 1.9.2.1 / (download) - annotate - [select for diffs], Fri May 8 06:12:06 1998 UTC (25 years, 10 months ago) by mycroft
Branch: netbsd-1-3
CVS Tags: netbsd-1-3-PATCH003-CANDIDATE2, netbsd-1-3-PATCH003-CANDIDATE1, netbsd-1-3-PATCH003-CANDIDATE0, netbsd-1-3-PATCH003, netbsd-1-3-PATCH002
Changes since 1.9: +67 -33 lines
Diff to previous 1.9 (colored) next main 1.10 (colored) to selected 1.247 (colored)

Sync with trunk, per request of christos.

Revision 1.10 / (download) - annotate - [select for diffs], Wed Apr 1 14:18:10 1998 UTC (26 years ago) by christos
Branch: MAIN
Changes since 1.9: +67 -33 lines
Diff to previous 1.9 (colored) to selected 1.247 (colored)

Add conditional variable evaluation from Alistair Crooks.

Revision 1.9 / (download) - annotate - [select for diffs], Sun Sep 28 03:31:01 1997 UTC (26 years, 6 months ago) by lukem
Branch: MAIN
CVS Tags: netbsd-1-3-base, netbsd-1-3-RELEASE, netbsd-1-3-PATCH001, netbsd-1-3-BETA
Branch point for: netbsd-1-3
Changes since 1.8: +6 -2 lines
Diff to previous 1.8 (colored) to selected 1.247 (colored)

wrap #include <sys/cdefs.h>, __RCSID(...) stuff in #ifndef MAKE_BOOTSTRAP

Revision 1.8 / (download) - annotate - [select for diffs], Tue Jul 1 21:17:14 1997 UTC (26 years, 9 months ago) by christos
Branch: MAIN
Changes since 1.7: +3 -2 lines
Diff to previous 1.7 (colored) to selected 1.247 (colored)

Add WARNS=1
RCSID police

Revision 1.6.6.1 / (download) - annotate - [select for diffs], Sun Jan 26 05:51:33 1997 UTC (27 years, 2 months ago) by rat
Branch: netbsd-1-2
CVS Tags: netbsd-1-2-PATCH001
Changes since 1.6: +27 -25 lines
Diff to previous 1.6 (colored) next main 1.7 (colored) to selected 1.247 (colored)

Update make(1) from trunk, by request from Christos Zoulas.  Fixes many bugs.

Revision 1.1.1.2 / (download) - annotate - [select for diffs] (vendor branch), Sat Dec 28 04:40:57 1996 UTC (27 years, 3 months ago) by tls
Branch: WFJ-920714, CSRG
CVS Tags: lite-2
Changes since 1.1.1.1: +125 -81 lines
Diff to previous 1.1.1.1 (colored) to selected 1.247 (colored)

Import 4.4BSD-Lite2 sources onto CSRG branch (already merged at head)

Revision 1.7 / (download) - annotate - [select for diffs], Wed Nov 6 17:59:02 1996 UTC (27 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.6: +27 -25 lines
Diff to previous 1.6 (colored) to selected 1.247 (colored)

- Merge in FreeBSD and Lite2 changes.
- Fix bug where a non-archive target with a .a suffix would always
  be considered to be out of date, since it does not have a TOC.

Revision 1.6 / (download) - annotate - [select for diffs], Wed Jun 14 15:18:58 1995 UTC (28 years, 9 months ago) by christos
Branch: MAIN
CVS Tags: netbsd-1-2-base, netbsd-1-2-RELEASE, netbsd-1-2-BETA, netbsd-1-1-base, netbsd-1-1-RELEASE, netbsd-1-1-PATCH001, netbsd-1-1
Branch point for: netbsd-1-2
Changes since 1.5: +7 -2 lines
Diff to previous 1.5 (colored) to selected 1.247 (colored)

- $NetBSD$ rcsids
- Fixed so that .[A-Z]* targets that do not match keywords are ignored as
  Posix mandates
- Added .PHONY target keyword

Revision 1.5 / (download) - annotate - [select for diffs], Mon Jun 6 22:45:23 1994 UTC (29 years, 9 months ago) by jtc
Branch: MAIN
CVS Tags: netbsd-1-0-base, netbsd-1-0-RELEASE, netbsd-1-0-PATCH1, netbsd-1-0-PATCH06, netbsd-1-0-PATCH05, netbsd-1-0-PATCH04, netbsd-1-0-PATCH03, netbsd-1-0-PATCH02, netbsd-1-0-PATCH0, netbsd-1-0
Changes since 1.4: +20 -15 lines
Diff to previous 1.4 (colored) to selected 1.247 (colored)

Fixes from Christos Zoulas, who used purify, objectcenter and testcenter
to find memory leaks and illegal memory accesses.

Revision 1.4 / (download) - annotate - [select for diffs], Sat Mar 5 00:34:39 1994 UTC (30 years, 1 month ago) by cgd
Branch: MAIN
Changes since 1.3: +110 -73 lines
Diff to previous 1.3 (colored) to selected 1.247 (colored)

fixes/improvements from Christos Zoulas <christos@deshaw.com>.

Revision 1.3 / (download) - annotate - [select for diffs], Thu Jan 13 21:01:45 1994 UTC (30 years, 2 months ago) by jtc
Branch: MAIN
Changes since 1.2: +3 -1 lines
Diff to previous 1.2 (colored) to selected 1.247 (colored)

Include appropriate header files to bring prototypes into scope.

Revision 1.2 / (download) - annotate - [select for diffs], Sun Aug 1 18:11:52 1993 UTC (30 years, 8 months ago) by mycroft
Branch: MAIN
Changes since 1.1: +2 -1 lines
Diff to previous 1.1 (colored) to selected 1.247 (colored)

Add RCS identifiers.

Revision 1.1.1.1 / (download) - annotate - [select for diffs] (vendor branch), Sun Mar 21 09:45:37 1993 UTC (31 years ago) by cgd
Branch: WFJ-920714, CSRG
CVS Tags: patchkit-0-2-2, netbsd-alpha-1, netbsd-0-9-base, netbsd-0-9-RELEASE, netbsd-0-9-BETA, netbsd-0-9-ALPHA2, netbsd-0-9-ALPHA, netbsd-0-9, netbsd-0-8, WFJ-386bsd-01
Changes since 1.1: +0 -0 lines
Diff to previous 1.1 (colored) to selected 1.247 (colored)

initial import of 386bsd-0.1 sources

Revision 1.1 / (download) - annotate - [select for diffs], Sun Mar 21 09:45:37 1993 UTC (31 years ago) by cgd
Branch: MAIN
Diff to selected 1.247 (colored)

Initial revision

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb <webmaster@jp.NetBSD.org>