Commit Graph

20917 Commits

Author SHA1 Message Date
rillig 29b142dfe2 make: merge functions that parse modifier parts
This commit subtly changes the behavior for the :gmtime and :localtime
modifiers, but only in irrelevant cases since the time value must be an
integer, and neither '\' nor ':' nor '$' may occur in these values.
2024-05-31 20:21:34 +00:00
rillig 0fbf3fce65 tests/make: replace or document .error in tests
The text 'Missing argument for ".error"' in an .exp file may be a hint
for an accidentally broken test, so eliminate them as far as possible.
2024-05-31 07:13:12 +00:00
rillig 72b6692e9f make: simplify expression in iteration over hash tables 2024-05-31 07:11:12 +00:00
rillig 2864ddb2e9 make: clean up API for iterating over hash tables 2024-05-31 05:50:11 +00:00
rillig 880d6717fe make: don't log anything when freeing memory 2024-05-30 21:50:34 +00:00
sjg e78cefbe42 make: allow debugging the warning about .OBJDIR
When make complains about an unwritable .OBJDIR
it is not always obvious how we derrived that value.

If MAKE_DEBUG_OBJDIR_CHECK_WRITABLE is enabled call PrintOnError
so we can examine variables that are likely relevant.

Fix description of MAKE_OBJDIR_CHECK_WRITABLE in make.1
2024-05-28 19:09:04 +00:00
rillig f3426a08ed make: use fewer technical terms in debug message for dependency 2024-05-25 22:08:35 +00:00
rillig f80730c1d3 make: replace magic numbers with POSIX FILENO constants
No binary change.
2024-05-25 21:34:38 +00:00
rillig e67daf6e75 tests/make: rename temporary file
The filename extension '.inc' is reserved for files that are checked
into version control.
2024-05-25 21:11:30 +00:00
rillig 734fc80208 make: fix memory leak for command strings 2024-05-25 21:07:48 +00:00
rillig cd90f040db make: minimize local variables around a vfork call
Passing all relevant values as arguments allows to remove the 'volatile'
qualifiers.
2024-05-25 15:37:17 +00:00
rillig c05c85b7d7 make: fix some more memory leaks 2024-05-25 08:03:19 +00:00
rillig dd76681b7b make: fix a few more memory leaks 2024-05-25 00:00:25 +00:00
rillig 0ab57ba387 make: in -DCLEANUP mode, free variables and their values
The variables in the 3 scopes must be freed before the scopes themselves
are freed by Targ_End.

The test opt-m-include-dir creates a directory of the form '*.tmp', thus
it must be removed before attempting to only remove regular files of
this name.

POSIX requires setenv to copy the passed name and value, so there is no
need to keep that memory allocated any longer.
2024-05-24 23:02:46 +00:00
rillig e3cf24f959 make: remove dead code from HashTable_DeleteEntry 2024-05-24 22:54:07 +00:00
rillig 9755e146fc make: remove trailing whitespace 2024-05-24 22:52:24 +00:00
uwe 61a71e7495 mkubootimage.1: improve markup 2024-05-22 00:02:46 +00:00
uwe 7d9f356046 mkubootimage.1: restore .Ed lost in previous 2024-05-21 23:31:21 +00:00
gutteridge e8de72e87c mkubootimage(1): adjust example output in man page
Refresh to show current output format (an additional field) and address
a "TODO" comment that's been there for over a decade.
2024-05-21 22:10:21 +00:00
gutteridge 1887598093 mkubootimage(1): adjust usage, etc.
In the tool, reflow and reorder usage() output and also consistently
mark which arguments are optional.

In the man page, add missing -t argument in the synopsis and follow
consistent argument ordering.
2024-05-21 04:01:26 +00:00
gutteridge 5231fcf070 mkubootimage(1): add riscv 2024-05-21 03:54:31 +00:00
nia d257b0e8a9 aiomixer(1): Fix setting volume on sb(4) emulated in QEMU.
The driver does not return a "delta", assume it's 16.
2024-05-20 22:21:45 +00:00
wiz 7964e1f2d6 Improve usage.
From Igor Sobrado Delgado, so we're in sync with OpenBSD.
2024-05-20 20:46:05 +00:00
sjg 034e15ae19 make: cleanup style in FindFile
Since we removed the last check for isinclude,
restore to the previous indentation etc.

No functional change.
2024-05-20 19:14:12 +00:00
sjg 146cab6498 Allow .include <> to search .CURDIR last
libc at least appears to depend on this.
2024-05-20 16:04:46 +00:00
christos 98b3419359 PR/58270: RVP: tic does not honor the user's umask, output files are 0666. 2024-05-20 14:41:37 +00:00
sjg c86b32d1f8 make: use separate function to include makefiles.
Have Dir_FindFile and Dir_FindInclude call FindFile with a
bool flag to indicate whether .CURDIR should be be searched at all.
2024-05-19 20:09:40 +00:00
sjg 8853c17bba Dir_FindFile treat sysIncPath and defSysIncPath as special
Rather than play games with adding .DOTLAST and then having to
exclude that from .SYSPATH, just have Dir_FindFile check if
path is sysIncPath or defSysIncPath and behave as if .DOTLAST seen
and also skip the final search of .CURDIR.

