CVS commit: src

"Roland Illig" <[email protected]>
Newsgroups gmane.os.netbsd.devel.cvs
Message-ID <[email protected]>
Module Name:	src
Committed By:	rillig
Date:		Fri Mar 27 21:44:08 UTC 2026

Modified Files:
	src/tests/usr.bin/xlint/lint1: check-expect.lua init_c99.c msg_259.c
	    msg_380.c msg_381.c
	src/usr.bin/xlint/lint1: err.c tree.c

Log Message:
lint: in case of lossy floating point conversions, print exact value

When running lint on sparc64 with target sparc64, some tests print
warnings in cases where they shouldn't.  To track down their cause,
print the exact floating point value in the message, in hexadecimal.

As the snprintf(3) manual page says, there are multiple equivalent
representations, so just match them using the placeholder "....." in the
"expect" comments.  In this particular case, the message is missing
completely, so the output of the failed test will reveal the actual
value.

The affected test cases are:
* msg_380.c:38, converting -9223372036854775809.0 to 'long long'
* msg_380.c:39, converting -9223372036854775808.0 to 'long long'
* msg_381.c:38, converting -9223372036854775809.0 to 'long long'
* msg_381.c:39, converting -9223372036854775808.0 to 'long long'


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/tests/usr.bin/xlint/lint1/check-expect.lua
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint1/init_c99.c
cvs rdiff -u -r1.25 -r1.26 src/tests/usr.bin/xlint/lint1/msg_259.c
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/msg_380.c \
    src/tests/usr.bin/xlint/lint1/msg_381.c
cvs rdiff -u -r1.280 -r1.281 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.704 -r1.705 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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.