Link [ NetBSD | NetBSD OpenGrok source search | PR fulltext-search | Summary of daily snapshot builds | history of daily build result | pkgsrc commit viewer ]


   
        usage: [branch:branch] [user:user] [path@revision] keyword [... [-excludekeyword [...]]] (e.g. branch:MAIN sys/arch/arm, if_wm.c@1.234 )




switch to index mode

recent branches: MAIN (2h)  netbsd-8 (5d)  netbsd-10 (5d)  netbsd-9 (11d)  thorpej-ifq (175d)  thorpej-altq-separation (178d) 

2024-05-10 11:39:10 UTC Now

2024-05-10 09:30:47 UTC MAIN commitmail json YAML

sys/ktrace.h: fix off-by-one error in snprintb for ktrace flags

(rillig)

2024-05-10 09:27:27 UTC MAIN commitmail json YAML

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.

(rillig)

2024-05-09 20:56:41 UTC MAIN commitmail json YAML

lint: in C23 mode, allow storage classes in compound literals

(rillig)

2024-05-09 20:53:13 UTC MAIN commitmail json YAML

2024-05-09 20:22:20 UTC MAIN commitmail json YAML

lint: sync grammar rule names with C11 and C23

(rillig)

2024-05-09 20:15:05 UTC MAIN commitmail json YAML

lint: sort grammar rules according to the order they appear in C23

(rillig)

2024-05-09 11:08:07 UTC MAIN commitmail json YAML

2024-05-07 21:13:27 UTC MAIN commitmail json YAML

2024-05-07 19:32:35 UTC MAIN commitmail json YAML

tests/lint: show that in C23 mode, bool is not yet defined

The tests in C11 and C23 mode look the same right now but will change
soon.

The warnings in the C11 test disappeared because after the first error,
warnings about unused variables are suppressed by check_variable_usage,
as they are often wrong.

(rillig)

2024-05-04 06:52:17 UTC MAIN commitmail json YAML

lint: increase debug logging for declarations

All changes to the global variable 'dcs' are tracked now, to help
identify the cause of the failing tests in expr_sizeof and
gcc_attribute_aligned.

While here, test more invalid type combinations in typedefs.

(rillig)

2024-05-04 05:50:49 UTC MAIN commitmail json YAML

mktemp.3: mkdtemp is no longer nonstandard

Reported by Aleksey Cheusov on tech-userlevel.

(rillig)

2024-05-03 19:16:13 UTC MAIN commitmail json YAML

tests/lint: fix supposedly platform-independent type definitions

No idea where I got the previous type definitions from.  The typedef
names looked just too convincing to actually check the underlying types.

(rillig)

2024-05-03 15:32:37 UTC MAIN commitmail json YAML

tests/lint: skip test for sizeof struct on 32-bit platforms

Even though the test only uses fixed-size types, lint's computed size of
the resulting struct differs between i386 (80) and x86_64 (112).  Both
are wrong, probably due to the unrelated struct declaration above, as
already mentioned in the comments.

(rillig)

2024-05-03 04:04:18 UTC MAIN commitmail json YAML

lint: measure the alignment in bytes, not bits

While measuring the alignment in bits makes sense when building a struct
type with bit-fields, in all other places it is more confusing than
helpful.

The only visible change is that in debug mode, the format of type sizes
and alignment changed.  Since the size of all complete types is a
multiple of a byte (as defined in the C standard), sizes and alignments
are reported in bytes as well.  Only while a struct is being built, the
type size may include an additional '+x' for the bits of a bit-field.

(rillig)

2024-05-02 20:03:33 UTC MAIN commitmail json YAML

tests/lint: demonstrate wrong struct size calculation

(rillig)

2024-05-02 18:34:01 UTC MAIN commitmail json YAML

parsedate.3: resolve contradictory values for 'next'

(rillig)

2024-05-01 17:42:58 UTC MAIN commitmail json YAML

lint: make 'offsetof(t, array-member)' a constant expression

The macro 'offsetof(t, m)' already expanded to a constant expression for
scalar members but not for arrays.  This was because the macro expanded
to '(size_t)(((t *)0)->m)', which lint internally represents as
'addr(indir(ptr(0) + offset(m)))', and build_address simplifies
'addr(indir(x))' to 'x' if the types match.  The types only match for
scalar types though, but not for arrays.

When build_address happens, the type information is incomplete,
therefore 'offsetof(t, array)' has to be simplified at a later point.

(rillig)

2024-05-01 12:36:56 UTC MAIN commitmail json YAML

tests/lint: test large enum constants and offsetof with array members

(rillig)

2024-05-01 10:30:56 UTC MAIN commitmail json YAML

lint: fix size of struct with large alignment

Lint now successfully passes all compile-time assertions in the amd64
kernel that deal with struct sizes.

(rillig)

2024-05-01 07:43:42 UTC MAIN commitmail json YAML

sys/cdefs.h: pass __aligned to lint

