History log of /src/usr.bin/xlint/lint1/err.c |
Revision | | Date | Author | Comments |
1.277 |
| 14-Sep-2025 |
rillig | lint: add more type details to several messages
In most expressions, the integer promotions are performed on the operands, making the actual type different from the "visible" type of an operand. To properly explain the situation, mention the type before the integer promotions in case it differs from the resulting type.
|
1.276 |
| 06-Sep-2025 |
rillig | lint: reword message for bit-shift in trad-C90 migration mode
Mentioning the type names gives a hint about why the behavior differs; the message only occurs when the type of the shift amount has higher rank than the type of the shifted value.
|
1.275 |
| 31-Aug-2025 |
rillig | lint: check for mismatches in snprintb conversions
Seen in sh3/dmacreg.h, SH3_DMAC_CHCR_BITS.
|
1.274 |
| 08-Jul-2025 |
rillig | lint: reword message about 'extra bits set to 0'
The word 'extra' in the previous wording was too unspecific to make sense of. In the reworded message, focus on the problem instead of mentioning only the effect.
|
1.273 |
| 07-Jul-2025 |
rillig | lint: remove message 207, making its message ID invalid
|
1.272 |
| 04-May-2025 |
rillig | lint: add more details to message about discarding qualifiers
The name of the function (or, if not available, its type) is useful in lines that contain more than one function call.
|
1.271 |
| 12-Apr-2025 |
rillig | lint: warn about constant assignment in operand to '&&' or '||'
Seen in bin/sh/redir.c:1084 for errno, which is fine.
Seen in usr.sbin/mopd/mopprobe/mopprobe.c:235, which looks suspicious but hasn't been touched since 1997.
|
1.270 |
| 12-Apr-2025 |
rillig | lint: reword messages that apply to traditional C
|
1.269 |
| 12-Apr-2025 |
rillig | lint: s/illegal/invalid/g
Lint does not provide legal advice.
|
1.268 |
| 10-Apr-2025 |
rillig | lint: remove warning for constant operand to '!'
|
1.267 |
| 07-Apr-2025 |
rillig | lint: remove warning about 'constant in conditional context'
This makes the '-X 161' option to lint invalid.
|
1.266 |
| 27-Feb-2025 |
rillig | lint: add details to message about conversion in 'case'
|
1.265 |
| 24-Feb-2025 |
rillig | lint: remove no-op variant of the unary '&' operator
Neither K&R 1978 nor any of the C standards mentions that &function or &array would be a no-op. This no-op behavior produced wrong warnings in sbin/gpt.
|
1.264 |
| 20-Feb-2025 |
rillig | lint: add detail to message about truncated constant
|
1.263 |
| 20-Feb-2025 |
rillig | lint: mention the assignment operator in 'illegal combination'
In source lines that contain both a 'return' statement as well as a function-like macro, such as the C11 atomics, seeing the word 'init' in the diagnostic helps to see that the type conflict is not in the 'return' statement but instead in some initializer.
Seen in userspace-rcu/wfcqueue.h:147.
|
1.262 |
| 03-Jan-2025 |
rillig | lint: add detail to message about obsolete identifier list
|
1.261 |
| 15-Dec-2024 |
rillig | lint: add details to message about possible precedence confusion
|
1.260 |
| 08-Dec-2024 |
rillig | lint: warn about do-while macros that end with a semicolon
|
1.259 |
| 01-Dec-2024 |
rillig | lint: warn about function definitions that still use identifier lists
|
1.258 |
| 30-Nov-2024 |
rillig | lint: add back optimization for non-query mode
The main point of the optimization is to skip the expensive calls to type_name when preparing the message details. This was not spelled out explicitly in the comment.
While here, fix the stray 'previous declaration' message that occurred whenever a function was first declared as 'static' and later defined without 'static', see query 16.
|
1.257 |
| 29-Nov-2024 |
rillig | lint: remove premature optimization for non-query scenarios
|
1.256 |
| 28-Nov-2024 |
rillig | lint: add queries for typedefs to struct/union and their pointers
As suggested in share/misc/style since 1.75 from August 2023.
These are queries instead of warnings as the number of false positives or historical practice is too high; these queries are only intended for detecting these typedefs on newly added types.
|
1.255 |
| 23-Nov-2024 |
rillig | lint: use separate message when discarding a qualifier in call
|
1.254 |
| 23-Nov-2024 |
rillig | lint: add details to messages about discarding qualifiers
The related message 153 is left as-is, as it is used in two places, and the second place is not only about discarded qualifiers.
|
1.253 |
| 13-Nov-2024 |
rillig | lint: add more details to 'statement not reached' message
In lib/libcompat/regexp/regexp.c, the FAIL macro expands to a compound statement containing a function call statement and a return statement, and the macro invocation is followed by a semicolon, forming an extra empty statement. Which of these statements is unreachable now becomes clear from the diagnostic, without having to inspect the preprocessed source code.
|
1.252 |
| 31-Oct-2024 |
rillig | lint: allow enum constant named 'N_*' to exceed the array index
Seen in libxcb.
While here, add the name of the enum constant to the message, to quickly decide whether the identifier is outside the range of expected enum values, thus marking the number of enum constants.
|
1.251 |
| 29-Oct-2024 |
rillig | lint: add details to message about too large integer constant
|
1.250 |
| 14-Oct-2024 |
rillig | lint: add more details to messages about hidden symbols
|
1.249 |
| 29-Sep-2024 |
rillig | lint: only skip assertion failure in fuzzing mode
Skipping the assertion message after seeing a syntax error in the parser was surprising, as there was no information about the assertion that failed.
|
1.248 |
| 28-Sep-2024 |
rillig | lint: reword warning about cast between unrelated pointer types
The phrase "may be troublesome" was too unspecific to be useful.
|
1.247 |
| 10-Jul-2024 |
rillig | lint: add warning for '!(var = constant)'
This catches expressions like 'ATF_CHECK(errno = ENOENT)', which was intended to use '==' instead of '='.
|
1.246 |
| 09-Jun-2024 |
rillig | branches: 1.246.2; lint: warn about lossy floating point constant to integer conversions
|
1.245 |
| 08-Jun-2024 |
rillig | lint: add details to warnings about negative constant to unsigned
|
1.244 |
| 12-May-2024 |
rillig | lint: add wrapper for <ctype.h> functions, for strict bool mode
When using the Clang preprocessor (with MKLLVM=yes), the preprocessor output does not indicate which tokens come from a system header and which tokens come from the user code. Lint's strict bool mode relies on this information to treat the character classification functions from <ctype.h> as if their return type were bool instead of int.
These wrapper functions are only used when their argument is indeed a 'char', but not when the argument might be 'EOF or representable as an unsigned char', such as when reading a byte from the input.
|
1.243 |
| 11-May-2024 |
rillig | lint: warn when comparing an integer to a floating point constant
|
1.242 |
| 09-May-2024 |
rillig | lint: add details to message about too many initializers
|
1.241 |
| 27-Apr-2024 |
rillig | lint: add query for conversion from void pointer to other pointer
|
1.240 |
| 12-Apr-2024 |
rillig | lint: in snprintb, warn about all escaped characters in descriptions
|
1.239 |
| 30-Mar-2024 |
rillig | lint: add query for implicit integer-to-floating conversion
|
1.238 |
| 30-Mar-2024 |
rillig | 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.
|
1.237 |
| 30-Mar-2024 |
rillig | lint: reword messages about array subscripts to sound more natural
|
1.236 |
| 29-Mar-2024 |
rillig | lint: fix wording of warning about bit-field initializer
|
1.235 |
| 28-Mar-2024 |
rillig | lint: clean up
|
1.234 |
| 27-Mar-2024 |
rillig | lint: don't use 'long' in diagnostics
The size of 'long' differs between 64-bit and 32-bit platforms. Eliminate this possible platform-dependency.
|
1.233 |
| 25-Mar-2024 |
rillig | lint: rename snprintb 'directives' to 'conversions'
This aligns the terminology with the snprintf function.
|
1.232 |
| 10-Mar-2024 |
rillig | lint: add details to the message about integer overflow
Having only the operator was too unspecific to be actionable, so add the actual numbers and the data type.
|
1.231 |
| 03-Mar-2024 |
rillig | 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).
|
1.230 |
| 03-Mar-2024 |
rillig | lint: fix warning about "empty" single-letter snprintb descriptions
|
1.229 |
| 03-Mar-2024 |
rillig | lint: check for unreachable bits and fields in snprintb formats
While here, clean up a few existing checks.
|
1.228 |
| 02-Mar-2024 |
rillig | lint: check snprintb formats for overlapping bits and fields
|
1.227 |
| 02-Mar-2024 |
rillig | lint: remove custom wrappers around <ctype.h> functions
|
1.226 |
| 01-Mar-2024 |
rillig | 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.
|
1.225 |
| 06-Feb-2024 |
rillig | 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.
|
1.224 |
| 03-Feb-2024 |
rillig | lint: warn about short octal escape followed by '8' or '9'
These mistakes is typically found in snprintb format directives but is probably a typo everywhere else as well.
|
1.223 |
| 20-Jan-2024 |
rillig | lint: add query for const automatic variables
|
1.222 |
| 07-Jan-2024 |
rillig | lint: allow querying for invisible characters in literals and constants
|
1.221 |
| 10-Dec-2023 |
rillig | lint: allow querying for 'static' followed by non-'static' declaration
|
1.220 |
| 03-Dec-2023 |
rillig | lint: in declarations, replace tab with space
Previously, in some cases, the keywords 'const' or 'struct' were followed by a tab, which doesn't make sense.
No functional change.
|
1.219 |
| 03-Dec-2023 |
rillig | lint: re-wrap comments
No functional change.
|
1.218 |
| 14-Sep-2023 |
rillig | lint: fix wording of diagnostics about 'C99 extension'
The term 'extension' means an extension to a C standard. C99 by itself is not an extension but a revision of the C standard.
|
1.217 |
| 26-Aug-2023 |
rillig | lint: make diagnostics about ANSI C more international
|
1.216 |
| 03-Aug-2023 |
rillig | lint: make '_Static_assert' only available in C11 or C23 mode
|
1.215 |
| 02-Aug-2023 |
rillig | lint: distinguish between arguments and parameters
|
1.214 |
| 29-Jul-2023 |
rillig | lint1: remove option -m
The list of lint messages is only needed for generating the manual page lint.7. Since 2022-07-06, that list is extracted from the source code instead of compiling and then running lint1.
|
1.213 |
| 21-Jul-2023 |
rillig | lint: reword message about non-constant initializer
|
1.212 |
| 13-Jul-2023 |
rillig | lint: indent copyright lines consistently
|
1.211 |
| 11-Jul-2023 |
rillig | lint: update wording in diagnostic for C99
|
1.210 |
| 10-Jul-2023 |
rillig | lint: when debugging the parser, write messages on stderr
This way, all messages (regular debug, yacc debug, lint diagnostics) occur in the correct order.
|
1.209 |
| 09-Jul-2023 |
rillig | lint: in the warning about ordered enums, mention the affected type
|
1.208 |
| 09-Jul-2023 |
rillig | lint: clean up wording in diagnostics
Use the term 'parameter' as defined in C99 3.15.
|
1.207 |
| 09-Jul-2023 |
rillig | lint: clean up the wording of a few diagnostics
|
1.206 |
| 09-Jul-2023 |
rillig | lint: remove redundant '#' after 'argument' in diagnostics
|
1.205 |
| 07-Jul-2023 |
rillig | lint: only skip 'unused' warnings after errors, not other warnings
Previously, in -w mode, any warning suppressed further 'unused' warnings, even though there was no need to do that. This can be seen in the test gcc_attribute_var.c, where only the last unused variable from a function was marked as unused, the others slipped through.
Fixed by counting the errors and the warnings separately and only combining them if actually desired.
|
1.204 |
| 02-Jul-2023 |
rillig | lint: add initial support for C23
Required by xsrc/external/mit/MesaLib.old, brw_eu_validate.c, which initializes a struct using empty braces: 'return (struct string){};'.
|
1.203 |
| 30-Jun-2023 |
rillig | lint: add query for assigning an integer 0 to a pointer
|
1.202 |
| 24-Jun-2023 |
rillig | lint: add query for comparing 'char' with plain integers
|
1.201 |
| 24-Jun-2023 |
rillig | lint: add query for redundant 'extern' in function declaration
|
1.200 |
| 22-Jun-2023 |
rillig | lint: add query for comma operator
|
1.199 |
| 09-Jun-2023 |
rillig | lint: miscellaneous clean-ups
No binary change, except for line numbers in assertions.
|
1.198 |
| 09-Jun-2023 |
rillig | lint: indent local variables consistently
No binary change.
|
1.197 |
| 03-Jun-2023 |
rillig | lint: add query for static variables in functions
This query allows finding hidden global variables, as an easier-to-read alternative to 'objdump -t'.
|
1.196 |
| 13-May-2023 |
rillig | lint: add query for chained assignments
|
1.195 |
| 25-Apr-2023 |
rillig | lint: reword message for missing declaration in header
Suggested by Christos.
|
1.194 |
| 23-Apr-2023 |
rillig | lint: be strict when parsing command line for excluded message IDs
Previously, lint accepted -X '1, 2, 3', while the manual page lists the IDs without spaces.
On 32-bit platforms, lint accepted -X -4294967295, and on 64-bit platforms, it accepted the corresponding larger numbers.
The code for parsing message IDs and query IDs conceptually does the same, but the implementations differed for no reason.
|
1.193 |
| 15-Apr-2023 |
rillig | lint: add query for parenthesized return value
|
1.192 |
| 31-Mar-2023 |
rillig | lint: allow querying for octal integer constants
|
1.191 |
| 28-Mar-2023 |
rillig | lint: warn about 'extern' declarations inside function bodies
https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
The previous attempt (message 351 about 'extern' declarations outside headers) did not cover the proposal from the tech-userlevel mailing list but instead warns about a different usage pattern of the 'extern' keyword.
|
1.190 |
| 28-Mar-2023 |
rillig | lint: warn about extern declarations outside headers
https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
|
1.189 |
| 22-Feb-2023 |
rillig | lint: fix confusing message about nonportable character constants
|
1.188 |
| 19-Feb-2023 |
rillig | lint: make basename simpler
There is no need to handle trailing slashes since lint only handles regular files in diagnostics, not directories. Furthermore, only the last '/' was ignored, but multiple trailing slashes would not.
|
1.187 |
| 18-Feb-2023 |
rillig | lint: remove unused internal_error
|
1.186 |
| 21-Jan-2023 |
rillig | lint: add support for the C11 type qualifier '_Atomic'
That keyword can be used as a type specifier as well, support for that will be added later.
|
1.185 |
| 08-Jan-2023 |
rillig | lint: improve error message for parsing query IDs
|
1.184 |
| 01-Oct-2022 |
rillig | lint: add hyphen to adjective 'old-style'
|
1.183 |
| 19-Aug-2022 |
rillig | lint: add more details to message about large bit-shifts
|
1.182 |
| 16-Jul-2022 |
rillig | lint: add more details to message about pointer alignment
The previous message 'may cause alignment problem' was not detailed enough to be actionable, it didn't give the necessary insight to why lint was complaining at all.
The new message 'increases alignment from 1 to 4' or 'from 2 to 8' describes the potentially problematic conversion, and together with the involved type names, it allows an informed decision about whether lint's warning is warranted or not.
In a typical NetBSD build, this warning is in the top 10. The number of these warnings depends on the architecture, it is typically between 800 and 1600.
|
1.181 |
| 05-Jul-2022 |
rillig | lint: add additional queries that are not enabled by default
In the last 18 months, several lint warnings have been made adjusted to allow common usage patterns. For example, lint no longer warns about a constant condition in the statement 'do { ... } while (false)' (message 161), as this pattern is well-known in statement-like macros, making it unlikely that the 'false' is a mistake. Another example is casts between unequal pointer types (message 247) for a few well-known patterns that are unlikely to be bugs.
Occasionally, it is useful to query the code for patterns or events that would not justify a warning. These patterns are modeled as predefined queries that can be selected individually, in addition to and independently of the existing warnings and errors.
New queries can be added as needed, in the same way as new warnings. Queries that are deemed no longer used can be deactivated in the same way as warnings that are no longer used.
As long as none of the queries is enabled, they produce a minimal overhead of querying a single global variable. Computations that are more expensive than a few machine instructions should be guarded by any_query_enabled.
https://mail-index.netbsd.org/source-changes-d/2022/06/28/msg013716.html
ok christos@
|
1.180 |
| 02-Jul-2022 |
rillig | lint: allow message IDs to be only specified in decimal
The message IDs are communicated in decimal everywhere, there's no point in passing '-X 0x00000084' instead of the clearer '-X 132'.
|
1.179 |
| 01-Jul-2022 |
rillig | lint: clean up suppression of warnings and errors
Since lint1.h 1.11 from 2001-12-13, lint1 had been a memory hog. While it used a bit set for keeping track of the message IDs of the suppressed messages, it only used the lower 4 bits of each 32-bit word, due to a missing CHAR_BIT in __NERRBITS.
As a quick hack, the bit set had 1024 entries, much more than the number of actual messages, which is currently at 350. This meant 674 bytes of wasted memory, plus the code size for the bit manipulations.
The only functional change is that the option '-X' now only accepts actually valid message IDs. Previously it had accepted all numbers from 0 to 1023.
|
1.178 |
| 01-Jul-2022 |
rillig | lint: move error handling code from main1.c to err.c
No functional change.
|
1.177 |
| 01-Jul-2022 |
rillig | lint: add quotes around operator in message 138, remove message 240
Message 138 doesn't occur in practice, it was the last one that was missing the quotes around the placeholder.
Message 240 was also missing the quotes, but it was not reachable. There was also no apparent benefit in warning about 'assignment of different structures' when the message about 'assignment type mismatch' serves the same purpose.
|
1.176 |
| 22-Jun-2022 |
rillig | lint: add quotes around placeholders for the remaining messages
Reword some of the messages slightly, exchanging brevity for clarity.
Message 138 is kept as-is, as it is not yet covered by any tests.
Message 240 is kep as-is, as it is unreachable.
|
1.175 |
| 21-Jun-2022 |
rillig | lint: add quotes and details to some more messages
|
1.174 |
| 20-Jun-2022 |
rillig | lint: remove redundant include
err.c doesn't use anything from <sys/types.h>, plus it is already included by "lint.h".
No binary change.
|
1.173 |
| 20-Jun-2022 |
rillig | lint: add quotes around several placeholders in messages
|
1.172 |
| 19-Jun-2022 |
rillig | lint: add quotes around placeholders in 4 messages
|
1.171 |
| 19-Jun-2022 |
rillig | tests/lint: add quotes around placeholders in a few messages
|
1.170 |
| 15-Jun-2022 |
rillig | lint: unexport lint's messages
There was only a single place where a message was used directly, instead of calling one of the several functions for this purpose.
|
1.169 |
| 11-Jun-2022 |
rillig | lint: add quotes around placeholders for a few more messages
|
1.168 |
| 11-Jun-2022 |
rillig | lint: add quotes around a few more placeholders in messages
|
1.167 |
| 31-May-2022 |
rillig | lint: prevent assertion failure after parse error from grammar
Instead of running into an assertion failure, the malformed input 'f=({;};}' now generates:
malformed.c(1): error: syntax error ';' [249] malformed.c(1): warning: ({ }) is a GCC extension [320] malformed.c(1): warning: ({ }) is a GCC extension [320] malformed.c(1): error: cannot recover from previous errors [224]
|
1.166 |
| 20-May-2022 |
rillig | lint: use __RCSID in lint mode as well
Since 1995-10-02, lint supports __asm statements and __asm modifiers.
No binary change.
|
1.165 |
| 12-May-2022 |
christos | gcc allows __alignof__(unary-expression)
|
1.164 |
| 30-Apr-2022 |
rillig | lint: inline macro 'sflag'
Mark all places where lint's C90 mode is stricter than its C99 mode.
Most of the situations in which lint produces only warnings instead of errors covered by the "Constraints" sections in the relevant standards. This doesn't prevent a specific compiler from accepting it though.
No functional change.
|
1.163 |
| 30-Apr-2022 |
rillig | lint: inline macro c11flag
No functional change.
|
1.162 |
| 16-Apr-2022 |
rillig | lint: migrate gflag to allow_gcc
No functional change.
|
1.161 |
| 16-Apr-2022 |
rillig | lint: for gnuism and c99ism, calculate severity
Calculating the severity as a simple sum removes the condition sequence 'a && !b, or else a || !b', which can quickly become a brain twister, especially when negations are involved.
No functional change.
|
1.160 |
| 16-Apr-2022 |
rillig | lint: model C language levels in a future-compatible way
The options -t, -s and -S are confusing because they are used inconsistently. The option -S enables C99 features, but when using it instead of -s, it also doesn't enable all checks required by C90 and later. Prepare fixing of these inconsistencies by replacing the flag variables with language levels that can be extended in a straight-forward way as new C standards arrive.
| option | allow_trad | allow_c90 | allow_c99 | allow_c11 | |--------|------------|-----------|-----------|-----------| | -t | x | - | - | - | | (none) | x | x | - | - | | -s | - | x | - | - | | -S | - | x | x | - | | -Ac11 | - | x | x | x |
Each usage of the old flag variables will be inspected and migrated individually, to clean up the subtle variations in the conditions and to provide a simpler model.
When lint was created in 1995, its focus was migrating traditional C code to C90 code. Lint does not help in migrating from C90 to C99 or from C99 to C11 since there are only few silent changes, and simply because nobody took the time to implement these migration aids. If necessary, such migration modes could be added separately.
There is a small functional change: when the option -s is combined with either -S or -Ac11, lint now only keeps the last of these options. Previously, these options could be combined, leading to a mixture of language levels, halfway between C90, C99 and C11. Especially combining traditional C with C11 doesn't make sense, but xlint currently allows it.
The 3 tests that accidentally specified multiple language levels have been adjusted to a single language level.
|
1.159 |
| 08-Apr-2022 |
rillig | lint: remove unused message 70, add some more tests
|
1.158 |
| 05-Apr-2022 |
rillig | lint: remove unused message 40
I had not been used since 1995, when lint was imported to NetBSD.
|
1.157 |
| 02-Apr-2022 |
rillig | lint: remove unreachable message 'compiler takes alignment of function'
|
1.156 |
| 02-Apr-2022 |
rillig | lint: try harder to recover after syntax errors
lint: assertion "false" failed in declarator_name at decl.c:1596 near msg_022.c:22
|
1.155 |
| 01-Apr-2022 |
rillig | lint: add type details to message about 'sizeof(function)'
The code in add_function is severely broken, it mixes up the return type of the function with the argument types. For now, at least show the guessed type in the diagnostic, to allow human readers quickly spot the bug.
Extend the test cases in decl_direct_abstract.c to show that the behavior differs unreasonably if the first parameter of the function is equal to its return type.
|
1.154 |
| 01-Apr-2022 |
rillig | lint: add details to message about illegal return type
|
1.153 |
| 27-Feb-2022 |
rillig | lint: C99 has been released, so refer to it by its proper name
|
1.152 |
| 07-Feb-2022 |
rillig | lint: reword message about bit-field in a union
There is nothing illegal about a bit-field in a union, it is allowed by C90, C99 and C11.
Fixes PR toolchain/53219.
|
1.151 |
| 22-Dec-2021 |
rillig | lint: use C90 instead of C89 when referring to the C standard
|
1.150 |
| 22-Dec-2021 |
rillig | lint: fix handling of initializations
The implementation from March 2021 added proper support for designators but didn't model the brace levels correctly. In particular, it could not handle additional braces or omitted braces. In such a case, lint skipped the remaining initializers from the initialization. Due to this, type errors in the remaining initializers went unnoticed. Another effect was that arrays of unknown size were wrongly reported as having size 0.
Both GCC and Clang recommend placing braces around each sub-type that is initialized, such as a struct, union or array. Postfix does not follow these recommendations, therefore lint had to be disabled in external/ibm-public/postfix/Makefile.inc. This commit fixes the bugs mentioned there.
|
1.149 |
| 21-Dec-2021 |
rillig | lint: reword message 187 about too long string literal for initializer
The previous message was imprecise in that it didn't distinguish between non-terminating and terminating null bytes.
|
1.148 |
| 04-Dec-2021 |
rillig | lint: add quotes around placeholders in message 123
|
1.147 |
| 30-Oct-2021 |
rillig | lint: warn if an enum name is used for mismatched array access
This helps to keep the enum definition and the straight-forward implementation of a to_string or name function in sync.
The test for message 241 had to be adjusted because of exactly this bug. That test defined a bit mask enum but accessed it like a value enum type.
|
1.146 |
| 09-Oct-2021 |
rillig | lint: add more details to warning about nonportable character comparison
Especially when macros are involved, this makes it easier to see that there is a real problem.
Seen in bin/sh/expand.c:273, where a plain char is compared to numbers larger than 127.
|
1.145 |
| 12-Sep-2021 |
rillig | lint: add more details to error about redeclaration
Message 27 is triggered by several conditions. The one triggered by register_vget in sbin/fsck_lfs/vnode.c needs more details than the others.
|
1.144 |
| 05-Sep-2021 |
rillig | lint: fix some more lint warnings
The only remaining warnings are in scan.c, which is a generated Flex scanner.
No functional change.
|
1.143 |
| 05-Sep-2021 |
rillig | lint.7: document removed messages
Having just an empty string as the message was confusing.
|
1.142 |
| 31-Aug-2021 |
rillig | lint: remove unused function for generic messages
The function message_at is still used, for information about previous occurrences of a symbol.
|
1.141 |
| 27-Aug-2021 |
rillig | lint: remove unused message about nonportable character escape
It has not been used since at least 2001.
|
1.140 |
| 27-Aug-2021 |
rillig | lint: remove unused message for struct without named members
Lint has not produced this message since the rewrite of the initializations in March 2021. Structures that consist of only unnamed bit-fields probably don't occur in practice.
|
1.139 |
| 23-Aug-2021 |
rillig | lint: add quotes around placeholder in message 141
|
1.138 |
| 22-Aug-2021 |
rillig | lint: use standard quotes in messages 203 and 271
|
1.137 |
| 16-Aug-2021 |
rillig | lint: add more details to message about redeclared tag
|
1.136 |
| 14-Aug-2021 |
rillig | lint: use standard quoting style for messages 124 and 184
|
1.135 |
| 09-Aug-2021 |
rillig | lint: warn about 'char * = strchr(const char *, int)'
Found in findcc.c, there are about 25 other instances of this incongruency in the whole source tree.
For more examples of functions from the C Standard Library that implicitly remove the 'const' qualifier from an argument, see the C++ include file 'cstring'.
|
1.134 |
| 03-Aug-2021 |
rillig | lint: union casts are only available as a GCC extension, not in C99
|
1.133 |
| 03-Aug-2021 |
rillig | lint: add quotes around placeholder in message 214
function '%s' expects to return value
|
1.132 |
| 31-Jul-2021 |
rillig | lint: clean up debug logging
The calls to debug_step, unlike printf, don't need a trailing newline.
Remove the debug_step0 macro and its relatives since lint already uses enough other features from C99 that it essentially requires this standard, which supports varargs macro arguments. Among these features are __func__ and printf("%zu").
In non-debug mode, do not evaluate the arguments of debug_step. Evaluating the arguments had caused an internal error when running the test op_shl_lp64. This is indeed a bug since initdecl should have initialized the type table for __uint128_t. This had been forgotten when support for __uint128_t was added in decl.c 1.69 from 2018-09-07.
No functional change.
|
1.131 |
| 25-Jul-2021 |
rillig | lint: add type information to message about invalid cast
This probably doesn't matter in practice since the compiler is supposed to catch this kind of error. Adding the type information mainly ensures that parsing abstract type names works as specified.
|
1.130 |
| 15-Jul-2021 |
rillig | lint: remove message 66 about missing semicolon in struct-declaration
|
1.129 |
| 13-Jul-2021 |
rillig | lint: fix wording of message for incomplete struct (2021-07-04)
A struct member is not an argument. In err.c 1.124 from 2021-07-04, the wording had been changed, without noticing that the message was used twice: once for an argument, once for a struct member.
|
1.128 |
| 11-Jul-2021 |
rillig | lint: add quotes around placeholders in message 23 and 232
|
1.127 |
| 10-Jul-2021 |
rillig | lint: flush stdout before an internal error
Previously, the internal error may have appeared too early in the output. Provoking internal errors and assertion failures is still easy, just run afl-fuzz for a few seconds.
|
1.126 |
| 05-Jul-2021 |
rillig | lint: rename message 340 to talk about "GCC extension", not "GNU"
|
1.125 |
| 04-Jul-2021 |
rillig | lint: align messages for invalid left operand of '.' or '->'
|
1.124 |
| 04-Jul-2021 |
rillig | lint: improve wording for incomplete struct or union
|
1.123 |
| 03-Jul-2021 |
rillig | lint: fix segmentation fault on malformed preprocessor output
# 0 "" # 0 ""2
Found using afl, does not happen in practice though since every C preprocessor generates balanced 'enter' (1) and 'leave' (2) events.
|
1.122 |
| 30-Jun-2021 |
rillig | lint: mention the name of an implicitly declared function
In the regular NetBSD builds, this happened in swab.c:65. That line contains __predict_false, which may or may not be a macro. In other cases, there may be more than one function call in a single line.
|
1.121 |
| 28-Jun-2021 |
rillig | lint: add type information to message 155 (type mismatch)
|
1.120 |
| 27-Jun-2021 |
rillig | lint: require C11 for _Generic
This does not have any effect in practice since the option -g (originally meant for GCC extensions to the C standards) implicitly allows all features from C11, since err.c 1.111 from 2021-04-14.
Since the default lint flags for NetBSD builds include the option -g, this allows all C11 features.
Currently it is not possible to say "allow GNU extensions but not C11".
|
1.119 |
| 16-May-2021 |
rillig | lint: add more specific warning for bit-field of type plain 'int'
Previously, declaring a bit-field of type plain 'int' resulted in this warning:
warning: nonportable bit-field type 'int' [34]
This warning was too unspecific to be actionable, and until yesterday it didn't even include the type. In order to allow this warning to be understood and properly fixed, describe the actual nonportability more precisely:
warning: bit-field of type plain 'int' has implementation-defined signedness [344]
|
1.118 |
| 16-May-2021 |
rillig | lint: add type information to unportable bit-field type
Seeing the message "unportable bit-field type 'int'" may sound strange at first, but that's a strict interpretation of the wording in C99 6.7.2.1p4, which requires that the bit-field type is "'_Bool', 'unsigned int' or 'signed int', or some other implementation-defined type".
The rationale for C99 6.7.2.1 explicitly lists plain 'int' among the allowed types for bit-fields, regardless of any additional implementation-defined types. This means that lint had interpreted this paragraph wrong, and it should be fixed to allow plain int as well.
|
1.117 |
| 16-May-2021 |
rillig | lint: add quotes to message 309 about constant conversion
|
1.116 |
| 18-Apr-2021 |
rillig | branches: 1.116.2; lint: pass pos_t via const pointer
Thanks for the suggestion, christos@.
|
1.115 |
| 18-Apr-2021 |
rillig | lint: rename parameter to diagnostic functions and macros
The first parameter is not just an arbitrary number, it's a message ID.
|
1.114 |
| 18-Apr-2021 |
rillig | lint: flip parameters in verror_at, vwarning_at, vmessage_at
The parameters are in the same order now as in the corresponding macros.
|
1.113 |
| 18-Apr-2021 |
rillig | lint: add error_at, warning_at, message_at
Right now there are several places in the code that use the global variable curr_pos for passing a parameter to the diagnostic functions. That's not what global variables are for.
Make it easy for the code to migrate to the parameter-passing style.
No functional change.
|
1.112 |
| 18-Apr-2021 |
rillig | lint: do not allow the diagnostics to be modified
|
1.111 |
| 14-Apr-2021 |
christos | gnu enables c11 extensions
|
1.110 |
| 14-Apr-2021 |
rillig | lint: add option to accept C11 features
The list of available letters for the command line options gets shorter and shorter. Most of the interesting letters are already used for some warning categories. Curiously, -A, -W and -E were all still available.
The option -A nicely matches the intention of the option, which is to allow a certain set of language features. To keep the option available for further extensions, define -Ac11 as the currently only valid option of that kind. This allows straight-forward extension for C17 and future language standards, as well as independent feature-sets. The options -W and -E may someday complement the -A option, using the allow/warn/error categories.
|
1.109 |
| 14-Apr-2021 |
rillig | lint: remove redundant condition in update_location
|
1.108 |
| 14-Apr-2021 |
rillig | lint: add support for C11-isms such as int[static 3]
|
1.107 |
| 14-Apr-2021 |
christos | support parsing c99's static class for array size expressions.
|
1.106 |
| 09-Apr-2021 |
rillig | lint: quote placeholders in messages for unused variables
|
1.105 |
| 09-Apr-2021 |
rillig | lint: clean up handling of preprocessing output lines
No functional change.
|
1.104 |
| 08-Apr-2021 |
rillig | lint: in code from included files, print stack trace
Previously, the standard NetBSD build generated several lint warnings in lhash.h from OpenSSL, without providing any hint as to which file actually included that header. In cases like these, lint now interprets the line number information in the preprocessor output from GCC to reconstruct the exact include path to the file in question.
The program check-expect.lua had to be rewritten almost completely since it assumed that all diagnostics would come from the main file. In all existing tests, this was true, but these tests did not cover all cases that occurred in practice. Now it records the complete location of the diagnostic instead of just the line number.
|
1.103 |
| 06-Apr-2021 |
rillig | lint: add details to warning about too large shift amount
The previous message 'shift greater than size of object' was too short to give reasonable hints, especially when the expressions involve typedefs or macros.
|
1.102 |
| 05-Apr-2021 |
rillig | lint: warn about for wrong type cast in argument to ctype.h functions
The argument to most of the functions from <ctype.h> "shall either be representable as an 'unsigned char' or shall equal the value of the macro EOF".
When confronted with the infamous warning 'array subscript has type char', there are enough programmers who don't know the background of that warning and thus fix it in a wrong way. Neither GCC nor Clang explain its warning to target these programmers.
Both GCC and Clang warn about 'array subscript has type char', but they ignore the other requirements of the <ctype.h> functions, even though these are in the C standard library.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94182 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95177 https://stackoverflow.com/a/60696378
|
1.101 |
| 02-Apr-2021 |
rillig | lint: reword message about constant argument to '!'
In the other messages, operators are typically written in their literal form as well. Using single quotes disambiguates them from normal punctuation.
|
1.100 |
| 02-Apr-2021 |
rillig | lint: add parentheses after sizeof, as required by share/misc/style
No functional change.
|
1.99 |
| 30-Mar-2021 |
rillig | lint: add type information for message about unknown member name
|
1.98 |
| 30-Mar-2021 |
rillig | lint: add type information to message 175
|
1.97 |
| 28-Mar-2021 |
rillig | lint: remove wrong warning about wrong initializer type
The following code is valid:
int valid = {{{ 3 }}};
C90 3.5.7 and C99 6.7.8 both say that the "initializer for a scalar shall be a single expression, optionally enclosed in braces". They don't put any upper bound on the amount of braces, not even in the "Translation limits" section.
|
1.96 |
| 27-Mar-2021 |
rillig | lint: rename LERROR to INTERNAL_ERROR
The '#ifndef' in tyname.c is meant to distinguish between lint1 and lint2, it is not meant to be defined from anywhere outside the lint code itself.
No functional change.
|
1.95 |
| 26-Mar-2021 |
rillig | lint: add quotes around placeholder in message about undefined variable
Before: error: expected undefined [99] After: error: 'expected' undefined [99]
Seen in external/mpl/bind, which for Clang defines in stdatomic.h: > #define atomic_exchange_explicit(obj, desired, order) \ > __c11_atomic_exchange_explicit(obj, expected, order) Note the mismatch between 'desired' and 'expected'.
|
1.94 |
| 26-Mar-2021 |
rillig | lint: improve output format for internal errors
The new format follows the common conventions for file locations and allows quick navigation in IDEs.
To trigger an internal error, it suffices to have 2 tokens in lint1's input, after preprocessing: 'void __pure'.
|
1.93 |
| 26-Mar-2021 |
rillig | lint: in malloc calls, use 'sizeof *ptr' instead of 'sizeof(type)'
No functional change.
|
1.92 |
| 22-Mar-2021 |
rillig | lint: use precise type information in message about type mismatch
While here, reword the message, avoiding operators and parentheses.
Since 2021-01-02, providing the precise type name is as easy as the broad type classification (just replace tspec_name with type_name), and it's definitely more useful to the human readers.
|
1.91 |
| 21-Mar-2021 |
rillig | lint: prefix error messages with 'error:'
This makes it easier to find these errors in the build logs.
|
1.90 |
| 21-Mar-2021 |
rillig | lint: remove redundant prototypes
No functional change.
|
1.89 |
| 20-Mar-2021 |
rillig | lint: properly name C99 in message about declaration after statement
Now that C99 has been released and published, there is no reason anymore to refer to it as C9X.
|
1.88 |
| 18-Mar-2021 |
rillig | lint: reword message about type mismatch in initialization
Using parentheses for quotes is unusual, furthermore the previous message didn't follow proper grammar rules, sacrificing clarity for brevity.
|
1.87 |
| 07-Mar-2021 |
rillig | lint: in strict C mode, warn about initialization with '[a ... b]'
https://gcc.gnu.org/onlinedocs/gcc/Case-Ranges.html
|
1.86 |
| 28-Feb-2021 |
rillig | lint: add type information to 'illegal bit-field type'
|
1.85 |
| 28-Feb-2021 |
rillig | lint: add type information for 'incompatible struct pointers'
|
1.84 |
| 28-Feb-2021 |
rillig | lint: add type information to enum type mismatch
|
1.83 |
| 28-Feb-2021 |
rillig | lint: make messages for incompatible pointers more specific
Message 153 didn't state obviously which of the pointer types was the one before conversion (or cast) and which was the resulting type.
Message 229 didn't have any type information at all.
|
1.82 |
| 28-Feb-2021 |
rillig | lint: add type information to 'possible pointer alignment problem [135]'
This warning occurs more than 7400 times in a regular NetBSD build, and without giving any type information, leaves the reader clueless about what the underlying issue might be. Add type information since that is a no-brainer to implement.
|
1.81 |
| 22-Feb-2021 |
rillig | lint: change spelling of initialisation to initialization
That's the wording from the ISO C99 standard.
|
1.80 |
| 21-Feb-2021 |
rillig | lint: add type information to message about enum mismatch
|
1.79 |
| 19-Feb-2021 |
rillig | lint: warn about mismatch in getopt handling
|
1.78 |
| 04-Feb-2021 |
rillig | 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.
|
1.77 |
| 31-Jan-2021 |
rillig | 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.
|
1.76 |
| 31-Jan-2021 |
rillig | 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.
|
1.75 |
| 31-Jan-2021 |
rillig | lint: mention the operator in messages about bit shifts
|
1.74 |
| 31-Jan-2021 |
rillig | lint: add quotes to messages 1 and 19
|
1.73 |
| 31-Jan-2021 |
rillig | lint: be more precise in message 003 "tag in argument list"
|
1.72 |
| 30-Jan-2021 |
rillig | lint: add type information to message 275
Before: cast discards 'const' from pointer target type After: cast discards 'const' from type 'pointer to const char'
Seen in sqlite3.c.
|
1.71 |
| 30-Jan-2021 |
rillig | lint: add type information to warning about troublesome casts
The previous warning text did not mention the actual types that are involved in the type conversion. These types can be hard to see from the source code as soon as macros are involved, and even in plain code, one would have to follow the declarations, which is an unnecessary burden. Lint already has all information about the involved types, so there is no reason for omitting this crucial information.
Seen in external/mit/lua/dist/src/lvm.c and several other files. Including the type information in the message immediately makes the message scarier.
Before: pointer casts may be troublesome After: pointer cast from 'pointer to struct TString' to 'pointer to union GCUnion' may be troublesome
|
1.70 |
| 30-Jan-2021 |
rillig | lint: remove message 189, add tests for a few other messages
Message 189 would have applied to traditional C and was supposed to detect assignments between struct and union types. The corresponding check had never been implemented though.
Traditional C has been superseded for 30 years now, therefore there is no point in adding this check retroactively.
|
1.69 |
| 17-Jan-2021 |
rillig | lint: add type information to message 126
|
1.68 |
| 17-Jan-2021 |
rillig | lint: rename local variables in lbasename
|
1.67 |
| 14-Jan-2021 |
rillig | lint: add type details to message for enum type mismatch
Before December 2020, it was cumbersome to add type information to a message since the caller had to explicitly allocate buffers for the type names. That's probably the reason why this crucial detail had been left out of the warning.
|
1.66 |
| 12-Jan-2021 |
rillig | lint: add new check for strict bool mode
In strict bool mode, bool is considered incompatible with all other scalar types, just as in Java, C#, Pascal.
The controlling expressions in if statements, while loops, for loops and the '?:' operator must be of type bool. The logical operators work on bool instead of int, the bitwise operators accept both integer and bool. The arithmetic operators don't accept bool.
Since <stdbool.h> implements bool using C preprocessor macros instead of predefining the identifiers "true" and "false", the integer constants 0 and 1 may be used in all contexts that require a bool expression. Except from these, no implicit conversion between bool and scalar types is allowed.
See usr.bin/tests/xlint/lint1/d_c99_bool_strict.c for more details.
The command line option -T has been chosen because all obvious choices (-b or -B for bool, -s or -S for strict) are already in use. The -T may stand for "types are checked strictly".
The default behavior of lint doesn't change. The strict bool check is purely optional.
An example program for strict bool mode is usr.bin/make, which has been using explicit comparisons such as p != NULL, ch != '\0' or n > 0 in most places for a long time now, even before the refactoring in 2020.
|
1.65 |
| 09-Jan-2021 |
rillig | lint: fix crash for error 108 (invalid type of unary operator)
|
1.64 |
| 03-Jan-2021 |
rillig | lint: in DEBUG mode, verify printf parameters for messages
Since several years GCC validates printf-style strings, and there is no reason not to let GCC do that work. This prevents bugs like the segmentation fault that was fixed in tree.c 1.109 from 2021-01-01.
By default, lint is compiled with DEBUG off, but it's easy enough to compile it in debug mode once in a while.
|
1.63 |
| 03-Jan-2021 |
rillig | lint: let gnuism and c99ism return void instead of int
The return value was only used in a single case. Duplicating the condition for printing a message is ok in that case, since it makes all other places in the code simpler.
The occasional "(void)" or "msg = " before the function call had hidden the calls from check-msgs.lua, which didn't check the message texts in such cases.
|
1.62 |
| 03-Jan-2021 |
rillig | lint: fix spelling of message 308
All other messages are lowercase as well.
|
1.61 |
| 03-Jan-2021 |
rillig | lint: add type information to message 124 "illegal pointer combination"
|
1.60 |
| 02-Jan-2021 |
rillig | lint: fix message 308 "Invalid type for _Complex"
Previously, lint aborted since it didn't expect tspec_name to be called with NOTSPEC, which at that point was the only possible value of dcs->d_cmod.
|
1.59 |
| 30-Dec-2020 |
rillig | lint: reduce verbosity of assertions
Having 2 lines of source code per assertion is too much, especially since most of this code is redundant anyway. Extract the common code and the additional negation into a simple function instead.
|
1.58 |
| 29-Dec-2020 |
rillig | lint: fix indentation and alignment that used space-tab
|
1.57 |
| 29-Dec-2020 |
rillig | lint: remove redundant parentheses around return value
|
1.56 |
| 28-Dec-2020 |
rillig | lint: spell check
|
1.55 |
| 28-Dec-2020 |
rillig | lint: sort includes
|
1.54 |
| 02-Jun-2020 |
christos | Fix return of alignof()
|
1.53 |
| 07-Sep-2018 |
christos | recognize int128
|
1.52 |
| 15-Jan-2018 |
christos | branches: 1.52.2; 1.52.4; fix indent
|
1.51 |
| 19-Aug-2016 |
christos | Add union casts.
|
1.50 |
| 18-Aug-2016 |
christos | anonymous members are C9X
|
1.49 |
| 14-Oct-2015 |
christos | more descriptive errors
|
1.48 |
| 29-Jul-2015 |
christos | Be more specific about the type errors
|
1.47 |
| 18-Feb-2014 |
christos | add __extension__ and typeof
|
1.46 |
| 19-Apr-2013 |
christos | Allow linted comments to take an argument that defines which error to suppress.
|
1.45 |
| 20-Apr-2012 |
christos | branches: 1.45.2; add __PRETTY_FUNCTION__
|
1.44 |
| 04-Oct-2011 |
christos | branches: 1.44.2; Handle c99 declarations in the middle of blocks.
|
1.43 |
| 02-Oct-2009 |
christos | understand __attribute__((__packed__)) and __packed.
|
1.42 |
| 02-May-2009 |
christos | Add __alignof__.
|
1.41 |
| 01-May-2009 |
christos | add variable declarations in for loops for c99
|
1.40 |
| 15-Apr-2009 |
christos | Lukemify (WARNS=4)
|
1.39 |
| 13-Apr-2009 |
christos | since we know the types, print what they are in error messages.
|
1.38 |
| 31-Jul-2008 |
christos | branches: 1.38.6; Add Picky flag; this produces more warnings: 1. long a; int i; a = i * i; suggests casting i to long, so that we gain precision in the multiplication. 2. warns about magnitude comparisons in enums. 3. warns about possible sign extension issues when integer types become widened.
|
1.37 |
| 25-Jul-2008 |
dsl | Add a check for 'continue' inside a 'do ... while (0)' loop. 'continue' has the same effect as 'break' - as that probably isn't what the writer had in mind!
|
1.36 |
| 27-Apr-2008 |
christos | branches: 1.36.2; print the types involved in an error.
|
1.35 |
| 27-Apr-2008 |
christos | reorder a couple of error messages.
|
1.34 |
| 26-Apr-2008 |
christos | fix "long double" type recognition which broke with the complex changes.
|
1.33 |
| 25-Apr-2008 |
christos | preliminary _Complex support. NB: Does not really understand type conversions between complex and doubles.
|
1.32 |
| 04-Mar-2008 |
christos | branches: 1.32.2; PR/38142: YAMAMOTO Takashi: lint -S complains on variable length arrays
|
1.31 |
| 23-Oct-2006 |
christos | branches: 1.31.8; 1.31.14; allow 0 sized structs in c9x
|
1.30 |
| 23-Oct-2006 |
christos | add zero sized array handling. It is a little too chatty now.
|
1.29 |
| 02-Jan-2005 |
christos | say from what type to what time we are converting.
|
1.28 |
| 03-Aug-2004 |
yamt | recognize C99 array initializer designators. PR/18896.
|
1.27 |
| 20-Jun-2004 |
jmc | Completely rework how tools/compat is done. Purge all uses/references to _NETBSD_SOURCE as this makes cross building from older/newer versions of NetBSD harder, not easier (and also makes the resulting tools 'different')
Wrap all required code with the inclusion of nbtool_config.h, attempt to only use POSIX code in all places (or when reasonable test w. configure and provide definitions: ala u_int, etc).
Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86 NetBSD current (x86 and amd64) and Solaris 9.
Fixes PR's: PR#17762 PR#25944
|
1.26 |
| 02-Nov-2002 |
perry | branches: 1.26.2; add a comment on c99ism noting that the logic might be wrong but we haven't yet decided on what combinations of -s and -S really are intended to mean yet.
|
1.25 |
| 02-Nov-2002 |
perry | add c99ism(), by analogy to gnuism(), for c99 construct (un)warnings
|
1.24 |
| 22-Oct-2002 |
christos | add support for ({}) gcc shit.
|
1.23 |
| 22-Oct-2002 |
christos | add C9X/GCC compound literal expressions.
|
1.22 |
| 22-Oct-2002 |
christos | add variable array dimension.
|
1.21 |
| 22-Oct-2002 |
christos | handle gcc __FUNCTION__ and C9X __func__
|
1.20 |
| 21-Oct-2002 |
christos | support for c99 style and gnu style structure and union named initializers.
|
1.19 |
| 13-Sep-2002 |
christos | Minimize diffs with my C99 capable version [this commit does not include C99 support.
- turn lerror() into a macro so that the filename and the line number of the error are printed before we abort. - recurse in type printing to provide the proper type name.
|
1.18 |
| 07-Mar-2002 |
tv | Rename `basename' as `lbasename' so as not to confuse with the libgen.h prototyped function of the same name.
|
1.17 |
| 31-Jan-2002 |
tv | Protect __RCSID and __COPYRIGHT from being invoked if not defined.
|
1.16 |
| 13-Dec-2001 |
augustss | Don't use fd_set to keep track of errors to ignore. Doing so relies on overriding FD_SETSIZE. Not overriding it makes it stomp all over memory (which caused the debug outputs we've seen lately). It used to work, but toolification of lint broke it.
|
1.15 |
| 28-May-2001 |
lukem | cleanup (prior to more adding more features): - convert to ANSI KNF - remove trailing whitespace - translate some comments from german into english
code compiles and runs clean, and tested by running "make lint" against xlint source using previous and this lint produces same results.
|
1.14 |
| 24-May-2001 |
lukem | support // comments if -g is given
|
1.13 |
| 24-Feb-2001 |
cgd | fix broken NetBSD RCS id tags
|
1.12 |
| 06-Jul-2000 |
christos | - support for -X flag - support for -m flag - print the error number in each message
|
1.11 |
| 27-Jul-1998 |
mycroft | Fix a recurring typo: comparision -> comparison.
|
1.10 |
| 22-Feb-1998 |
christos | WARNSify
|
1.9 |
| 03-Nov-1997 |
cgd | implement (hack in) symbol (function and variable) renaming, so that the function renaming tricks currently needed by libc can be tolerated by lint. This needs some cleanup, but it appears to work.
|
1.8 |
| 02-Oct-1995 |
jpo | branches: 1.8.4; removed some dubious warnings about conversion of constant operands of bitwise operators
|
1.7 |
| 02-Oct-1995 |
jpo | LINTED and CONSTCOND are now valid up to the next end of a global or local declaration/definition/statement. Originally they were valid on the current and next line, which made it hard to suppress warnings in constructs with more then one line.
LONGLONG can now be used to suppress errors or warnings in the next declaration, definition or statement.
|
1.6 |
| 02-Oct-1995 |
jpo | some minor bug fixes
|
1.5 |
| 02-Oct-1995 |
jpo | prototypes override old style function definitions this is a gnu extension to ansi c
|
1.4 |
| 02-Oct-1995 |
jpo | __{const,signed,volatile}{__,} added const, signed and volatile are disabled with -t
|
1.3 |
| 02-Oct-1995 |
jpo | added inline keywords "inline" is enabled by -g, "__inline" and "__inline__" are always available
|
1.2 |
| 03-Jul-1995 |
cgd | RCS id cleanup
|
1.1 |
| 03-Jul-1995 |
cgd | branches: 1.1.1; Initial revision
|
1.1.1.1 |
| 03-Jul-1995 |
cgd | lint(1) implementation, by Jochen Pohl. named 'xlint' for a similar reason to why 'install' is named 'xinstall'.
|
1.8.4.1 |
| 04-Nov-1997 |
thorpej | Pull up from trunk: make renaming work and other minor fixes.
|
1.26.2.1 |
| 22-Jun-2004 |
tron | Pull up revision 1.27 (requested by jmc in ticket #527): Completely rework how tools/compat is done. Purge all uses/references to _NETBSD_SOURCE as this makes cross building from older/newer versions of NetBSD harder, not easier (and also makes the resulting tools 'different') Wrap all required code with the inclusion of nbtool_config.h, attempt to only use POSIX code in all places (or when reasonable test w. configure and provide definitions: ala u_int, etc). Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86 NetBSD current (x86 and amd64) and Solaris 9. Fixes PR's: PR#17762 PR#25944
|
1.31.14.1 |
| 24-Mar-2008 |
keiichi | sync with head.
|
1.31.8.1 |
| 23-Mar-2008 |
matt | sync with HEAD
|
1.32.2.1 |
| 18-May-2008 |
yamt | sync with head.
|
1.36.2.1 |
| 18-Sep-2008 |
wrstuden | Sync with wrstuden-revivesa-base-2.
|
1.38.6.1 |
| 13-May-2009 |
jym | Sync with HEAD.
Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
|
1.44.2.2 |
| 22-May-2014 |
yamt | sync with head.
for a reference, the tree before this commit was tagged as yamt-pagecache-tag8.
this commit was splitted into small chunks to avoid a limitation of cvs. ("Protocol error: too many arguments")
|
1.44.2.1 |
| 23-May-2012 |
yamt | sync with head.
|
1.45.2.2 |
| 20-Aug-2014 |
tls | Rebase to HEAD as of a few days ago.
|
1.45.2.1 |
| 23-Jun-2013 |
tls | resync from head
|
1.52.4.1 |
| 10-Jun-2019 |
christos | Sync with HEAD
|
1.52.2.1 |
| 30-Sep-2018 |
pgoyette | Ssync with HEAD
|
1.116.2.1 |
| 31-May-2021 |
cjep | sync with head
|
1.246.2.1 |
| 02-Aug-2025 |
perseant | Sync with HEAD
|