Module Name:    src
Committed By:   rillig
Date:           Sat Mar 30 17:12:26 UTC 2024

Modified Files:
        src/tests/usr.bin/xlint/lint1: msg_168.c platform_ilp32_int.c
            platform_lp64.c queries.c
        src/usr.bin/xlint/lint1: err.c init.c tree.c

Log Message:
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.

To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/tests/usr.bin/xlint/lint1/msg_168.c
cvs rdiff -u -r1.7 -r1.8 src/tests/usr.bin/xlint/lint1/platform_ilp32_int.c
cvs rdiff -u -r1.13 -r1.14 src/tests/usr.bin/xlint/lint1/platform_lp64.c
cvs rdiff -u -r1.24 -r1.25 src/tests/usr.bin/xlint/lint1/queries.c
cvs rdiff -u -r1.237 -r1.238 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.267 -r1.268 src/usr.bin/xlint/lint1/init.c
cvs rdiff -u -r1.630 -r1.631 src/usr.bin/xlint/lint1/tree.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Reply via email to