Lint could parse _Alignas and __attribute__((__aligned__(4))) previously
but simply ignored them. Since today, they affect the layout of struct
and union.

(rillig)

2024-05-01 07:40:11 UTC MAIN commitmail json YAML

2024-05-01 05:49:33 UTC MAIN commitmail json YAML

lint: fix warning about out-of-bounds bit-field value

(rillig)

2024-05-01 05:38:11 UTC MAIN commitmail json YAML

lint: demonstrate wrong warning about out-of-range bit-field

(rillig)

2024-04-28 22:57:16 UTC MAIN commitmail json YAML

time.3: clarify that *tloc is always set if tloc != NULL

(rillig)

2024-04-28 22:43:30 UTC MAIN commitmail json YAML

setmode.3: fix typos

(rillig)

2024-04-28 22:21:21 UTC MAIN commitmail json YAML

execve.2: fix typo in markup

(rillig)

2024-04-28 18:55:04 UTC MAIN commitmail json YAML

tests/cd9660: add debug info to the file list

(rillig)

2024-04-28 15:10:19 UTC MAIN commitmail json YAML

make: don't reallocate memory after evaluating an expression

When an expression is evaluated, the resulting text is short-lived in
almost all cases.  In particular, the compaction neither affects the
target names nor the global variable values, which are the prime
candidates for permanent memory usage.

(rillig)

2024-04-28 14:39:22 UTC MAIN commitmail json YAML

tests/cd9660: replace compressed blob with readable hexdump

This test is skipped in most circumstances because it creates a file
whose apparent size is 4.5 GB.  It's an ISO 9660 image though,
containing mostly null bytes.  Nevertheless, tmpfs doesn't allow such a
big file to be created, so this test is skipped in settings where /tmp
is on a tmpfs.

If the test is run, the ISO image is uncompressed, which takes several
minutes.  Replace bzip2 with direct file creation from a hex dump of
that disk image, which is easier to inspect manually and also faster by
about 3 magnitudes.

(rillig)

2024-04-28 07:27:43 UTC MAIN commitmail json YAML

2024-04-27 21:26:23 UTC MAIN commitmail json YAML

make: fix comment about forcing a use-after-free

The previous expression didn't cause any bug, as the modifier
':@VAR@loop@' changed the value of the expression, thus making the
expression independent from the variable value.

Instead, the variable needs to be deleted from within an indirect
modifier, and that modifier needs to evaluate to an empty string, thus
doing nothing and preserving the original expression value.

(rillig)

2024-04-27 20:41:32 UTC MAIN commitmail json YAML

make: clean up, test .NOPATH

Trim down the comments in the archive module, as they mainly repeated
the code.  Trim down the binary code size in the archive module, as it
is rarely used.

In Var_Parse, delay two variable assignments until they are actually
needed.

(rillig)

2024-04-27 20:23:22 UTC MAIN commitmail json YAML

2024-04-27 17:33:47 UTC MAIN commitmail json YAML

2024-04-27 12:46:37 UTC MAIN commitmail json YAML

lint: converting a null pointer to another pointer type is not narrowing

(rillig)

2024-04-27 10:08:55 UTC MAIN commitmail json YAML

2024-04-27 06:01:08 UTC MAIN commitmail json YAML

mips: fix syntax error in LDBL_MAX (since 2011)

(rillig)

2024-04-26 17:38:44 UTC MAIN commitmail json YAML

2024-04-26 17:22:26 UTC MAIN commitmail json YAML

2024-04-26 17:11:22 UTC MAIN commitmail json YAML

make: in parallel mode, print the directory in which a job failed

When multiple targets run in parallel, the "stopped in" line may be
several lines away from the "Failed target" line, making them hard to
correlate.

(rillig)

2024-04-26 16:34:18 UTC MAIN commitmail json YAML

2024-04-26 01:33:23 UTC MAIN commitmail json YAML

tests/cp: clean up

Replace the deprecated "eq:0" with "exit:0", remove redundant "-o empty"
and "-e empty".

(rillig)

2024-04-26 00:57:15 UTC MAIN commitmail json YAML

tests/cat: clean up

Multiple arguments to atf_set are joined by spaces, there's no need for
an extra space.

The exit status on success must be 0, so don't ignore it.

Remove the unnecessary shell wrapper, as no redirection is going on.

(rillig)

2024-04-25 17:22:49 UTC MAIN commitmail json YAML

CHANGES: fix typo

(rillig)

2024-04-24 21:59:39 UTC MAIN commitmail json YAML

makefs: fix out-of-bounds fsnode count in fsnode_sort

Found by running './makefs img.dat cd9660'.

While here, apply more KNF.

(rillig)

2024-04-23 22:51:28 UTC MAIN commitmail json YAML

2024-04-21 21:59:48 UTC MAIN commitmail json YAML

make: trim down code for parsing the :gmtime and :localtime modifiers

