History log of /netbsd-src/usr.bin/make/util.c (Results 1 – 25 of 78)
Revision Date Author Comments
# a8e14f36 15-Dec-2021 rillig <rillig@NetBSD.org>

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.


# a53f3754 15-Dec-2021 rillig <rillig@NetBSD.org>

make: use consistent indentation for statements and continuations

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


# 3ec10f8d 03-Feb-2021 rillig <rillig@NetBSD.org>

make: use shortcut functions Global_SetExpand and Global_AppendExpand

There are many places where global variables are set or appended to. To
reduce clutter and code size, encode the VAR_GLOBAL in

make: use shortcut functions Global_SetExpand and Global_AppendExpand

There are many places where global variables are set or appended to. To
reduce clutter and code size, encode the VAR_GLOBAL in the function
name.

The word Expand in the function names says that the variable name is
expanded. In most of the cases, this is not necessary, but there are no
corresponding functions Global_Set or Global_Append yet.

Encoding the information whether the name is expanded or not in the
function name will make inconsistencies obvious in future manual code
reviews. Letting the compiler check this by using different types for
unexpanded and expanded variable names is probably not worth the effort.
There are still a few bugs to be fixed, such as in SetVar, which expands
the variable name twice in a row.

show more ...


# 60662022 03-Feb-2021 rillig <rillig@NetBSD.org>

make: fix compiler warning about signedness in comparison


# 139d9dbc 01-Feb-2021 rillig <rillig@NetBSD.org>

make: replace pre-increment with post-increment or simple addition

The rest of the code already prefers post-increment if there is no
actual difference.


# b754dcb0 30-Dec-2020 rillig <rillig@NetBSD.org>

make(1): format multi-line comments


# a44c2b10 15-Dec-2020 rillig <rillig@NetBSD.org>

make(1): indent nonints.h and util.c with tabs instead of spaces


# e5d87928 05-Dec-2020 rillig <rillig@NetBSD.org>

make(1): refuse to use vsnprintf that is prone to buffer overflows

Several parts of make intentionally depend on the guarantee that
snprintf and vsnprintf do not overflow their buffer. If an
implem

make(1): refuse to use vsnprintf that is prone to buffer overflows

Several parts of make intentionally depend on the guarantee that
snprintf and vsnprintf do not overflow their buffer. If an
implementation cannot provide this guarantee, refuse to use it.

show more ...


# 4adbce36 23-Nov-2020 rillig <rillig@NetBSD.org>

make(1): use comparisons in boolean expressions

The generated code stays exactly the same.


# 7179b788 23-Nov-2020 rillig <rillig@NetBSD.org>

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


# 71e1e474 16-Nov-2020 rillig <rillig@NetBSD.org>

make(1): use postfix increment where possible


# 5b07d357 08-Nov-2020 rillig <rillig@NetBSD.org>

make(1): use common indentation style for else


# 66f93f92 07-Nov-2020 rillig <rillig@NetBSD.org>

make(1): clean up spacing in fallback implementation of vsnprintf


# 143a3267 05-Nov-2020 rillig <rillig@NetBSD.org>

make(1): remove redundant parentheses from sizeof operator

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


# 2df1e5fe 06-Oct-2020 rillig <rillig@NetBSD.org>

make(1): remove incomplete fallback implementation of strftime

The function strftime is available since C89. Any environments older
than that are not supported anymore.


# f336e55b 05-Oct-2020 rillig <rillig@NetBSD.org>

make(1): revert previous commit

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


# b6c0384f 05-Oct-2020 rillig <rillig@NetBSD.org>

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 combinatio

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.

show more ...


# 052e64b5 03-Oct-2020 rillig <rillig@NetBSD.org>

make(1): clean up #include sections


# 6de75a95 13-Sep-2020 rillig <rillig@NetBSD.org>

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 co

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.

show more ...


# d4d05b9c 12-Sep-2020 rillig <rillig@NetBSD.org>

make(1): add typedef for signal handler

Without this typedef, both the declaration and the definition of
bmake_signal were as unreadable as the declaration in the signal(3)
manual page.


# bdd56552 01-Aug-2020 rillig <rillig@NetBSD.org>

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.


# 820b5cae 03-Jul-2020 rillig <rillig@NetBSD.org>

make(1): remove trailing whitespace


# 44d841d2 03-Jul-2020 rillig <rillig@NetBSD.org>

make(1): remove redundant parentheses around return values


# 0bcf77e1 07-Jan-2020 rillig <rillig@NetBSD.org>

usr.bin/make: remove dead code

The preprocessor conditions contradicted each other: __hpux__ or __hpux
would need to be defined, and at the same time none of them would need to
be defined.


# f9d128e0 26-Nov-2013 joerg <joerg@NetBSD.org>

Include signal.h early for MiNT and Linux. From pkgsrc.


1234