Up to [cvs.NetBSD.org] / src / tests / usr.bin / xlint / lint1
Request diff between arbitrary revisions
Keyword substitution: kv
Default branch: MAIN
sync with head
tests/lint: make test d_gcc_extension platform-independent That test was intended to test the keywords '__extension__' and '__typeof'. The GCC builtin functions were just a side-effect. These built-in functions generated error messages on platforms such as amd64 where sizeof(long double) != sizeof(double), but not on others such as sparc. The current infrastructure for the lint tests cannot handle tests with platform-dependent outcome.
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.
lint: format tests in a common style The lint tests do not focus on the whitespace since that is the most boring part of code style. Therefore, format the tests to be readable by following share/misc/style as close as possible.
lint: add common header for all tests For those tests that didn't use GCC-style line markers such as "# 2", the line numbers of the diagnostics stay the same. This is purely conincidental. Before, the 3 lines came from lint's built-in definitions (see 'builtins' in main1.c), and line number counting continued as if nothing had happened, making the first line of the actual file line 4. These 3 built-in lines are now replaced with 3 lines of file header.
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.
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.
lint1: add forgotten tests