The :gmtime and :localtime modifiers are not used often and thus are not
time-critical. Exchange the custom code that parses an integer from a
substring for an additional memory allocation.

Thanks sjg@ for suggesting to avoid the custom parsing code.

(rillig)

2024-04-21 17:19:52 UTC MAIN commitmail json YAML

libntf: make MKREPRO timestamp compatible with NetBSD 10

In NetBSD 10, make(1) cannot handle :gmtime arguments that are
expressions, resulting in the error message "Unknown modifier '1'".

(rillig)

2024-04-21 08:56:49 UTC MAIN commitmail json YAML

make: fix out-of-bounds read when evaluating :gmtime and :localtime

The function TryParseTime takes a pointer to a string, but the LazyBuf
returns a Substring, which is not guaranteed to be null-terminated or
delimited.  In TryParseTime, calling strtoul on the Substring read past
the end of the substring.

Noticed in the NetBSD build in libntp, where the :gmtime modifier is
used in two places with the same timestamp value, of which the first was
evaluated correctly and the second wasn't.

The bug was introduced in var.c 1.1050 from 2023-05-09, when the
argument of the :gmtime and :localtime modifiers was allowed to be an
expression instead of an integer constant.

(rillig)

2024-04-20 14:06:47 UTC MAIN commitmail json YAML

UPDATING: remove not-so-recent entries

(rillig)

2024-04-20 13:24:49 UTC MAIN commitmail json YAML

{usr.,}{s,}bin: replace LINT_SUPPORTED with the standard NOLINT

While here, re-enable lint in those cases where lint was skipped due to
a bug in interpreting abstract types, which was fixed in cgram.y 1.469
from 2023-08-02.

(rillig)

2024-04-20 12:25:46 UTC MAIN commitmail json YAML

build.sh: fix typos in usage message

(rillig)

2024-04-20 10:18:56 UTC MAIN commitmail json YAML

2024-04-20 08:03:08 UTC MAIN commitmail json YAML

libntp: clean up MKREPRO_TIMESTAMP handling

NetBSD's make has built-in support for formatting timestamps, so use
that instead of relying on an external tool.  The month name is still
always in the C locale, and possible errors are reported in the affected
line, due to the ':=' assignment operator.

Without the ':=' assignment operator, the intermediate variable would
not be necessary, but in that case, make's error handling is broken and
unspecific.

(rillig)

2024-04-19 20:59:18 UTC MAIN commitmail json YAML

tests/lint: show how to trigger message 207

(rillig)

2024-04-14 15:21:20 UTC MAIN commitmail json YAML

make: make string matching platform-independent

Previously, whether the character range '[a-è¾°]' matched, depended on the
signedness of the plain 'char' type.  Since make operates on byte
strings and does not support UTF-8 or other multi-byte character
encodings, this edge case is not expected to occur in practice.

No change in the unit tests as this edge case is not covered by tests.

(rillig)

2024-04-14 12:30:48 UTC MAIN commitmail json YAML

2024-04-13 14:02:51 UTC MAIN commitmail json YAML

tests/fmtcheck: show that fmtcheck does not support "%2$s"

(rillig)

2024-04-12 05:44:38 UTC MAIN commitmail json YAML

2024-04-12 05:17:48 UTC MAIN commitmail json YAML

2024-04-10 17:52:41 UTC MAIN commitmail json YAML

ed: fix inconsistency in comment

(rillig)

2024-04-08 21:28:36 UTC MAIN commitmail json YAML

snprintb.3: provide examples for hexadecimal character escapes

Suggested by uwe@, in reaction to the previous commit, which preferred
octal in the examples. Hexadecimal escapes are more familiar to most
programmers, and the chance of mistaking \x14 for decimal 14 is less
than the chance of mistaking octal \014 for decimal 14.

(rillig)

2024-04-07 17:08:00 UTC MAIN commitmail json YAML

2024-04-07 15:20:17 UTC MAIN commitmail json YAML

snprintb: reject empty bit descriptions and wrongly placed defaults

(rillig)

2024-04-07 14:28:27 UTC MAIN commitmail json YAML

snprintb.3: clean up formatting and wording, prefer octal in examples

Using hexadecimal character escapes requires separate string literals if
the description starts with one of the letters A-F; octal character
escapes have at most 3 digits, reducing ambiguity.

(rillig)

2024-04-07 12:05:23 UTC MAIN commitmail json YAML

snprintb: reject combinations of 'f' with ':' as well as 'F' with '='

These combinations would lead to garbled output.

(rillig)

2024-04-07 10:10:54 UTC MAIN commitmail json YAML

snprintb: reject empty descriptions

In cases where the snprintb output is garbled, it is not trustworthy, so
make sure the mistakes in the bitfmt are fixed early.

(rillig)

2024-04-05 22:21:40 UTC MAIN commitmail json YAML

flex.1: fix single-bit error in contributor name

(rillig)

2024-04-02 20:42:13 UTC MAIN commitmail json YAML

