History log of /netbsd-src/usr.bin/make/for.c (Results 1 – 25 of 182)
Revision Date Author Comments
# 9503bbed 07-Jun-2024 rillig <rillig@NetBSD.org>

make: remove redundant shortcut for building the .for loop body

The function NeedsEscapes was not optimized enough by GCC 10 to be worth
the extra code.


# 0c336a8c 02-Jun-2024 rillig <rillig@NetBSD.org>

make: sync VarEvalMode constant names with their debug log names


# dd76681b 25-May-2024 rillig <rillig@NetBSD.org>

make: fix a few more memory leaks


# 9b0e4f6f 01-Apr-2024 rillig <rillig@NetBSD.org>

make: remove unreachable code in handling .for loops


# 2192214d 21-Jan-2024 rillig <rillig@NetBSD.org>

make: clean up redundant 'const' from automatic variables

No binary change.


# f2b68e81 19-Nov-2023 rillig <rillig@NetBSD.org>

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

No binary change.


# a7d1ba3f 01-Jun-2023 rillig <rillig@NetBSD.org>

make: add more details to debug logging of .for loops


# d45705ac 01-Jun-2023 rillig <rillig@NetBSD.org>

make: shorten function names, clean up comments

No functional change.


# 2a6095b0 09-May-2023 rillig <rillig@NetBSD.org>

make: skip syntactically wrong .for loops

When a .for loop cannot be interpreted correctly, for example when there
are no iteration variables or the number of words doesn't match the
iteration varia

make: skip syntactically wrong .for loops

When a .for loop cannot be interpreted correctly, for example when there
are no iteration variables or the number of words doesn't match the
iteration variables, skip the body of the .for loop instead of
interpreting it once.

show more ...


# 36f24c2b 08-May-2023 rillig <rillig@NetBSD.org>

make: disallow characters like '$' in variable names in .for loops

Fixes PR 53146.


# 34f7aa2d 08-May-2023 rillig <rillig@NetBSD.org>

make: fix parsing of unusual line continuations in .for loops


# a4cbe1d7 14-Feb-2023 rillig <rillig@NetBSD.org>

make: clean up calls to Var_Subst

None of the calls to Var_Subst used the return value, and the return
value was always VPR_OK.

No functional change.


# 863fcc7b 03-Sep-2022 rillig <rillig@NetBSD.org>

make: clean up handling of .break in .for loops

Move For_Break further up, as the functions in that file are sorted from
small to big. The cast from size_t to unsigned int is required by lint.

In

make: clean up handling of .break in .for loops

Move For_Break further up, as the functions in that file are sorted from
small to big. The cast from size_t to unsigned int is required by lint.

In parse.c, move the code into a separate function to keep
ParseDirective small. Its only job is to parse the directive and then
delegate to another function doing the actual work.

In the manual page, remove empty lines.

In the test, ensure that .break stops processing of the .for loop
immediately; anything after the .break is not processed anymore.
Replace ':=' with '=', as there is no need to evaluate '$i' early.
Check the expected value in the .mk file instead of the .exp file, to
keep the reading scope as small as possible.

show more ...


# 5cc84921 02-Sep-2022 sjg <sjg@NetBSD.org>

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: christ

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

show more ...


# 5e8f47d1 12-Jun-2022 rillig <rillig@NetBSD.org>

make: document ExprLen, which is part of a .for loop

No binary change


# 54add74b 04-Feb-2022 rillig <rillig@NetBSD.org>

make: use unsigned int for line numbers everywhere

Previously, some line numbers were stored as signed int while others
were stored as size_t. Since line numbers are never negative, use an
unsigned

make: use unsigned int for line numbers everywhere

Previously, some line numbers were stored as signed int while others
were stored as size_t. Since line numbers are never negative, use an
unsigned type. Since the maximum file size for makefiles is 1 GB (see
loadfile), unsigned int is large enough even on 64-bit platforms.

Using a single data types reduces the number of type conversions. Using
unsigned int improves compatibility with C90 (printf %u instead of %zu),
which is needed by bmake, which is derived from usr.bin/make.

No functional change.

show more ...


# 212c705a 27-Jan-2022 rillig <rillig@NetBSD.org>

make: clean up AddEscape for building the body of a .for loop

Adding 1 + len bytes but only incrementing the pointer by len bytes
looked suspicious, so use the same expression in both places.

No fu

make: clean up AddEscape for building the body of a .for loop

Adding 1 + len bytes but only incrementing the pointer by len bytes
looked suspicious, so use the same expression in both places.

No functional change.

show more ...


# fb272eaa 09-Jan-2022 rillig <rillig@NetBSD.org>

make: extract low-level character operations into utility function

Suggested by nia.
https://mail-index.netbsd.org/source-changes-d/2022/01/09/msg013564.html

No functional change.


# 5de02beb 09-Jan-2022 rillig <rillig@NetBSD.org>

make: fix crash for newline in .for value in -dp mode (since yesterday)


# 477f7231 09-Jan-2022 rillig <rillig@NetBSD.org>

make: fix use-after-free in -dp mode (since yesterday)

In a .for loop that contains an unclosed .if directive,
Cond_restore_depth generates an error message. If stack traces are
enabled using the o

make: fix use-after-free in -dp mode (since yesterday)

In a .for loop that contains an unclosed .if directive,
Cond_restore_depth generates an error message. If stack traces are
enabled using the option '-dp', the details of the .for loop are added
to the stack trace, but at that point, the ForLoop had already been
freed. To reproduce:

make-2022.01.09.00.33.57 -r -f unit-tests/directive-for.mk -dp

show more ...


# bfd564d1 09-Jan-2022 rillig <rillig@NetBSD.org>

make: remove redundant parameter from ForLoop_SubstVarLong

The buffer of a .for loop is always either empty or ends with '\n'. A
variable name consists of arbitrary non-whitespace characters.
There

make: remove redundant parameter from ForLoop_SubstVarLong

The buffer of a .for loop is always either empty or ends with '\n'. A
variable name consists of arbitrary non-whitespace characters.
Therefore a variable name can never reach the end of the buffer.

No functional change.

show more ...


# cbc7ee67 08-Jan-2022 rillig <rillig@NetBSD.org>

make: add details about .for loop variables to stack traces

The stack traces are enabled with the debug logging option '-dp'.


# 577ef4e8 08-Jan-2022 rillig <rillig@NetBSD.org>

make: fix reported line numbers of continuation lines (since 2002)

Previously, multi-line directives like '.info' or '.error' reported the
line number of their last line instead of their first line,

make: fix reported line numbers of continuation lines (since 2002)

Previously, multi-line directives like '.info' or '.error' reported the
line number of their last line instead of their first line, which is
more usual. This also affected the debug log from '-dp'.

show more ...


# 6da1a2e8 08-Jan-2022 rillig <rillig@NetBSD.org>

make: inline Buf_Clear

No functional change.


# 5f7b57b1 07-Jan-2022 rillig <rillig@NetBSD.org>

make: clean up structure of For_Eval

Put related decisions on the same indentation level, remove unnecessary
negation, keep the code for the '.for' directive together.

No functional change.


12345678