summaryrefslogtreecommitdiff
path: root/usr.bin
AgeCommit message (Collapse)Author
2021-12-18lint: document wrong data structures for modelling initializationsrillig
No functional change.
2021-12-18lint: move maximum seen subscript from brace level to initializationrillig
There is no need to store this information at every brace level since in any translation unit that survives a conforming C99 compiler, an array of unknown size is only possible once per initialization, not once per brace level.
2021-12-18lint: format grammar consistentlyrillig
No binary change.
2021-12-18lint: use vector instead of list for designation in initializationrillig
This change is a prerequisite for fixing the current bugs in handling initializations. Part of the fix will be designation_pop, which is costly for a singly linked list. As a side benefit, memory management becomes simpler and needs fewer malloc calls. No functional change.
2021-12-17lint: reduce code for beginning an initializationrillig
No functional change.
2021-12-17lint: inline sub-cases of brace_level_sub_typerillig
Having the code in separate functions did not add to the clarity of the code. The additional information from the function names can be grasped as easily from the case labels. No functional change.
2021-12-17Remove an unnecessary test for NULL (the same thing is done in thekre
following lines) along with an incorrect return of nothing if it is found (the following version correctly returns NULL). Should unbreak build.
2021-12-17fix error messages, usage, add static, more checks for ioctl, KNFchristos
2021-12-17Provide a clipping function and use it to prevent setting values out of bounds.christos
(from RVP)
2021-12-17more protection from unset threads from RVPchristos
2021-12-17lint: fix initialization with few braces from functionrillig
Seen in Postfix, smtp_proto.c.
2021-12-17lint: fix initialization of array with fewer bracesrillig
Seen in Postfix, cleanup_strerror.c.
2021-12-17lint: work around lint bug in initialization with few bracesrillig
Needs a proper fix later, but for now, this workaround allows to run lint on Postfix again.
2021-12-17lint: rename is_string_array to is_character_arrayrillig
The old name was too confusing. No functional change.
2021-12-17lint: in GCC mode, declare alloca and variantsrillig
The prototype declarations define the correct parameter types of these functions so that they are no longer subject to the default argument promotions (C11 6.5.2.2p6). The GCC builtins are only recognized in GCC mode (-g).
2021-12-16lint: narrow down parameter of build_namerillig
Passing an arbitrary tokenizer symbol left too much freedom and uncertainty to the caller, and 0 was a magic number in this context. No functional change.
2021-12-16tests/lint: ensure that tests on a message mention this messagerillig
2021-12-16lint: improve error message for missing newline in .ln filerillig
2021-12-15Add more attributeschristos
2021-12-15make: amend leftover cleanups from the previous commitsrillig
No functional change.
2021-12-15make: format comments according to /usr/share/misc/stylerillig
Assisted by indent(1), with manual corrections due to its many remaining bugs. No functional change.
2021-12-15make: use consistent indentation for statements and continuationsrillig
No binary change, except for line numbers in assertions in suff.c.
2021-12-15make: remove redundant comments for multiple-inclusion guardsrillig
2021-12-15make: remove space after ':' in bit-field declarationsrillig
As seen in /usr/share/misc/style.
2021-12-15make: remove bmake_freerillig
It was only used in 2 places, and in both these places, the pointer was never null.
2021-12-15make: in CLEANUP mode, free interned strings at the very endrillig
Noticed by sjg.
2021-12-15make: in ParseDependencyCheckSpec, move default branch to the bottomrillig
No functional change.
2021-12-15make: change return type of HashTable_Set to voidrillig
None of the callers needs the HashEntry for further manipulation. No functional change.
2021-12-15make: change return type of Compat_RunCommand from int to boolrillig
The documentation was wrong before since status was not restricted to only 0 or 1. No functional change.
2021-12-15make: mark several functions whose result must be usedrillig
Suggested by sjg, to catch more bugs like the memory leak in cond.c 1.303 from 2021-12-13. No binary change.
2021-12-15make: prevent memory leaks from buffersrillig
The warning about unused function results would have prevented the memory leak that was fixed in cond.c 1.303 from 2021-12-13.
2021-12-15lint: unexport struct_or_union_memberrillig
Strangely, lint2 didn't notice this unnecessary export.
2021-12-14Avoid NULL deref if there is no current thread. From RVP.christos
Prints "No applicable message"
2021-12-14Improve restrict handling.christos
2021-12-14provide an expanded description for -Wchristos
2021-12-14Also accept -W to pass to cppchristos
2021-12-14PR/56548: RVP: mail(1) segfaults if thread commands are used in ~/.mailrcchristos
2021-12-14make: condense repetetive code in ParseDirectiverillig
No functional change.
2021-12-14tests/make: disable test that behaves differently in ATFrillig
2021-12-14make: remove dead code for handling traditional include directivesrillig
This code is not reached, a line containing only the word "include" is categorized as error before. No functional change.
2021-12-14tests/make: test traditional include directiverillig
2021-12-14make: clean up parsing of variable assignmentsrillig
Assign pairs of variables in a consistent order, as far as possible. Use string functions instead of raw byte access, to make the code more human-readable. GCC 10 optimizes the code reasonably. No functional change.
2021-12-14make: remove unreachable code for parsing the dependency operatorrillig
At the point where ParseDependencyOp is called, cp is guaranteed to point to either ':' or '!'. No functional change.
2021-12-13tests/make: extend tests for parsing makefilesrillig
2021-12-13make: convert debugging flags from enum to bit-fieldrillig
This gets rid of the magic numbers, making it possible to add another debug flag without renumbering the others. No functional change.
2021-12-13Update -m description to reflect reality. Kernel dynamic memory trackingsimonb
was removed long ago; only pool usage is reported.
2021-12-13make: condense CondParser_ComparisonOprillig
No functional change.
2021-12-13make: fix memory leak when parsing '.if ${expr}' (since 2004-04-13)rillig
$ ( 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.
2021-12-13make: clean up loading of filesrillig
The call to Buf_DoneData was useless since ownership of the buffer data has already been passwed on to loadedfile_create and the local variable 'buf' goes out of scope after that statement. Except for cleaning up in debug mode, there is no reason to call Buf_DoneData and then discard the returned value. No functional change.
2021-12-13make: fix memory leak for filenames in .for loops (since 2013-06-18)rillig
Previously, each time a .for directive pushed its buffer on the input file stack, the current filename was duplicated. This was a waste of memory. The name of a file is typically only used while it is read in. There is one situation when the filename is needed for longer, which is when a target is defined. Since .for loops are implemented as a special form of included files, each .for loop duplicated the current filename as well. $ cat << EOF > for.mk .for i in 1 2 3 4 5 6 7 8 9 0 .for i in 1 2 3 4 5 6 7 8 9 0 .for i in 1 2 3 4 5 6 7 8 9 0 .for i in 1 2 3 4 5 6 7 8 9 0 .for i in 1 2 3 4 5 6 7 8 9 0 .for i in 1 2 3 4 5 6 7 8 9 0 .for i in 1 2 3 4 5 6 7 8 9 0 .endfor .endfor .endfor .endfor .endfor .endfor .endfor all: @ps -o rsz -p ${.MAKE.PID} EOF $ make-2021.12.13.03.55.16 -r -f for.mk RSZ 10720 $ ./make -r -f for.mk RSZ 1716 The difference is 8 MB, which amounts to 1 million .for loops.