sparc/fpsetround: fix the nearby signed integer overflow as well

Same as for sparc64 a few days ago.

(rillig)

2024-04-02 15:05:15 UTC MAIN commitmail json YAML

tests/make: pass PATH onto child processes

This fixes the tests on some Cygwin variant where the shell does not
initialize the PATH environment variable when it's missing.

(rillig)

2024-04-02 11:11:00 UTC MAIN commitmail json YAML

tests/make: remove test for overly long chdir argument

On Cygwin, the path '/././..././' is normalized before being passed to
the child 'make' process. Since overly long pathnames are not required
to be supported on all platforms, remove the test.

(rillig)

2024-04-01 12:33:28 UTC MAIN commitmail json YAML

make: remove unreachable code in handling .for loops

(rillig)

2024-04-01 12:26:02 UTC MAIN commitmail json YAML

2024-04-01 09:15:51 UTC MAIN commitmail json YAML

tests/snprintb_m: test null-terminated output in error case

While here, clean up the buffer handling for the visualized array
content in case of a failed test.

(rillig)

2024-04-01 08:53:42 UTC MAIN commitmail json YAML

snprintb: remove redundant memset in kernel mode

The provided buffer is already null-terminated by finish_buffer, even in
error cases, there is no need to repeat the same work.

(rillig)

2024-03-31 20:28:45 UTC MAIN commitmail json YAML

2024-03-30 19:51:00 UTC MAIN commitmail json YAML

lint: document which fields are not reset when starting a new type

Setting all visible fields to their null value seemed as if the whole
object were reset.

(rillig)

2024-03-30 19:12:37 UTC MAIN commitmail json YAML

lint: in the query about implicit conversions, ignore casts

(rillig)

2024-03-30 17:23:13 UTC MAIN commitmail json YAML

2024-03-30 17:12:26 UTC MAIN commitmail json YAML

lint: do not convert array subscripts from size_t to ptrdiff_t

The C standards do not specify a fixed type for an array subscript, it
just has to be an integer type.  Previously, query 4 fired for the
ubiquitous expression 'ptr[sz]' when sz had type 'size_t'.

The test platform_ilp32_long is unaffected by this change, as the
integer constant 0x80000000 has type 'unsigned int', while size_t is
'unsigned long' on those platforms, and even though the types 'unsigned
int' and 'unsigned long' have the same value space, there's still a
conversion, at least for now.

(rillig)

2024-03-30 16:47:45 UTC MAIN commitmail json YAML

2024-03-29 08:35:32 UTC MAIN commitmail json YAML

2024-03-29 07:35:45 UTC MAIN commitmail json YAML

2024-03-29 06:13:40 UTC MAIN commitmail json YAML

moused: remove undocumented and unused option 'C'

(rillig)

2024-03-28 21:04:49 UTC MAIN commitmail json YAML

2024-03-27 21:14:09 UTC MAIN commitmail json YAML

lint: add missing assignment to $$ in grammar

Byacc and Bison both provide this assignment for all actions, whether
default or not, but the wording in POSIX doesn't guarantee this.

(rillig)

2024-03-27 20:09:44 UTC MAIN commitmail json YAML

2024-03-27 19:28:21 UTC MAIN commitmail json YAML

2024-03-27 05:43:38 UTC MAIN commitmail json YAML

tools/Makefile: clean up TOOLDIR validation

At the point where tools/Makefile is loaded, TOOLDIR doesn't have to
exist yet, it will be created later.  Remove the redundant quotes from
the .error messages.

(rillig)

2024-03-26 22:16:12 UTC MAIN commitmail json YAML

apei: fix typos in comments and snprintb bitfmt

(rillig)

2024-03-26 22:01:03 UTC MAIN commitmail json YAML

2024-03-26 21:52:23 UTC MAIN commitmail json YAML

t_strptime: fix typo in test description

(rillig)

2024-03-26 20:12:47 UTC MAIN commitmail json YAML

libm/s_logl: suppress lint warnings

Seen on sparc64.

(rillig)

2024-03-25 23:39:14 UTC MAIN commitmail json YAML

lint: fix warnings about loss of accuracy on bit-field operations

(rillig)

2024-03-25 22:46:23 UTC MAIN commitmail json YAML

tests/lint: demonstrate wrong warnings about lossy bit field operations

(rillig)

2024-03-25 22:37:43 UTC MAIN commitmail json YAML

2024-03-25 20:39:27 UTC MAIN commitmail json YAML

snprintb: mark the end of the buffer if the buffer is too small

This avoids confusion in case the buffer ends with an incomplete number.

(rillig)

2024-03-20 06:15:40 UTC MAIN commitmail json YAML

sparc64/fpsetround: avoid shifting into the sign bit

Lint had warned about the constant expression '0x03 << 30' but not about
the structurally equal nonconstant expression '(rnd_dir & 0x03) << 30'.

No binary change.