Fix Dir_SetSYSPATH to use defSysIncPath if sysIncPath is empty.
2024-05-19 17:55:54 +00:00
andvar b087128c77 s/Abosrb/Absorb/ in comment. 2024-05-18 19:28:36 +00:00
andvar 9d70975e70 s/Aborb/Absorb/ in comment. 2024-05-18 19:03:31 +00:00
msaitoh 01f9da81b9 s/of of/of/ in comment. 2024-05-13 00:32:39 +00:00
msaitoh 441cf27377 emtpy -> empty in comment. 2024-05-13 00:25:23 +00:00
rillig 403b9b79e2 lint: remove redundant LINTFLAGS for lint2
The -T flag is already provided by ../Makefile.inc, along with several
other flags.
2024-05-12 19:00:10 +00:00
rillig 0671c09e39 lint: add wrapper for <ctype.h> functions, for strict bool mode
When using the Clang preprocessor (with MKLLVM=yes), the preprocessor
output does not indicate which tokens come from a system header and
which tokens come from the user code.  Lint's strict bool mode relies on
this information to treat the character classification functions from
<ctype.h> as if their return type were bool instead of int.

These wrapper functions are only used when their argument is indeed a
'char', but not when the argument might be 'EOF or representable as an
unsigned char', such as when reading a byte from the input.
2024-05-12 18:49:35 +00:00
rillig 91e71a2ef4 lint: remove unused flag '-u' from lint1
This flag is completely handled by lint2.
2024-05-12 18:00:58 +00:00
rillig 0866d10930 lint: suppress "used but not defined" for bin, sbin, usr.bin, usr.sbin
These diagnostics are emitted by lint2, and like all diagnostics from
lint2, they don't affect the exit status.

In libc, lint cannot handle the renamings from namespace.h, generating
many false positive diagnostics since 'libc_function' is used but
'_libc_function' is defined. Until this situation is handled properly,
suppress this diagnostic.
2024-05-12 17:55:36 +00:00
rillig 0ec48ab17e lint: condense code for strict bool mode 2024-05-12 12:32:39 +00:00
rillig 681c37d9da lint: in strict bool mode, allow do-while-0
Even though 0 is not a boolean constant, allow this common idiom, to
help in those cases where the C preprocessor used by lint does not mark
tokens as coming from system headers (Clang).
2024-05-12 12:28:34 +00:00
rillig 88d3a49009 lint: don't call memcpy with null pointer
Even copying 0 bytes from a null pointer invokes undefined behavior.
2024-05-12 09:07:41 +00:00
rillig 922b235ff9 lint: move code for parsing balanced token sequences to lex.c
To access yytext from lex.c, the lexer needs to be in %pointer mode,
which was specified in IEEE Std 1003.1, 2004 Edition and thus should be
old enough to be available on platforms other than NetBSD, for use in
tools/lint1 where lint1 is built before yacc and lex.
2024-05-12 08:48:36 +00:00
christos a3cbce7519 Only mark the terminfo entry promoted if actually was. 2024-05-11 22:06:57 +00:00
rillig 7eb83dabf6 lint: clean up grammar rule name for 'type_specifier' 2024-05-11 16:58:59 +00:00
rillig 4bd7e6e13f lint: parse but otherwise ignore C23 attributes
The C23 attributes are only parsed before an expression in an expression
statement, as a proof of concept.  Other places will follow later.
2024-05-11 16:12:28 +00:00
rillig 9cfc443f88 lint: warn when comparing an integer to a floating point constant 2024-05-11 15:53:38 +00:00
rillig fd614d9435 lint: clean up conversion from floating point constant 2024-05-10 21:43:40 +00:00
rillig d5c41e0169 error: disable lint's strict bool mode when building with Clang
The Clang preprocessor does not mark sections from system headers.
Lint's strict bool mode relies on these markers to allow the functions
from <ctype.h> to be used as 'bool', even though their declared return
type is 'int'. Without these markers, lint complains that the "right
operand of '&&' must be bool, not 'int'". Until this is fixed in lint,
disable strict bool mode.
2024-05-10 09:27:27 +00:00
wiz 30bb22f9da nstall(1): add support for -v
Reviewed by rillig@ and thorpej@, thanks!
2024-05-10 09:14:52 +00:00
rillig 64ab641533 lint: in C23 mode, allow storage classes in compound literals 2024-05-09 20:56:41 +00:00
rillig 2d37fed27b lint: add details to message about too many initializers 2024-05-09 20:53:13 +00:00
rillig 98b1d3b32e lint: sync grammar rule names with C11 and C23 2024-05-09 20:22:20 +00:00