The NetBSD Project

CVS log for src/tests/usr.bin/xlint/lint1/Attic/msg_259.exp

[BACK] Up to [cvs.NetBSD.org] / src / tests / usr.bin / xlint / lint1

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.17, Fri Jun 17 20:23:59 2022 UTC (22 months ago) by rillig
Branch: MAIN
CVS Tags: HEAD
Changes since 1.16: +0 -0 lines
FILE REMOVED

tests/lint: remove .exp files, as they have become redundant

Now that each lint1 test lists all generated diagnostics as 'expect'
comments, the information from the .exp files is no longer needed.  The
only information that gets lost is the order of the diagnostics, which
is mostly relevant for paired messages like 'inconsistent definition' +
'previous definition was here'.

Revision 1.16 / (download) - annotate - [select for diffs], Thu Sep 2 17:55:27 2021 UTC (2 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.15: +24 -24 lines
Diff to previous 1.15 (colored)

lint: align tests for message 259, clarify its purpose

Revision 1.15 / (download) - annotate - [select for diffs], Thu Sep 2 17:29:19 2021 UTC (2 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.14: +23 -25 lines
Diff to previous 1.14 (colored)

lint: fix unintended warning for converting long long to signed char

Revision 1.14 / (download) - annotate - [select for diffs], Thu Sep 2 17:26:43 2021 UTC (2 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.13: +26 -24 lines
Diff to previous 1.13 (colored)

tests/lint: demonstrate unintended prototype warning for signed char

Revision 1.13 / (download) - annotate - [select for diffs], Tue Aug 31 19:26:23 2021 UTC (2 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.12: +24 -24 lines
Diff to previous 1.12 (colored)

tests/lint: add cross-references to message 297

The check for lossy integer conversions is already implemented, it's
just not activated in the default NetBSD build.

Revision 1.12 / (download) - annotate - [select for diffs], Tue Aug 31 18:59:26 2021 UTC (2 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.11: +13 -9 lines
Diff to previous 1.11 (colored)

tests/lint: add test for prototype conversions in C90

The purpose of warning 259 is to find function calls that differ in the
ABI.  The warning's original purpose was not to warn about lossy
conversions, that's just a side effect.

Warning 259 had been implemented before C99 was published, which is more
than 20 years ago.  In the meantime, almost all code has migrated to
using function prototypes.  With the default lint flags from NetBSD's
<sys.mk>, it would rather make sense to focus on lossy conversions now.

To prepare for potentially upcoming differences in lint's C90 and C99
modes, clone the test now as far as possible.  The test for C90 mode is
smaller than for C99 mode, since 'long long' was not available back
then.

Revision 1.11 / (download) - annotate - [select for diffs], Tue Aug 31 18:15:56 2021 UTC (2 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.10: +20 -6 lines
Diff to previous 1.10 (colored)

tests/lint: add missing test cases for integer conversions

While adding the missing test cases, I re-read the comments and
discarded several of them, since converting a signed value to an
unsigned type can be lossy as well, which warrants a warning.

Revision 1.10 / (download) - annotate - [select for diffs], Mon Aug 30 18:33:37 2021 UTC (2 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.9: +1 -0 lines
Diff to previous 1.9 (colored)

tests/lint: test passing sizeof(int) to parameter type 'unsigned int'

Seen in usr.sbin/inetd/inetd.c, which calls getnameinfo and passes
sizeof(buf).

Revision 1.9 / (download) - annotate - [select for diffs], Sat Aug 21 11:58:12 2021 UTC (2 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.8: +1 -0 lines
Diff to previous 1.8 (colored)

tests/lint: add more test cases for lossy integer conversion

Revision 1.8 / (download) - annotate - [select for diffs], Sat Aug 21 11:19:38 2021 UTC (2 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.7: +3 -0 lines
Diff to previous 1.7 (colored)

tests/lint: add tests for conversion from signed to unsigned

Revision 1.7 / (download) - annotate - [select for diffs], Sun Jul 4 17:32:24 2021 UTC (2 years, 9 months ago) by rillig
Branch: MAIN
Changes since 1.6: +1 -1 lines
Diff to previous 1.6 (colored)

tests/lint: align tests for argument conversion to each other

Revision 1.6 / (download) - annotate - [select for diffs], Tue Jun 29 09:19:17 2021 UTC (2 years, 9 months ago) by rillig
Branch: MAIN
Changes since 1.5: +1 -1 lines
Diff to previous 1.5 (colored)

tests/lint: add tests for ILP32 platforms

Previously, all tests for lint had to produce the exact same output, no
matter which platform they ran on.  This differs from practical needs
since lint is intended to produce different results depending on whether
the platform is ILP32 or LP64.

Examples for these are type conversions and the widths of the integer
types during lexical analysis.

Revision 1.5 / (download) - annotate - [select for diffs], Thu Feb 4 06:55:00 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
CVS Tags: cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Changes since 1.4: +1 -1 lines
Diff to previous 1.4 (colored)

lint: add back "due to prototype" to message 259

That message is only supposed to warn about compatibility to traditional
C, in case the function should ever be compiled without its prototype
being in effect.  All other type checks are supposed to be in another
function, as documented, but that type check misses to report a few
error-prone type combinations (long to char, long to int).

30 years after the introduction of prototypes with C90, almost all
existing code uses prototypes.  The warning has thus lost most of its
usefulness and can rather be confusing since a conversion from 'char' to
'long' is not problematic with prototypes in action, and the probability
of the code being backported to a pre-C90 compiler is diminishingly
small.

The words "due to prototype" now serve as a hint again.  The proper fix
could be to suppress this warning in C99 mode since that's far enough
from traditional C.

Revision 1.4 / (download) - annotate - [select for diffs], Sun Jan 31 14:05:00 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.3: +1 -1 lines
Diff to previous 1.3 (colored)

lint: reword message 259 about function argument conversion

The words "due to prototype" are an anachronism from the 1990s.
Nowadays every function is defined using a prototype, which makes these
words redundant.

Revision 1.3 / (download) - annotate - [select for diffs], Sun Jan 31 13:56:14 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.2: +1 -1 lines
Diff to previous 1.2 (colored)

lint: make warning about function argument conversion more detailed

For every conversion it is useful to know both the source and the target
type since these are not always obvious from the code.

The only surprise is the warning in d_gcc_extension.  The conversion
there is from 'double' to 'long double', which is a lossless conversion.
This may be a bug in lint.

Revision 1.2 / (download) - annotate - [select for diffs], Sat Jan 30 22:07:31 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.1: +1 -1 lines
Diff to previous 1.1 (colored)

lint: add test for message 259 about implicit conversions

Revision 1.1 / (download) - annotate - [select for diffs], Sat Jan 2 10:22:44 2021 UTC (3 years, 3 months ago) by rillig
Branch: MAIN

lint: add a test for each message produced by lint1

Having a test for each message ensures that upcoming refactorings don't
break the basic functionality.  Adding the tests will also discover
previously unknown bugs in lint.

The tests ensure that every lint message can actually be triggered, and
they demonstrate how to do so.  Having a separate file for each test
leaves enough space for documenting historical anecdotes, rationale or
edge cases, keeping them away from the source code.

The interesting details of this commit are in Makefile and
t_integration.sh.  All other files are just auto-generated.

When running the tests as part of ATF, they are packed together as a
single test case.  Conceptually, it would have been better to have each
test as a separate test case, but ATF quickly becomes very slow as soon
as a test program defines too many test cases, and 50 is already too
many.  The time complexity is O(n^2), not O(n) as one would expect.
It's the same problem as in tests/usr.bin/make, which has over 300 test
cases as well.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb <webmaster@jp.NetBSD.org>