(rillig)

2024-03-19 23:19:04 UTC MAIN commitmail json YAML

lint: keep invalid arguments in function calls

Previously, arguments of incomplete type or 'void' cleared all arguments
of the function call expression, requiring extra checks in later checks.

Invalid function calls are now exported to the .ln files, but that's
irrelevant in practice as these invalid function calls make lint1 fail,
after which xlint removes the .ln file.

(rillig)

2024-03-14 21:17:54 UTC MAIN commitmail json YAML

stat: don't allow numeric formatting flags on strings

Calling snprintf with "%+s" invokes undefined behavior.

(rillig)

2024-03-14 21:00:33 UTC MAIN commitmail json YAML

2024-03-14 00:07:20 UTC MAIN commitmail json YAML

stat: fix lint warning about constant argument to '!'

No binary change.

(rillig)

2024-03-13 06:56:24 UTC MAIN commitmail json YAML

tests/lint: ensure that lint correctly decays array parameter types

(rillig)

2024-03-13 06:48:49 UTC MAIN commitmail json YAML

lint: trim down the check for snprintb formats

(rillig)

2024-03-12 20:35:29 UTC MAIN commitmail json YAML

tests/lint: extend test for previously wrong warning about bit-fields

(rillig)

2024-03-12 07:56:08 UTC MAIN commitmail json YAML

lint: fix warning about loss of conversion for unsigned bit-fields

Since decl.c 1.180 from 2021-05-02.

(rillig)

2024-03-12 07:29:40 UTC MAIN commitmail json YAML

tests/lint: demonstrate wrong warning when comparing a bit-field

Since decl.c 1.180 from 2021-05-02, which allowed arbitrary integer
types to be used as the underlying type for bit-fields in GCC mode.

(rillig)

2024-03-10 19:45:14 UTC MAIN commitmail json YAML

2024-03-10 18:54:41 UTC MAIN commitmail json YAML

kdump: keep the comment with its corresponding code

No binary change.

(rillig)

2024-03-10 18:23:18 UTC MAIN commitmail json YAML

postinstall: fix parameter order in usage message

(rillig)

2024-03-10 18:00:13 UTC MAIN commitmail json YAML

compiler_rt: allow signed bit shifts for __negv

Standard C defines '1 << 31' as undefined behavior, but
https://gcc.gnu.org/onlinedocs/gcc/Integers-implementation.html allows
it for GCC.

(rillig)

2024-03-10 17:34:47 UTC MAIN commitmail json YAML

2024-03-10 17:16:26 UTC MAIN commitmail json YAML

lsi64854reg: fix snprintb formats DDMACSR_BITS and PDMACSR_BITS

(rillig)

2024-03-10 17:07:31 UTC MAIN commitmail json YAML

powerpc/hid: fix snprintb format for HID0_970_BITMASK_U

(rillig)

2024-03-10 17:02:24 UTC MAIN commitmail json YAML

sparc/sbusreg: fix snprintb format for SBUS_AFSR_BITS

(rillig)

2024-03-10 16:58:08 UTC MAIN commitmail json YAML

sparc/vmereg: fix snprintb format VMEBUS_AFSR_BITS

(rillig)

2024-03-10 16:27:16 UTC MAIN commitmail json YAML

lint: clean up tree matcher for snprintb calls

(rillig)

2024-03-10 16:06:13 UTC MAIN commitmail json YAML

lint: saturate signed integer overflow

In array address calculations, this prevents a 'array subscript cannot
be negative' for large array subscripts.

(rillig)

2024-03-10 15:49:12 UTC MAIN commitmail json YAML

lint: fix integer overflow detection

Previously, an unsigned operation that had a negative result went
undetected in a few cases. Now, all results that are not representable
by their type are considered overflows.

The implementation of signed shift-right had been wrong for a few
commits.

(rillig)

2024-03-10 14:42:04 UTC MAIN commitmail json YAML

lint: clean up check for overflow in integer constants

(rillig)

2024-03-10 14:32:30 UTC MAIN commitmail json YAML

lint: detect more cases of integer overflow in constant expressions

For unsigned integers, detect when 'a + b' wraps around.

(rillig)

2024-03-10 12:50:46 UTC MAIN commitmail json YAML

lint: split integer overflow check into separate functions

The checks for unsigned and signed integers differ for each operator, so
there's no point having both parts in the same function.

(rillig)

2024-03-10 10:39:19 UTC MAIN commitmail json YAML

tests/lint: enable test for integer overflow in array index

(rillig)

2024-03-10 10:31:29 UTC MAIN commitmail json YAML

2024-03-10 10:15:52 UTC MAIN commitmail json YAML

lint: fix integer overflow in integer overflow check

(rillig)

2024-03-10 09:58:30 UTC MAIN commitmail json YAML

tests/lint: test integer overflow when folding constants

The test is still incomplete, yet it has discovered several bugs that
are worth fixing.

(rillig)

