lp:make
- Get this branch:
- bzr branch lp:make
Branch merges
Branch information
Import details
This branch is an import of the HEAD branch of the Git repository at git://git.sv.gnu.org/make.git.
Last successful import was .
Recent revisions
- 3156. By Dmitry Goncharov <email address hidden>
-
[SV 66273] Double-colon targets must not be intermediate
An explicitly mentioned double-colon target cannot be intermediate.
* src/read.c (record_files): Set file->is_explicit in the case of an
explicitly mentioned file built by a double colon rule.
* src/file.c (print_file): Have print_file print whether a file is
explicitly mentioned.
* tests/scripts/features/ patternrules: Add tests. - 3155. By Dmitry Goncharov <email address hidden>
-
[SV 66268] Include newlines in file removal error message
* src/file.c (remove_
intermediates) : Fix an error message about a
failure to remove an intermediate file.
* tests/scripts/features/ patternrules: Add tests. - 3153. By Sergei Trofimovich <email address hidden>
-
Fix biased shuffle by avoiding already "struck" elements
Artem Klimov noticed that current shuffle implementation suffers from
probability bias due to a typical bug in the shuffling implementation.When we consider already shuffled element we slightly bias their
propability.https:/
/en.wikipedia. org/wiki/ Fisher% E2%80%93Yates_ shuffle# The_modern_ algorithm
suggests shuffling each "struck" element only once.Before the change probabilities of 4-element array to land from `i`
index to `j` index are:0 1 2 3
_____ _____ _____ _____
0 | 25.00 29.30 24.60 21.10
1 | 25.00 22.25 28.13 24.63
2 | 25.00 23.44 22.26 29.30
3 | 25.00 25.01 25.01 24.98Note that `0->1` probability is almost 29% while `0->3` os only 21%.
After the change probabilities are not as biased:
0 1 2 3
_____ _____ _____ _____
0 | 24.99 24.99 25.01 25.01
1 | 24.99 25.04 24.99 24.99
2 | 25.01 25.00 25.00 24.99
3 | 25.01 24.98 25.00 25.01* src/shuffle.c (random_
shuffle_ array): Fix biased shuffle by avoiding
already "struck" elements. - 3151. By Paul Eggert
-
Check for snprintf truncation on W32
* src/main.c (find_and_
set_default_ shell) [MK_OS_W32]:
Do not use a buffer that snprintf truncated. - 3150. By Paul Eggert
-
Fix unlikely pointer overflow in abspath
* src/function.c (abspath): len is now ptrdiff_t,
to avoid GCC warning about comparing signed to unsigned.
It really is a pointer difference, after all.
Rejigger comparision to avoid undefined behavior
if dest + len is an invalid pointer. - 3149. By Paul Eggert
-
Prefer memcpy to strncpy if either will do
strncpy is trickier and a bit slower.
* src/function.c (func_realpath, func_abspath):
* src/misc.c (xstrndup):
Prefer memcpy or mempcpy to strncpy when the source length is known. - 3148. By Paul Eggert
-
Omit unused PATH_MAX code
* src/makeint.h (GET_PATH_MAX, PATH_VAR):
Simplify, since PATH_MAX is always defined here.
(NEED_GET_PATH_MAX) : Remove.
* src/misc.c (get_path_max) [NEED_GET_PATH_MAX] : Remove. - 3147. By Paul Eggert
-
Avoid strlen calls after sprintf
* src/file.c (file_timestamp
_sprintf) :
* src/function.c (func_words, func_call):
* src/job.c (child_error):
* src/main.c (define_makeflags):
* src/output.c (message, error, fatal):
Use return value from sprintf instead of calling strlen
on the resulting buffer.
Branch metadata
- Branch format:
- Branch format 7
- Repository format:
- Bazaar repository format 2a (needs bzr 1.16 or later)