2024-03-10 09:24:54 UTC MAIN commitmail json YAML

lint: in check for integer overflow, sort operators

(rillig)

2024-03-09 23:55:11 UTC MAIN commitmail json YAML

lint: fix excessive overflow warning after division by zero

(rillig)

2024-03-09 17:34:01 UTC MAIN commitmail json YAML

2024-03-09 16:47:10 UTC MAIN commitmail json YAML

2024-03-09 14:54:14 UTC MAIN commitmail json YAML

lint: merge duplicate code for checking array index

(rillig)

2024-03-09 13:54:47 UTC MAIN commitmail json YAML

2024-03-09 13:20:55 UTC MAIN commitmail json YAML

2024-03-09 11:05:05 UTC MAIN commitmail json YAML

lint: clean up comments, use typedefs

(rillig)

2024-03-09 10:54:12 UTC MAIN commitmail json YAML

lint: internally store case label values in order of appearance

(rillig)

2024-03-09 10:47:16 UTC MAIN commitmail json YAML

2024-03-09 10:41:11 UTC MAIN commitmail json YAML

2024-03-09 06:51:40 UTC MAIN commitmail json YAML

postinstall: fix endless loop (since 2024-03-07)

(rillig)

2024-03-08 20:29:18 UTC MAIN commitmail json YAML

cpuctl: fix i386 bit descriptions for CPUID_SEF_FLAGS1

warning: non-printing character '\31' in description
    'BUS_LOCK_DETECT""b\31' [363]

(rillig)

2024-03-08 19:45:59 UTC MAIN commitmail json YAML

ifconfig: fix agr status

Previously, when the interface was collecting, its status was reported
as '<COLLECTING,DISTRIBUTING>', even when it was not distributing.

sbin/ifconfig/agr.c(170): warning: 'b\0DISTRIBUTING\0' overlaps earlier
    'b\0COLLECTING\0' on bit 0 [376]

(rillig)

2024-03-05 23:07:58 UTC MAIN commitmail json YAML

tests/make: clean up test for local scope variables

Use the same style of quotes for both kinds of variables.  To make the
variable values more easily comparable, write them to a single line.
Add the output to the 'expect' lines.

(rillig)

2024-03-05 07:37:08 UTC MAIN commitmail json YAML

snprintb: shrink code size, both in source and binary

(rillig)

2024-03-04 21:35:28 UTC MAIN commitmail json YAML

snprintb: error out on unknown new-style formatting directive

(rillig)

2024-03-03 16:09:01 UTC MAIN commitmail json YAML

2024-03-03 13:09:23 UTC MAIN commitmail json YAML

lint: warn about escaped snprintb directive

Repurpose message 362, as the previous version was redundant since null
bytes in old-style formats are already covered by message 371 (bit
position out of range) and 377 (redundant '\0' at the end).

(rillig)

2024-03-03 10:27:18 UTC MAIN commitmail json YAML

2024-03-03 00:50:42 UTC MAIN commitmail json YAML

2024-03-02 11:56:37 UTC MAIN commitmail json YAML

2024-03-02 09:32:19 UTC MAIN commitmail json YAML

2024-03-01 21:52:48 UTC MAIN commitmail json YAML

lint: fix misleading initializer for string iterator

The field 'start' marks the start of the previous matching character,
not the current iterator position.

No binary change.

(rillig)

2024-03-01 19:40:45 UTC MAIN commitmail json YAML

lint: test format strings from snprintb calls

The functions snprintb and snprintb_m are specific to NetBSD, and their
format strings are tricky to get correct.  Provide some assistance in
catching the most common mistakes.

(rillig)

2024-03-01 19:39:29 UTC MAIN commitmail json YAML

2024-03-01 17:53:30 UTC MAIN commitmail json YAML

make: fix type mismatch in lint's strict bool mode (since today)

(rillig)

2024-03-01 17:47:05 UTC MAIN commitmail json YAML

make: remove test variant for NO_REGEX

The compile-time toggle was removed in var.c 1.1099 from 2024-02-07.

(rillig)

2024-03-01 17:22:55 UTC MAIN commitmail json YAML

2024-03-01 17:14:34 UTC MAIN commitmail json YAML

lint: fix type error in strict bool mode (since yesterday)

(rillig)

2024-02-29 21:37:10 UTC MAIN commitmail json YAML

lint1: remove redundant type table for integer constant suffixes

(rillig)

2024-02-29 21:08:55 UTC MAIN commitmail json YAML

snprintb.3: fix typo

(rillig)

2024-02-29 20:55:35 UTC MAIN commitmail json YAML

parsedate.y: remove outdated comment

The number of shift/reduce conflicts has grown to 16.

(rillig)

2024-02-24 13:00:00 UTC MAIN commitmail json YAML

tests/snprintb: clean up tests

Always write the value to be formatted in hexadecimal, to make it easily
distinguishable from the buffer size and maximum line length.

Use consistent wording in the comments of the test cases. Be stricter
about mistakes in a format.

Fix some wrong numbers in the snprintb_m tests for limited line length.

(rillig)

2024-02-24 12:44:11 UTC MAIN commitmail json YAML

snprintb: clean up

Use consistent data types for buffer positions and lengths, to avoid
type casts.

(rillig)

2024-02-24 12:40:00 UTC MAIN commitmail json YAML

snprintb: allow non-ASCII descriptions on all platforms

Previously, these descriptions were only allowed on platforms where
plain 'char' is unsigned. On platforms where plain 'char' is signed,
they invoked undefined behavior or terminated the output early.

(rillig)

2024-02-22 21:04:24 UTC MAIN commitmail json YAML

snprintb: always null-terminate output

Always null-terminate the output in the buffer, even in error cases. The
wording in the manual page has been promising this since 2008. For
snprintb_m, ensure that the output is terminated with two null
characters, to gracefully handle situations in which the caller does not
check whether snprintb returned an error.

If the buffer size is zero, allow the buffer to be a null pointer,
analogous to snprintf.

Fix an out-of-bounds memory read if the bitfmt ends with a '*' directive
(since today).

In the tests, merge the helper functions for snprintb, snprintb_m, as
they were similar enough.

Fix a few 'line_max exceeded' tests, ensuring that they output a '#'
marker, and that the 'complete' tests don't.

(rillig)

2024-02-22 18:26:16 UTC MAIN commitmail json YAML

snprintb: error out on out-of-bounds bit shifts

Previously, these invoked undefined behavior, now they lead to an early
return. An example of out-of-bounds bit number is in SCZ_PCICTRL_BITS.
Bit fields that extend beyond the msb are still allowed.

Allow 'f' and 'F' to have fields that are 64 bits wide. This only makes
sense when the field starts at bit 0.

Remove the unused 'val_len', it was only needed before snprintb.c 1.20.

(rillig)

2024-02-20 21:45:36 UTC MAIN commitmail json YAML

tests/snprintb: test '=' and '*' directives that can never match

(rillig)

2024-02-20 20:38:54 UTC MAIN commitmail json YAML

snprintb.3: sync examples with reality

(rillig)

2024-02-20 20:31:56 UTC MAIN commitmail json YAML

snprintb_m: limit length of generated strings

The manual page promises that the 'max' argument limits the length of
the generated strings, so don't generate any strings that are longer
than that limit. Mark incomplete strings with a trailing '#' to make
them easily recognizable.

(rillig)

2024-02-20 19:49:10 UTC MAIN commitmail json YAML

tests/snprintb: fix out-of-bounds memory read (since 2024-02-16)

Before t_snprintb.c 1.20, the buffer size was required to be greater
than zero. Allowing the buffer size to be zero led to buf[-1] being
checked. On amd64, that byte happened to be 0, on i386 it didn't.

Fixes PR lib/57951.

(rillig)

2024-02-19 23:30:56 UTC MAIN commitmail json YAML

snprintb: fix how named bit-fields are split into multiple lines

(rillig)

2024-02-19 23:22:03 UTC MAIN commitmail json YAML

tests/snprintb: add more tests, especially for snprintb_m

(rillig)

2024-02-18 16:55:02 UTC MAIN commitmail json YAML

mman.h: fix snprintb description for alignment 2^60

(rillig)

2024-02-17 10:23:30 UTC MAIN commitmail json YAML

snprintb: convert macros to local functions

Let the compiler decide whether to inline the functions; allow stepping
through the code in a debugger.

(rillig)

2024-02-16 21:25:46 UTC MAIN commitmail json YAML

snprintb: do not modify bufsize when producing multiple lines

(rillig)

2024-02-16 19:53:40 UTC MAIN commitmail json YAML

snprintb: eliminate two local variables, allow zero-size buffer

Like snprintf, the buffer size may be zero. Unlike snprintf, the buffer
must not be NULL.

(rillig)

2024-02-16 19:31:25 UTC MAIN commitmail json YAML

snprintb: use size_t for buffer sizes and positions

(rillig)

2024-02-16 19:20:38 UTC MAIN commitmail json YAML

snprintb: fix integer overflow when writing past a small buffer

Previously, snprintb returned -1 in this case, assuming that the
snprintf used in FMTSTR validates against an overly large buffer size.

(rillig)

2024-02-16 18:17:10 UTC MAIN commitmail json YAML

snprintb: use unsigned integers for parsing the bitfmt

(rillig)

2024-02-16 18:13:47 UTC MAIN commitmail json YAML

tests/snprintb: fix test for 8-bit field value

The previous version tested the behavior on a platform with signed
'char' before the portability fix.

(rillig)

2024-02-16 18:09:16 UTC MAIN commitmail json YAML

snprintb: fix '=' and ':' for 8-bit values on platforms with signed char

Previously, '=' and ':' worked only on platforms where plain 'char' is
unsigned. On platforms where plain 'char' is signed, only 7-bit values
worked.

(rillig)

2024-02-16 18:03:16 UTC MAIN commitmail json YAML

snprintb: eliminate a few local variables

(rillig)

2024-02-16 17:42:50 UTC MAIN commitmail json YAML

snprintb: rename local variables

The single-letter variables 't', 's', 'l' and 'c' were too hard to
decipher.

The variable 'f_len' was used for two independent purposes.

Use a narrow scope for some variables, to avoid having to keep track of
22 individual variables at the same time.

No binary change.

(rillig)

2024-02-16 01:57:51 UTC MAIN commitmail json YAML

snprintb: clean up

Remove redundant parentheses and casts.

Indent statement-like macros consistently, use separate lines for each
statement, add parentheses to macro definitions.

Remove CONSTCOND comments as lint doesn't need them anymore.

No binary change.

(rillig)

2024-02-16 01:19:53 UTC MAIN commitmail json YAML

tests/snprintb: clean up existing tests, add more tests

Due to the check that any bytes beyond the expected output must be
unmodified, there's no need anymore to explicitly write the "ZZZ" at the
end of the expected output. While here, remove the redundant trailing
"\0".

Add more tests to cover possible situations where an out-of-bounds write
may have occurred. In some cases, the line length specified in
snprintb_m is exceeded.

(rillig)

2024-02-15 23:48:51 UTC MAIN commitmail json YAML

snprintb: fix string termination (since today)

In the previous commit, I had accidentally only run the tests for
snprintb_m but not those for snprintb, thereby missing a newly
introduced bug that would not null-terminate the resulting strings.

Add more tests to cover similar situations in which the buffer is too
small to contain the complete output.

(rillig)

2024-02-15 22:48:58 UTC MAIN commitmail json YAML

snprintb: rename buflen to bufsize, following the wording in snprintf

(rillig)

2024-02-15 22:37:10 UTC MAIN commitmail json YAML

2024-02-14 20:51:17 UTC MAIN commitmail json YAML

tests/libutil/snprintb_m: add tests for small line length

(rillig)

2024-02-08 20:59:20 UTC MAIN commitmail json YAML

lint: clean up variable names, parameter order, comments

No functional change.

(rillig)

2024-02-08 20:45:20 UTC MAIN commitmail json YAML

2024-02-08 19:32:12 UTC MAIN commitmail json YAML

lint: clean up comments, add debug output for Bison

(rillig)

2024-02-07 22:59:28 UTC MAIN commitmail json YAML

tests/lint: sync test for integer constant type on ILP32 platforms

The test was broken since lex.c 1.214 from today.

(rillig)

2024-02-07 08:00:37 UTC MAIN commitmail json YAML

lint: use consistent variable names, reduce code for reading a byte

No functional change.

(rillig)

2024-02-07 07:42:50 UTC MAIN commitmail json YAML

lint: unify rules for determining the type of an integer constant

Previously, in traditional C mode, large decimal numbers were treated as
unsigned, which disagreed with the book from 1978.

(rillig)

2024-02-07 07:21:22 UTC MAIN commitmail json YAML

make: remove redundant comments

No functional change.

(rillig)

2024-02-07 06:43:02 UTC MAIN commitmail json YAML

make: remove unneeded conditional-compilation toggles

The toggles INCLUDES, LIBRARIES, POSIX, SYSVINCLUDE, SYSVVARSUB,
GMAKEEXPORT and SUNSHCMD are no longer needed, they were unconditionally
set.

The toggle NO_REGEX was configurable from the command line, but
disabling it would result in various error messages about the unknown
':C' modifier.

OK sjg@.

(rillig)

2024-02-06 22:47:21 UTC MAIN commitmail json YAML

lint: tab-align message numbers in err.c

By replacing block comments with end-of-line comments, the comments take
up less space and thus no longer require to be indented by 6 spaces.

The messages and their comments are used in 3 places: the manual page
lint.7, the err-msgs.h header for debug mode, and check-msgs.lua to
verify that the comments above the message IDs correspond to the actual
messages.

No functional change.

(rillig)

2024-02-06 21:28:16 UTC MAIN commitmail json YAML

lint.7: remove implementation details from message list

From a user's perspective, it's irrelevant whether a lint message is
generated using '%s' or '%.*s'; same for the integer widths, as they are
platform-dependent.

(rillig)

2024-02-05 23:11:23 UTC MAIN commitmail json YAML

2024-02-04 10:03:10 UTC MAIN commitmail json YAML

2024-02-04 09:56:24 UTC MAIN commitmail json YAML

make: in parse-only mode, don't evaluate modifiers

Previously, the ':S', ':ts', ':tA' and ':from=to' modifiers were
evaluated in parse-only mode, unnecessarily.  This is only noticeable
when an indirect modifier is evaluated in parse-only mode, which is
another bug that will be fixed in a follow-up commit.

(rillig)