The NetBSD Project

CVS log for src/usr.bin/xlint/lint1/err.c

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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.240 / (download) - annotate - [select for diffs], Fri Apr 12 05:17:48 2024 UTC (4 days, 1 hour ago) by rillig
Branch: MAIN
CVS Tags: HEAD
Changes since 1.239: +3 -3 lines
Diff to previous 1.239 (colored) to selected 1.11 (colored)

lint: in snprintb, warn about all escaped characters in descriptions

Revision 1.239 / (download) - annotate - [select for diffs], Sat Mar 30 17:23:13 2024 UTC (2 weeks, 2 days ago) by rillig
Branch: MAIN
Changes since 1.238: +3 -2 lines
Diff to previous 1.238 (colored) to selected 1.11 (colored)

lint: add query for implicit integer-to-floating conversion

Revision 1.238 / (download) - annotate - [select for diffs], Sat Mar 30 17:12:26 2024 UTC (2 weeks, 2 days ago) by rillig
Branch: MAIN
Changes since 1.237: +3 -3 lines
Diff to previous 1.237 (colored) to selected 1.11 (colored)

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.

Revision 1.237 / (download) - annotate - [select for diffs], Sat Mar 30 16:47:44 2024 UTC (2 weeks, 2 days ago) by rillig
Branch: MAIN
Changes since 1.236: +4 -4 lines
Diff to previous 1.236 (colored) to selected 1.11 (colored)

lint: reword messages about array subscripts to sound more natural

Revision 1.236 / (download) - annotate - [select for diffs], Fri Mar 29 07:35:45 2024 UTC (2 weeks, 3 days ago) by rillig
Branch: MAIN
Changes since 1.235: +3 -3 lines
Diff to previous 1.235 (colored) to selected 1.11 (colored)

lint: fix wording of warning about bit-field initializer

Revision 1.235 / (download) - annotate - [select for diffs], Thu Mar 28 21:04:48 2024 UTC (2 weeks, 4 days ago) by rillig
Branch: MAIN
Changes since 1.234: +3 -3 lines
Diff to previous 1.234 (colored) to selected 1.11 (colored)

lint: clean up

Revision 1.234 / (download) - annotate - [select for diffs], Wed Mar 27 19:28:20 2024 UTC (2 weeks, 5 days ago) by rillig
Branch: MAIN
Changes since 1.233: +7 -7 lines
Diff to previous 1.233 (colored) to selected 1.11 (colored)

lint: don't use 'long' in diagnostics

The size of 'long' differs between 64-bit and 32-bit platforms.
Eliminate this possible platform-dependency.

Revision 1.233 / (download) - annotate - [select for diffs], Mon Mar 25 22:37:43 2024 UTC (3 weeks ago) by rillig
Branch: MAIN
Changes since 1.232: +6 -6 lines
Diff to previous 1.232 (colored) to selected 1.11 (colored)

lint: rename snprintb 'directives' to 'conversions'

This aligns the terminology with the snprintf function.

Revision 1.232 / (download) - annotate - [select for diffs], Sun Mar 10 19:45:14 2024 UTC (5 weeks, 1 day ago) by rillig
Branch: MAIN
Changes since 1.231: +3 -3 lines
Diff to previous 1.231 (colored) to selected 1.11 (colored)

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.

Revision 1.231 / (download) - annotate - [select for diffs], Sun Mar 3 13:09:22 2024 UTC (6 weeks, 1 day ago) by rillig
Branch: MAIN
Changes since 1.230: +5 -5 lines
Diff to previous 1.230 (colored) to selected 1.11 (colored)

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).

Revision 1.230 / (download) - annotate - [select for diffs], Sun Mar 3 10:27:18 2024 UTC (6 weeks, 1 day ago) by rillig
Branch: MAIN
Changes since 1.229: +3 -3 lines
Diff to previous 1.229 (colored) to selected 1.11 (colored)

lint: fix warning about "empty" single-letter snprintb descriptions

Revision 1.229 / (download) - annotate - [select for diffs], Sun Mar 3 00:50:41 2024 UTC (6 weeks, 2 days ago) by rillig
Branch: MAIN
Changes since 1.228: +6 -4 lines
Diff to previous 1.228 (colored) to selected 1.11 (colored)

lint: check for unreachable bits and fields in snprintb formats

While here, clean up a few existing checks.

Revision 1.228 / (download) - annotate - [select for diffs], Sat Mar 2 11:56:37 2024 UTC (6 weeks, 2 days ago) by rillig
Branch: MAIN
Changes since 1.227: +3 -2 lines
Diff to previous 1.227 (colored) to selected 1.11 (colored)

lint: check snprintb formats for overlapping bits and fields

Revision 1.227 / (download) - annotate - [select for diffs], Sat Mar 2 09:32:18 2024 UTC (6 weeks, 2 days ago) by rillig
Branch: MAIN
Changes since 1.226: +4 -4 lines
Diff to previous 1.226 (colored) to selected 1.11 (colored)

lint: remove custom wrappers around <ctype.h> functions

Revision 1.226 / (download) - annotate - [select for diffs], Fri Mar 1 19:39:28 2024 UTC (6 weeks, 3 days ago) by rillig
Branch: MAIN
Changes since 1.225: +21 -2 lines
Diff to previous 1.225 (colored) to selected 1.11 (colored)

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.

Revision 1.225 / (download) - annotate - [select for diffs], Tue Feb 6 22:47:21 2024 UTC (2 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.224: +377 -377 lines
Diff to previous 1.224 (colored) to selected 1.11 (colored)

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.

Revision 1.224 / (download) - annotate - [select for diffs], Sat Feb 3 20:10:10 2024 UTC (2 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.223: +3 -2 lines
Diff to previous 1.223 (colored) to selected 1.11 (colored)

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.

Revision 1.223 / (download) - annotate - [select for diffs], Sat Jan 20 10:02:31 2024 UTC (2 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.222: +3 -2 lines
Diff to previous 1.222 (colored) to selected 1.11 (colored)

lint: add query for const automatic variables

Revision 1.222 / (download) - annotate - [select for diffs], Sun Jan 7 18:42:37 2024 UTC (3 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.221: +3 -2 lines
Diff to previous 1.221 (colored) to selected 1.11 (colored)

lint: allow querying for invisible characters in literals and constants

Revision 1.221 / (download) - annotate - [select for diffs], Sun Dec 10 15:29:38 2023 UTC (4 months ago) by rillig
Branch: MAIN
Changes since 1.220: +4 -3 lines
Diff to previous 1.220 (colored) to selected 1.11 (colored)

lint: allow querying for 'static' followed by non-'static' declaration

Revision 1.220 / (download) - annotate - [select for diffs], Sun Dec 3 18:17:41 2023 UTC (4 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.219: +6 -6 lines
Diff to previous 1.219 (colored) to selected 1.11 (colored)

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.

Revision 1.219 / (download) - annotate - [select for diffs], Sun Dec 3 13:12:40 2023 UTC (4 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.218: +8 -8 lines
Diff to previous 1.218 (colored) to selected 1.11 (colored)

lint: re-wrap comments

No functional change.

Revision 1.218 / (download) - annotate - [select for diffs], Thu Sep 14 21:53:02 2023 UTC (7 months ago) by rillig
Branch: MAIN
Changes since 1.217: +5 -5 lines
Diff to previous 1.217 (colored) to selected 1.11 (colored)

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.

Revision 1.217 / (download) - annotate - [select for diffs], Sat Aug 26 10:43:53 2023 UTC (7 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.216: +14 -14 lines
Diff to previous 1.216 (colored) to selected 1.11 (colored)

lint: make diagnostics about ANSI C more international

Revision 1.216 / (download) - annotate - [select for diffs], Thu Aug 3 18:48:42 2023 UTC (8 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.215: +4 -2 lines
Diff to previous 1.215 (colored) to selected 1.11 (colored)

lint: make '_Static_assert' only available in C11 or C23 mode

Revision 1.215 / (download) - annotate - [select for diffs], Wed Aug 2 18:51:25 2023 UTC (8 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.214: +10 -10 lines
Diff to previous 1.214 (colored) to selected 1.11 (colored)

lint: distinguish between arguments and parameters

Revision 1.214 / (download) - annotate - [select for diffs], Sat Jul 29 10:45:00 2023 UTC (8 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.213: +2 -18 lines
Diff to previous 1.213 (colored) to selected 1.11 (colored)

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.

Revision 1.213 / (download) - annotate - [select for diffs], Fri Jul 21 06:02:07 2023 UTC (8 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.212: +3 -3 lines
Diff to previous 1.212 (colored) to selected 1.11 (colored)

lint: reword message about non-constant initializer

Revision 1.212 / (download) - annotate - [select for diffs], Thu Jul 13 08:40:38 2023 UTC (9 months ago) by rillig
Branch: MAIN
Changes since 1.211: +3 -3 lines
Diff to previous 1.211 (colored) to selected 1.11 (colored)

lint: indent copyright lines consistently

Revision 1.211 / (download) - annotate - [select for diffs], Tue Jul 11 20:54:23 2023 UTC (9 months ago) by rillig
Branch: MAIN
Changes since 1.210: +3 -3 lines
Diff to previous 1.210 (colored) to selected 1.11 (colored)

lint: update wording in diagnostic for C99

Revision 1.210 / (download) - annotate - [select for diffs], Mon Jul 10 19:58:47 2023 UTC (9 months ago) by rillig
Branch: MAIN
Changes since 1.209: +31 -24 lines
Diff to previous 1.209 (colored) to selected 1.11 (colored)

lint: when debugging the parser, write messages on stderr

This way, all messages (regular debug, yacc debug, lint diagnostics)
occur in the correct order.

Revision 1.209 / (download) - annotate - [select for diffs], Sun Jul 9 12:04:08 2023 UTC (9 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.208: +3 -3 lines
Diff to previous 1.208 (colored) to selected 1.11 (colored)

lint: in the warning about ordered enums, mention the affected type

Revision 1.208 / (download) - annotate - [select for diffs], Sun Jul 9 11:18:55 2023 UTC (9 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.207: +8 -8 lines
Diff to previous 1.207 (colored) to selected 1.11 (colored)

lint: clean up wording in diagnostics

Use the term 'parameter' as defined in C99 3.15.

Revision 1.207 / (download) - annotate - [select for diffs], Sun Jul 9 11:01:27 2023 UTC (9 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.206: +14 -14 lines
Diff to previous 1.206 (colored) to selected 1.11 (colored)

lint: clean up the wording of a few diagnostics

Revision 1.206 / (download) - annotate - [select for diffs], Sun Jul 9 10:42:07 2023 UTC (9 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.205: +4 -4 lines
Diff to previous 1.205 (colored) to selected 1.11 (colored)

lint: remove redundant '#' after 'argument' in diagnostics

Revision 1.205 / (download) - annotate - [select for diffs], Fri Jul 7 06:03:31 2023 UTC (9 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.204: +6 -7 lines
Diff to previous 1.204 (colored) to selected 1.11 (colored)

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.

Revision 1.204 / (download) - annotate - [select for diffs], Sun Jul 2 23:40:23 2023 UTC (9 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.203: +15 -2 lines
Diff to previous 1.203 (colored) to selected 1.11 (colored)

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){};'.

Revision 1.203 / (download) - annotate - [select for diffs], Fri Jun 30 08:45:22 2023 UTC (9 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.202: +3 -2 lines
Diff to previous 1.202 (colored) to selected 1.11 (colored)

lint: add query for assigning an integer 0 to a pointer

Revision 1.202 / (download) - annotate - [select for diffs], Sat Jun 24 08:11:12 2023 UTC (9 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.201: +3 -2 lines
Diff to previous 1.201 (colored) to selected 1.11 (colored)

lint: add query for comparing 'char' with plain integers

Revision 1.201 / (download) - annotate - [select for diffs], Sat Jun 24 06:55:34 2023 UTC (9 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.200: +3 -2 lines
Diff to previous 1.200 (colored) to selected 1.11 (colored)

lint: add query for redundant 'extern' in function declaration

Revision 1.200 / (download) - annotate - [select for diffs], Thu Jun 22 13:57:44 2023 UTC (9 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.199: +3 -2 lines
Diff to previous 1.199 (colored) to selected 1.11 (colored)

lint: add query for comma operator

Revision 1.199 / (download) - annotate - [select for diffs], Fri Jun 9 15:36:31 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.198: +4 -4 lines
Diff to previous 1.198 (colored) to selected 1.11 (colored)

lint: miscellaneous clean-ups

No binary change, except for line numbers in assertions.

Revision 1.198 / (download) - annotate - [select for diffs], Fri Jun 9 13:03:49 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.197: +12 -12 lines
Diff to previous 1.197 (colored) to selected 1.11 (colored)

lint: indent local variables consistently

No binary change.

Revision 1.197 / (download) - annotate - [select for diffs], Sat Jun 3 21:08:06 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.196: +3 -2 lines
Diff to previous 1.196 (colored) to selected 1.11 (colored)

lint: add query for static variables in functions

This query allows finding hidden global variables, as an easier-to-read
alternative to 'objdump -t'.

Revision 1.196 / (download) - annotate - [select for diffs], Sat May 13 20:55:44 2023 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.195: +3 -2 lines
Diff to previous 1.195 (colored) to selected 1.11 (colored)

lint: add query for chained assignments

Revision 1.195 / (download) - annotate - [select for diffs], Tue Apr 25 19:00:57 2023 UTC (11 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.194: +3 -3 lines
Diff to previous 1.194 (colored) to selected 1.11 (colored)

lint: reword message for missing declaration in header

Suggested by Christos.

Revision 1.194 / (download) - annotate - [select for diffs], Sun Apr 23 09:04:44 2023 UTC (11 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.193: +26 -23 lines
Diff to previous 1.193 (colored) to selected 1.11 (colored)

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.

Revision 1.193 / (download) - annotate - [select for diffs], Sat Apr 15 11:34:45 2023 UTC (12 months ago) by rillig
Branch: MAIN
Changes since 1.192: +3 -2 lines
Diff to previous 1.192 (colored) to selected 1.11 (colored)

lint: add query for parenthesized return value

Revision 1.192 / (download) - annotate - [select for diffs], Fri Mar 31 13:03:05 2023 UTC (12 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.191: +3 -2 lines
Diff to previous 1.191 (colored) to selected 1.11 (colored)

lint: allow querying for octal integer constants

Revision 1.191 / (download) - annotate - [select for diffs], Tue Mar 28 20:04:52 2023 UTC (12 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.190: +3 -2 lines
Diff to previous 1.190 (colored) to selected 1.11 (colored)

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.

Revision 1.190 / (download) - annotate - [select for diffs], Tue Mar 28 14:44:35 2023 UTC (12 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.189: +3 -2 lines
Diff to previous 1.189 (colored) to selected 1.11 (colored)

lint: warn about extern declarations outside headers

https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html

Revision 1.189 / (download) - annotate - [select for diffs], Wed Feb 22 22:30:40 2023 UTC (13 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.188: +3 -3 lines
Diff to previous 1.188 (colored) to selected 1.11 (colored)

lint: fix confusing message about nonportable character constants

Revision 1.188 / (download) - annotate - [select for diffs], Sun Feb 19 19:27:01 2023 UTC (13 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.187: +7 -11 lines
Diff to previous 1.187 (colored) to selected 1.11 (colored)

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.

Revision 1.187 / (download) - annotate - [select for diffs], Sat Feb 18 15:21:34 2023 UTC (13 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.186: +2 -20 lines
Diff to previous 1.186 (colored) to selected 1.11 (colored)

lint: remove unused internal_error

Revision 1.186 / (download) - annotate - [select for diffs], Sat Jan 21 13:07:22 2023 UTC (14 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.185: +3 -2 lines
Diff to previous 1.185 (colored) to selected 1.11 (colored)

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.

Revision 1.185 / (download) - annotate - [select for diffs], Sun Jan 8 17:54:03 2023 UTC (15 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.184: +3 -3 lines
Diff to previous 1.184 (colored) to selected 1.11 (colored)

lint: improve error message for parsing query IDs

Revision 1.184 / (download) - annotate - [select for diffs], Sat Oct 1 09:42:40 2022 UTC (18 months, 2 weeks ago) by rillig
Branch: MAIN
CVS Tags: netbsd-10-base, netbsd-10-0-RELEASE, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10
Changes since 1.183: +5 -5 lines
Diff to previous 1.183 (colored) to selected 1.11 (colored)

lint: add hyphen to adjective 'old-style'

Revision 1.183 / (download) - annotate - [select for diffs], Fri Aug 19 19:40:39 2022 UTC (19 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.182: +3 -3 lines
Diff to previous 1.182 (colored) to selected 1.11 (colored)

lint: add more details to message about large bit-shifts

Revision 1.182 / (download) - annotate - [select for diffs], Sat Jul 16 22:36:06 2022 UTC (21 months ago) by rillig
Branch: MAIN
Changes since 1.181: +3 -3 lines
Diff to previous 1.181 (colored) to selected 1.11 (colored)

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.

Revision 1.181 / (download) - annotate - [select for diffs], Tue Jul 5 22:50:41 2022 UTC (21 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.180: +56 -2 lines
Diff to previous 1.180 (colored) to selected 1.11 (colored)

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@

Revision 1.180 / (download) - annotate - [select for diffs], Sat Jul 2 11:17:54 2022 UTC (21 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.179: +3 -5 lines
Diff to previous 1.179 (colored) to selected 1.11 (colored)

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'.

Revision 1.179 / (download) - annotate - [select for diffs], Fri Jul 1 21:48:05 2022 UTC (21 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.178: +11 -28 lines
Diff to previous 1.178 (colored) to selected 1.11 (colored)

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.

Revision 1.178 / (download) - annotate - [select for diffs], Fri Jul 1 21:25:39 2022 UTC (21 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.177: +40 -3 lines
Diff to previous 1.177 (colored) to selected 1.11 (colored)

lint: move error handling code from main1.c to err.c

No functional change.

Revision 1.177 / (download) - annotate - [select for diffs], Fri Jul 1 20:53:13 2022 UTC (21 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.176: +4 -4 lines
Diff to previous 1.176 (colored) to selected 1.11 (colored)

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.

Revision 1.176 / (download) - annotate - [select for diffs], Wed Jun 22 19:23:17 2022 UTC (21 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.175: +37 -37 lines
Diff to previous 1.175 (colored) to selected 1.11 (colored)

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.

Revision 1.175 / (download) - annotate - [select for diffs], Tue Jun 21 21:18:30 2022 UTC (21 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.174: +11 -11 lines
Diff to previous 1.174 (colored) to selected 1.11 (colored)

lint: add quotes and details to some more messages

Revision 1.174 / (download) - annotate - [select for diffs], Mon Jun 20 21:26:44 2022 UTC (21 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.173: +2 -3 lines
Diff to previous 1.173 (colored) to selected 1.11 (colored)

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.

Revision 1.173 / (download) - annotate - [select for diffs], Mon Jun 20 21:13:35 2022 UTC (21 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.172: +19 -19 lines
Diff to previous 1.172 (colored) to selected 1.11 (colored)

lint: add quotes around several placeholders in messages

Revision 1.172 / (download) - annotate - [select for diffs], Sun Jun 19 12:14:33 2022 UTC (21 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.171: +6 -6 lines
Diff to previous 1.171 (colored) to selected 1.11 (colored)

lint: add quotes around placeholders in 4 messages

Revision 1.171 / (download) - annotate - [select for diffs], Sun Jun 19 11:50:42 2022 UTC (21 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.170: +7 -7 lines
Diff to previous 1.170 (colored) to selected 1.11 (colored)

tests/lint: add quotes around placeholders in a few messages

Revision 1.170 / (download) - annotate - [select for diffs], Wed Jun 15 18:06:51 2022 UTC (22 months ago) by rillig
Branch: MAIN
Changes since 1.169: +3 -3 lines
Diff to previous 1.169 (colored) to selected 1.11 (colored)

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.

Revision 1.169 / (download) - annotate - [select for diffs], Sat Jun 11 12:23:59 2022 UTC (22 months ago) by rillig
Branch: MAIN
Changes since 1.168: +7 -7 lines
Diff to previous 1.168 (colored) to selected 1.11 (colored)

lint: add quotes around placeholders for a few more messages

Revision 1.168 / (download) - annotate - [select for diffs], Sat Jun 11 11:52:13 2022 UTC (22 months ago) by rillig
Branch: MAIN
Changes since 1.167: +13 -13 lines
Diff to previous 1.167 (colored) to selected 1.11 (colored)

lint: add quotes around a few more placeholders in messages

Revision 1.167 / (download) - annotate - [select for diffs], Tue May 31 00:01:35 2022 UTC (22 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.166: +15 -2 lines
Diff to previous 1.166 (colored) to selected 1.11 (colored)

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]

Revision 1.166 / (download) - annotate - [select for diffs], Fri May 20 21:18:55 2022 UTC (22 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.165: +3 -3 lines
Diff to previous 1.165 (colored) to selected 1.11 (colored)

lint: use __RCSID in lint mode as well

Since 1995-10-02, lint supports __asm statements and __asm modifiers.

No binary change.

Revision 1.165 / (download) - annotate - [select for diffs], Thu May 12 17:31:30 2022 UTC (23 months ago) by christos
Branch: MAIN
Changes since 1.164: +3 -2 lines
Diff to previous 1.164 (colored) to selected 1.11 (colored)

gcc allows __alignof__(unary-expression)

Revision 1.164 / (download) - annotate - [select for diffs], Sat Apr 30 22:31:23 2022 UTC (23 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.163: +8 -4 lines
Diff to previous 1.163 (colored) to selected 1.11 (colored)

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.

Revision 1.163 / (download) - annotate - [select for diffs], Sat Apr 30 18:51:00 2022 UTC (23 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.162: +3 -3 lines
Diff to previous 1.162 (colored) to selected 1.11 (colored)

lint: inline macro c11flag

No functional change.

Revision 1.162 / (download) - annotate - [select for diffs], Sat Apr 16 19:18:17 2022 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.161: +6 -4 lines
Diff to previous 1.161 (colored) to selected 1.11 (colored)

lint: migrate gflag to allow_gcc

No functional change.

Revision 1.161 / (download) - annotate - [select for diffs], Sat Apr 16 15:55:10 2022 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.160: +8 -9 lines
Diff to previous 1.160 (colored) to selected 1.11 (colored)

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.

Revision 1.160 / (download) - annotate - [select for diffs], Sat Apr 16 13:25:27 2022 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.159: +2 -8 lines
Diff to previous 1.159 (colored) to selected 1.11 (colored)

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.

Revision 1.159 / (download) - annotate - [select for diffs], Fri Apr 8 21:29:29 2022 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.158: +3 -3 lines
Diff to previous 1.158 (colored) to selected 1.11 (colored)

lint: remove unused message 70, add some more tests

Revision 1.158 / (download) - annotate - [select for diffs], Tue Apr 5 23:13:56 2022 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.157: +3 -3 lines
Diff to previous 1.157 (colored) to selected 1.11 (colored)

lint: remove unused message 40

I had not been used since 1995, when lint was imported to NetBSD.

Revision 1.157 / (download) - annotate - [select for diffs], Sat Apr 2 21:47:04 2022 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.156: +3 -3 lines
Diff to previous 1.156 (colored) to selected 1.11 (colored)

lint: remove unreachable message 'compiler takes alignment of function'

Revision 1.156 / (download) - annotate - [select for diffs], Sat Apr 2 20:12:46 2022 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.155: +3 -2 lines
Diff to previous 1.155 (colored) to selected 1.11 (colored)

lint: try harder to recover after syntax errors

lint: assertion "false" failed in declarator_name at decl.c:1596
    near msg_022.c:22

Revision 1.155 / (download) - annotate - [select for diffs], Fri Apr 1 23:16:31 2022 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.154: +3 -3 lines
Diff to previous 1.154 (colored) to selected 1.11 (colored)

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.

Revision 1.154 / (download) - annotate - [select for diffs], Fri Apr 1 22:07:23 2022 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.153: +3 -3 lines
Diff to previous 1.153 (colored) to selected 1.11 (colored)

lint: add details to message about illegal return type

Revision 1.153 / (download) - annotate - [select for diffs], Sun Feb 27 11:40:29 2022 UTC (2 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.152: +8 -8 lines
Diff to previous 1.152 (colored) to selected 1.11 (colored)

lint: C99 has been released, so refer to it by its proper name

Revision 1.152 / (download) - annotate - [select for diffs], Mon Feb 7 02:44:49 2022 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.151: +3 -3 lines
Diff to previous 1.151 (colored) to selected 1.11 (colored)

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.

Revision 1.151 / (download) - annotate - [select for diffs], Wed Dec 22 14:25:35 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.150: +4 -4 lines
Diff to previous 1.150 (colored) to selected 1.11 (colored)

lint: use C90 instead of C89 when referring to the C standard

Revision 1.150 / (download) - annotate - [select for diffs], Wed Dec 22 00:45:53 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.149: +3 -3 lines
Diff to previous 1.149 (colored) to selected 1.11 (colored)

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.

Revision 1.149 / (download) - annotate - [select for diffs], Tue Dec 21 22:21:11 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.148: +3 -3 lines
Diff to previous 1.148 (colored) to selected 1.11 (colored)

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.

Revision 1.148 / (download) - annotate - [select for diffs], Sat Dec 4 00:01:24 2021 UTC (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.147: +3 -3 lines
Diff to previous 1.147 (colored) to selected 1.11 (colored)

lint: add quotes around placeholders in message 123

Revision 1.147 / (download) - annotate - [select for diffs], Sat Oct 30 22:04:42 2021 UTC (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.146: +3 -2 lines
Diff to previous 1.146 (colored) to selected 1.11 (colored)

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.

Revision 1.146 / (download) - annotate - [select for diffs], Sat Oct 9 21:56:12 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.145: +3 -3 lines
Diff to previous 1.145 (colored) to selected 1.11 (colored)

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.

Revision 1.145 / (download) - annotate - [select for diffs], Sun Sep 12 16:28:45 2021 UTC (2 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.144: +3 -2 lines
Diff to previous 1.144 (colored) to selected 1.11 (colored)

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.

Revision 1.144 / (download) - annotate - [select for diffs], Sun Sep 5 16:15:05 2021 UTC (2 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.143: +4 -4 lines
Diff to previous 1.143 (colored) to selected 1.11 (colored)

lint: fix some more lint warnings

The only remaining warnings are in scan.c, which is a generated Flex
scanner.

No functional change.

Revision 1.143 / (download) - annotate - [select for diffs], Sun Sep 5 13:19:39 2021 UTC (2 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.142: +8 -4 lines
Diff to previous 1.142 (colored) to selected 1.11 (colored)

lint.7: document removed messages

Having just an empty string as the message was confusing.

Revision 1.142 / (download) - annotate - [select for diffs], Tue Aug 31 17:51:30 2021 UTC (2 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.141: +2 -12 lines
Diff to previous 1.141 (colored) to selected 1.11 (colored)

lint: remove unused function for generic messages

The function message_at is still used, for information about previous
occurrences of a symbol.

Revision 1.141 / (download) - annotate - [select for diffs], Fri Aug 27 20:19:45 2021 UTC (2 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.140: +3 -3 lines
Diff to previous 1.140 (colored) to selected 1.11 (colored)

lint: remove unused message about nonportable character escape

It has not been used since at least 2001.

Revision 1.140 / (download) - annotate - [select for diffs], Fri Aug 27 19:50:44 2021 UTC (2 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.139: +3 -3 lines
Diff to previous 1.139 (colored) to selected 1.11 (colored)

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.

Revision 1.139 / (download) - annotate - [select for diffs], Mon Aug 23 06:50:01 2021 UTC (2 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.138: +3 -3 lines
Diff to previous 1.138 (colored) to selected 1.11 (colored)

lint: add quotes around placeholder in message 141

Revision 1.138 / (download) - annotate - [select for diffs], Sun Aug 22 13:52:19 2021 UTC (2 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.137: +4 -4 lines
Diff to previous 1.137 (colored) to selected 1.11 (colored)

lint: use standard quotes in messages 203 and 271

Revision 1.137 / (download) - annotate - [select for diffs], Mon Aug 16 06:49:56 2021 UTC (2 years, 8 months ago) by rillig
Branch: MAIN
Changes since 1.136: +3 -3 lines
Diff to previous 1.136 (colored) to selected 1.11 (colored)

lint: add more details to message about redeclared tag

Revision 1.136 / (download) - annotate - [select for diffs], Sat Aug 14 13:00:55 2021 UTC (2 years, 8 months ago) by rillig
Branch: MAIN
Changes since 1.135: +4 -4 lines
Diff to previous 1.135 (colored) to selected 1.11 (colored)

lint: use standard quoting style for messages 124 and 184

Revision 1.135 / (download) - annotate - [select for diffs], Mon Aug 9 20:07:23 2021 UTC (2 years, 8 months ago) by rillig
Branch: MAIN
Changes since 1.134: +3 -2 lines
Diff to previous 1.134 (colored) to selected 1.11 (colored)

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'.

Revision 1.134 / (download) - annotate - [select for diffs], Tue Aug 3 20:57:06 2021 UTC (2 years, 8 months ago) by rillig
Branch: MAIN
Changes since 1.133: +3 -3 lines
Diff to previous 1.133 (colored) to selected 1.11 (colored)

lint: union casts are only available as a GCC extension, not in C99

Revision 1.133 / (download) - annotate - [select for diffs], Tue Aug 3 18:44:33 2021 UTC (2 years, 8 months ago) by rillig
Branch: MAIN
Changes since 1.132: +3 -3 lines
Diff to previous 1.132 (colored) to selected 1.11 (colored)

lint: add quotes around placeholder in message 214

function '%s' expects to return value

Revision 1.132 / (download) - annotate - [select for diffs], Sat Jul 31 19:07:52 2021 UTC (2 years, 8 months ago) by rillig
Branch: MAIN
Changes since 1.131: +3 -5 lines
Diff to previous 1.131 (colored) to selected 1.11 (colored)

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.

Revision 1.131 / (download) - annotate - [select for diffs], Sun Jul 25 10:39:10 2021 UTC (2 years, 8 months ago) by rillig
Branch: MAIN
Changes since 1.130: +3 -3 lines
Diff to previous 1.130 (colored) to selected 1.11 (colored)

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.

Revision 1.130 / (download) - annotate - [select for diffs], Thu Jul 15 20:05:49 2021 UTC (2 years, 9 months ago) by rillig
Branch: MAIN
Changes since 1.129: +3 -3 lines
Diff to previous 1.129 (colored) to selected 1.11 (colored)

lint: remove message 66 about missing semicolon in struct-declaration

Revision 1.129 / (download) - annotate - [select for diffs], Tue Jul 13 22:01:34 2021 UTC (2 years, 9 months ago) by rillig
Branch: MAIN
Changes since 1.128: +3 -3 lines
Diff to previous 1.128 (colored) to selected 1.11 (colored)

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.

Revision 1.128 / (download) - annotate - [select for diffs], Sun Jul 11 19:30:56 2021 UTC (2 years, 9 months ago) by rillig
Branch: MAIN
Changes since 1.127: +4 -4 lines
Diff to previous 1.127 (colored) to selected 1.11 (colored)

lint: add quotes around placeholders in message 23 and 232

Revision 1.127 / (download) - annotate - [select for diffs], Sat Jul 10 12:17:31 2021 UTC (2 years, 9 months ago) by rillig
Branch: MAIN
Changes since 1.126: +4 -2 lines
Diff to previous 1.126 (colored) to selected 1.11 (colored)

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.

Revision 1.126 / (download) - annotate - [select for diffs], Mon Jul 5 19:53:43 2021 UTC (2 years, 9 months ago) by rillig
Branch: MAIN
Changes since 1.125: +3 -3 lines
Diff to previous 1.125 (colored) to selected 1.11 (colored)

lint: rename message 340 to talk about "GCC extension", not "GNU"

Revision 1.125 / (download) - annotate - [select for diffs], Sun Jul 4 17:01:58 2021 UTC (2 years, 9 months ago) by rillig
Branch: MAIN
Changes since 1.124: +4 -4 lines
Diff to previous 1.124 (colored) to selected 1.11 (colored)

lint: align messages for invalid left operand of '.' or '->'

Revision 1.124 / (download) - annotate - [select for diffs], Sun Jul 4 13:31:10 2021 UTC (2 years, 9 months ago) by rillig
Branch: MAIN
Changes since 1.123: +3 -3 lines
Diff to previous 1.123 (colored) to selected 1.11 (colored)

lint: improve wording for incomplete struct or union

Revision 1.123 / (download) - annotate - [select for diffs], Sat Jul 3 20:54:08 2021 UTC (2 years, 9 months ago) by rillig
Branch: MAIN
Changes since 1.122: +6 -4 lines
Diff to previous 1.122 (colored) to selected 1.11 (colored)

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.

Revision 1.122 / (download) - annotate - [select for diffs], Wed Jun 30 14:23:50 2021 UTC (2 years, 9 months ago) by rillig
Branch: MAIN
Changes since 1.121: +3 -3 lines
Diff to previous 1.121 (colored) to selected 1.11 (colored)

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.

Revision 1.121 / (download) - annotate - [select for diffs], Mon Jun 28 10:23:49 2021 UTC (2 years, 9 months ago) by rillig
Branch: MAIN
Changes since 1.120: +3 -3 lines
Diff to previous 1.120 (colored) to selected 1.11 (colored)

lint: add type information to message 155 (type mismatch)

Revision 1.120 / (download) - annotate - [select for diffs], Sun Jun 27 19:10:29 2021 UTC (2 years, 9 months ago) by rillig
Branch: MAIN
Changes since 1.119: +3 -2 lines
Diff to previous 1.119 (colored) to selected 1.11 (colored)

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".

Revision 1.116.2.1 / (download) - annotate - [select for diffs], Mon May 31 22:15:26 2021 UTC (2 years, 10 months ago) by cjep
Branch: cjep_staticlib_x
Changes since 1.116: +5 -4 lines
Diff to previous 1.116 (colored) next main 1.117 (colored) to selected 1.11 (colored)

sync with head

Revision 1.119 / (download) - annotate - [select for diffs], Sun May 16 11:11:36 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
CVS Tags: cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1
Changes since 1.118: +3 -2 lines
Diff to previous 1.118 (colored) to selected 1.11 (colored)

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]

Revision 1.118 / (download) - annotate - [select for diffs], Sun May 16 10:34:19 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.117: +3 -3 lines
Diff to previous 1.117 (colored) to selected 1.11 (colored)

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.

Revision 1.117 / (download) - annotate - [select for diffs], Sun May 16 10:18:24 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.116: +3 -3 lines
Diff to previous 1.116 (colored) to selected 1.11 (colored)

lint: add quotes to message 309 about constant conversion

Revision 1.116 / (download) - annotate - [select for diffs], Sun Apr 18 17:36:18 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
CVS Tags: cjep_staticlib_x-base
Branch point for: cjep_staticlib_x
Changes since 1.115: +22 -22 lines
Diff to previous 1.115 (colored) to selected 1.11 (colored)

lint: pass pos_t via const pointer

Thanks for the suggestion, christos@.

Revision 1.115 / (download) - annotate - [select for diffs], Sun Apr 18 10:09:49 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.114: +42 -42 lines
Diff to previous 1.114 (colored) to selected 1.11 (colored)

lint: rename parameter to diagnostic functions and macros

The first parameter is not just an arbitrary number, it's a message ID.

Revision 1.114 / (download) - annotate - [select for diffs], Sun Apr 18 10:02:16 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.113: +13 -13 lines
Diff to previous 1.113 (colored) to selected 1.11 (colored)

lint: flip parameters in verror_at, vwarning_at, vmessage_at

The parameters are in the same order now as in the corresponding macros.

Revision 1.113 / (download) - annotate - [select for diffs], Sun Apr 18 08:52:04 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.112: +61 -24 lines
Diff to previous 1.112 (colored) to selected 1.11 (colored)

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.

Revision 1.112 / (download) - annotate - [select for diffs], Sun Apr 18 08:07:04 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.111: +3 -3 lines
Diff to previous 1.111 (colored) to selected 1.11 (colored)

lint: do not allow the diagnostics to be modified

Revision 1.111 / (download) - annotate - [select for diffs], Wed Apr 14 21:20:02 2021 UTC (3 years ago) by christos
Branch: MAIN
Changes since 1.110: +3 -3 lines
Diff to previous 1.110 (colored) to selected 1.11 (colored)

gnu enables c11 extensions

Revision 1.110 / (download) - annotate - [select for diffs], Wed Apr 14 20:06:40 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.109: +5 -9 lines
Diff to previous 1.109 (colored) to selected 1.11 (colored)

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.

Revision 1.109 / (download) - annotate - [select for diffs], Wed Apr 14 18:38:06 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.108: +3 -3 lines
Diff to previous 1.108 (colored) to selected 1.11 (colored)

lint: remove redundant condition in update_location

Revision 1.108 / (download) - annotate - [select for diffs], Wed Apr 14 18:35:40 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.107: +19 -3 lines
Diff to previous 1.107 (colored) to selected 1.11 (colored)

lint: add support for C11-isms such as int[static 3]

Revision 1.107 / (download) - annotate - [select for diffs], Wed Apr 14 13:34:08 2021 UTC (3 years ago) by christos
Branch: MAIN
Changes since 1.106: +3 -2 lines
Diff to previous 1.106 (colored) to selected 1.11 (colored)

support parsing c99's static class for array size expressions.

Revision 1.106 / (download) - annotate - [select for diffs], Fri Apr 9 20:12:00 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.105: +5 -5 lines
Diff to previous 1.105 (colored) to selected 1.11 (colored)

lint: quote placeholders in messages for unused variables

Revision 1.105 / (download) - annotate - [select for diffs], Fri Apr 9 15:58:43 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.104: +9 -7 lines
Diff to previous 1.104 (colored) to selected 1.11 (colored)

lint: clean up handling of preprocessing output lines

No functional change.

Revision 1.104 / (download) - annotate - [select for diffs], Thu Apr 8 22:18:27 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.103: +54 -2 lines
Diff to previous 1.103 (colored) to selected 1.11 (colored)

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.

Revision 1.103 / (download) - annotate - [select for diffs], Tue Apr 6 21:32:57 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.102: +3 -3 lines
Diff to previous 1.102 (colored) to selected 1.11 (colored)

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.

Revision 1.102 / (download) - annotate - [select for diffs], Mon Apr 5 02:05:47 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.101: +4 -2 lines
Diff to previous 1.101 (colored) to selected 1.11 (colored)

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

Revision 1.101 / (download) - annotate - [select for diffs], Fri Apr 2 22:41:53 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.100: +3 -3 lines
Diff to previous 1.100 (colored) to selected 1.11 (colored)

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.

Revision 1.100 / (download) - annotate - [select for diffs], Fri Apr 2 12:16:50 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.99: +3 -3 lines
Diff to previous 1.99 (colored) to selected 1.11 (colored)

lint: add parentheses after sizeof, as required by share/misc/style

No functional change.

Revision 1.99 / (download) - annotate - [select for diffs], Tue Mar 30 15:18:19 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.98: +3 -3 lines
Diff to previous 1.98 (colored) to selected 1.11 (colored)

lint: add type information for message about unknown member name

Revision 1.98 / (download) - annotate - [select for diffs], Tue Mar 30 15:07:53 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.97: +3 -3 lines
Diff to previous 1.97 (colored) to selected 1.11 (colored)

lint: add type information to message 175

Revision 1.97 / (download) - annotate - [select for diffs], Sun Mar 28 14:01:49 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.96: +3 -3 lines
Diff to previous 1.96 (colored) to selected 1.11 (colored)

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.

Revision 1.96 / (download) - annotate - [select for diffs], Sat Mar 27 12:42:22 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.95: +3 -3 lines
Diff to previous 1.95 (colored) to selected 1.11 (colored)

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.

Revision 1.95 / (download) - annotate - [select for diffs], Fri Mar 26 23:17:33 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.94: +3 -3 lines
Diff to previous 1.94 (colored) to selected 1.11 (colored)

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'.

Revision 1.94 / (download) - annotate - [select for diffs], Fri Mar 26 21:05:27 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.93: +6 -6 lines
Diff to previous 1.93 (colored) to selected 1.11 (colored)

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'.

Revision 1.93 / (download) - annotate - [select for diffs], Fri Mar 26 20:31:07 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.92: +3 -3 lines
Diff to previous 1.92 (colored) to selected 1.11 (colored)

lint: in malloc calls, use 'sizeof *ptr' instead of 'sizeof(type)'

No functional change.

Revision 1.92 / (download) - annotate - [select for diffs], Mon Mar 22 15:29:43 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.91: +3 -3 lines
Diff to previous 1.91 (colored) to selected 1.11 (colored)

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.

Revision 1.91 / (download) - annotate - [select for diffs], Sun Mar 21 20:44:59 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.90: +3 -3 lines
Diff to previous 1.90 (colored) to selected 1.11 (colored)

lint: prefix error messages with 'error:'

This makes it easier to find these errors in the build logs.

Revision 1.90 / (download) - annotate - [select for diffs], Sun Mar 21 20:30:19 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.89: +2 -7 lines
Diff to previous 1.89 (colored) to selected 1.11 (colored)

lint: remove redundant prototypes

No functional change.

Revision 1.89 / (download) - annotate - [select for diffs], Sat Mar 20 14:17:56 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.88: +3 -3 lines
Diff to previous 1.88 (colored) to selected 1.11 (colored)

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.

Revision 1.88 / (download) - annotate - [select for diffs], Thu Mar 18 21:26:56 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.87: +3 -3 lines
Diff to previous 1.87 (colored) to selected 1.11 (colored)

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.

Revision 1.87 / (download) - annotate - [select for diffs], Sun Mar 7 19:42:54 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.86: +3 -2 lines
Diff to previous 1.86 (colored) to selected 1.11 (colored)

lint: in strict C mode, warn about initialization with '[a ... b]'

https://gcc.gnu.org/onlinedocs/gcc/Case-Ranges.html

Revision 1.86 / (download) - annotate - [select for diffs], Sun Feb 28 02:45:37 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.85: +3 -3 lines
Diff to previous 1.85 (colored) to selected 1.11 (colored)

lint: add type information to 'illegal bit-field type'

Revision 1.85 / (download) - annotate - [select for diffs], Sun Feb 28 02:00:05 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.84: +3 -3 lines
Diff to previous 1.84 (colored) to selected 1.11 (colored)

lint: add type information for 'incompatible struct pointers'

Revision 1.84 / (download) - annotate - [select for diffs], Sun Feb 28 01:30:22 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.83: +3 -3 lines
Diff to previous 1.83 (colored) to selected 1.11 (colored)

lint: add type information to enum type mismatch

Revision 1.83 / (download) - annotate - [select for diffs], Sun Feb 28 01:06:57 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.82: +4 -4 lines
Diff to previous 1.82 (colored) to selected 1.11 (colored)

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.

Revision 1.82 / (download) - annotate - [select for diffs], Sun Feb 28 00:40:22 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.81: +3 -3 lines
Diff to previous 1.81 (colored) to selected 1.11 (colored)

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.

Revision 1.81 / (download) - annotate - [select for diffs], Mon Feb 22 15:09:50 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.80: +9 -9 lines
Diff to previous 1.80 (colored) to selected 1.11 (colored)

lint: change spelling of initialisation to initialization

That's the wording from the ISO C99 standard.

Revision 1.80 / (download) - annotate - [select for diffs], Sun Feb 21 10:28:33 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.79: +3 -3 lines
Diff to previous 1.79 (colored) to selected 1.11 (colored)

lint: add type information to message about enum mismatch

Revision 1.79 / (download) - annotate - [select for diffs], Fri Feb 19 12:28:56 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.78: +4 -2 lines
Diff to previous 1.78 (colored) to selected 1.11 (colored)

lint: warn about mismatch in getopt handling

Revision 1.78 / (download) - annotate - [select for diffs], Thu Feb 4 06:54:59 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.77: +3 -3 lines
Diff to previous 1.77 (colored) to selected 1.11 (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.77 / (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.76: +3 -3 lines
Diff to previous 1.76 (colored) to selected 1.11 (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.76 / (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.75: +3 -3 lines
Diff to previous 1.75 (colored) to selected 1.11 (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.75 / (download) - annotate - [select for diffs], Sun Jan 31 11:44:48 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.74: +4 -4 lines
Diff to previous 1.74 (colored) to selected 1.11 (colored)

lint: mention the operator in messages about bit shifts

Revision 1.74 / (download) - annotate - [select for diffs], Sun Jan 31 11:23:01 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.73: +4 -4 lines
Diff to previous 1.73 (colored) to selected 1.11 (colored)

lint: add quotes to messages 1 and 19

Revision 1.73 / (download) - annotate - [select for diffs], Sun Jan 31 09:26:27 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.72: +3 -3 lines
Diff to previous 1.72 (colored) to selected 1.11 (colored)

lint: be more precise in message 003 "tag in argument list"

Revision 1.72 / (download) - annotate - [select for diffs], Sat Jan 30 21:58:04 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.71: +3 -3 lines
Diff to previous 1.71 (colored) to selected 1.11 (colored)

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.

Revision 1.71 / (download) - annotate - [select for diffs], Sat Jan 30 21:49:08 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.70: +3 -3 lines
Diff to previous 1.70 (colored) to selected 1.11 (colored)

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

Revision 1.70 / (download) - annotate - [select for diffs], Sat Jan 30 17:56:29 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.69: +3 -3 lines
Diff to previous 1.69 (colored) to selected 1.11 (colored)

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.

Revision 1.69 / (download) - annotate - [select for diffs], Sun Jan 17 17:14:34 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.68: +3 -3 lines
Diff to previous 1.68 (colored) to selected 1.11 (colored)

lint: add type information to message 126

Revision 1.68 / (download) - annotate - [select for diffs], Sun Jan 17 11:55:55 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.67: +9 -9 lines
Diff to previous 1.67 (colored) to selected 1.11 (colored)

lint: rename local variables in lbasename

Revision 1.67 / (download) - annotate - [select for diffs], Thu Jan 14 07:42:31 2021 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.66: +3 -3 lines
Diff to previous 1.66 (colored) to selected 1.11 (colored)

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.

Revision 1.66 / (download) - annotate - [select for diffs], Tue Jan 12 20:42:01 2021 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.65: +10 -2 lines
Diff to previous 1.65 (colored) to selected 1.11 (colored)

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.

Revision 1.65 / (download) - annotate - [select for diffs], Sat Jan 9 17:21:33 2021 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.64: +3 -3 lines
Diff to previous 1.64 (colored) to selected 1.11 (colored)

lint: fix crash for error 108 (invalid type of unary operator)

Revision 1.64 / (download) - annotate - [select for diffs], Sun Jan 3 18:48:37 2021 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.63: +7 -7 lines
Diff to previous 1.63 (colored) to selected 1.11 (colored)

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.

Revision 1.63 / (download) - annotate - [select for diffs], Sun Jan 3 17:42:45 2021 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.62: +8 -21 lines
Diff to previous 1.62 (colored) to selected 1.11 (colored)

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.

Revision 1.62 / (download) - annotate - [select for diffs], Sun Jan 3 16:59:59 2021 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.61: +3 -3 lines
Diff to previous 1.61 (colored) to selected 1.11 (colored)

lint: fix spelling of message 308

All other messages are lowercase as well.

Revision 1.61 / (download) - annotate - [select for diffs], Sun Jan 3 15:51:16 2021 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.60: +3 -3 lines
Diff to previous 1.60 (colored) to selected 1.11 (colored)

lint: add type information to message 124 "illegal pointer combination"

Revision 1.60 / (download) - annotate - [select for diffs], Sat Jan 2 17:17:00 2021 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.59: +3 -3 lines
Diff to previous 1.59 (colored) to selected 1.11 (colored)

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.

Revision 1.59 / (download) - annotate - [select for diffs], Wed Dec 30 01:33:30 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.58: +14 -2 lines
Diff to previous 1.58 (colored) to selected 1.11 (colored)

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.

Revision 1.58 / (download) - annotate - [select for diffs], Tue Dec 29 12:18:42 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.57: +7 -7 lines
Diff to previous 1.57 (colored) to selected 1.11 (colored)

lint: fix indentation and alignment that used space-tab

Revision 1.57 / (download) - annotate - [select for diffs], Tue Dec 29 11:35:11 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.56: +6 -6 lines
Diff to previous 1.56 (colored) to selected 1.11 (colored)

lint: remove redundant parentheses around return value

Revision 1.56 / (download) - annotate - [select for diffs], Mon Dec 28 21:24:55 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.55: +4 -4 lines
Diff to previous 1.55 (colored) to selected 1.11 (colored)

lint: spell check

Revision 1.55 / (download) - annotate - [select for diffs], Mon Dec 28 19:07:43 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.54: +3 -3 lines
Diff to previous 1.54 (colored) to selected 1.11 (colored)

lint: sort includes

Revision 1.54 / (download) - annotate - [select for diffs], Tue Jun 2 21:10:07 2020 UTC (3 years, 10 months ago) by christos
Branch: MAIN
Changes since 1.53: +3 -3 lines
Diff to previous 1.53 (colored) to selected 1.11 (colored)

Fix return of alignof()

Revision 1.52.4.1 / (download) - annotate - [select for diffs], Mon Jun 10 22:10:26 2019 UTC (4 years, 10 months ago) by christos
Branch: phil-wifi
Changes since 1.52: +4 -4 lines
Diff to previous 1.52 (colored) next main 1.53 (colored) to selected 1.11 (colored)

Sync with HEAD

Revision 1.52.2.1 / (download) - annotate - [select for diffs], Sun Sep 30 01:45:59 2018 UTC (5 years, 6 months ago) by pgoyette
Branch: pgoyette-compat
CVS Tags: pgoyette-compat-merge-20190127
Changes since 1.52: +4 -4 lines
Diff to previous 1.52 (colored) next main 1.53 (colored) to selected 1.11 (colored)

Ssync with HEAD

Revision 1.53 / (download) - annotate - [select for diffs], Fri Sep 7 15:16:15 2018 UTC (5 years, 7 months ago) by christos
Branch: MAIN
CVS Tags: phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, phil-wifi-20191119, phil-wifi-20190609, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, netbsd-9-base, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9, is-mlppp-base, is-mlppp
Changes since 1.52: +4 -4 lines
Diff to previous 1.52 (colored) to selected 1.11 (colored)

recognize int128

Revision 1.52 / (download) - annotate - [select for diffs], Mon Jan 15 22:14:24 2018 UTC (6 years, 3 months ago) by christos
Branch: MAIN
CVS Tags: phil-wifi-base, pgoyette-compat-base, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315
Branch point for: phil-wifi, pgoyette-compat
Changes since 1.51: +5 -5 lines
Diff to previous 1.51 (colored) to selected 1.11 (colored)

fix indent

Revision 1.51 / (download) - annotate - [select for diffs], Fri Aug 19 10:19:45 2016 UTC (7 years, 7 months ago) by christos
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, perseant-stdc-iso10646-base, perseant-stdc-iso10646, netbsd-8-base, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, netbsd-8, matt-nb8-mediatek-base, matt-nb8-mediatek, localcount-20160914, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan
Changes since 1.50: +4 -2 lines
Diff to previous 1.50 (colored) to selected 1.11 (colored)

Add union casts.

Revision 1.50 / (download) - annotate - [select for diffs], Thu Aug 18 14:42:48 2016 UTC (7 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.49: +3 -3 lines
Diff to previous 1.49 (colored) to selected 1.11 (colored)

anonymous members are C9X

Revision 1.49 / (download) - annotate - [select for diffs], Wed Oct 14 18:31:52 2015 UTC (8 years, 6 months ago) by christos
Branch: MAIN
CVS Tags: pgoyette-localcount-base, pgoyette-localcount-20160806, pgoyette-localcount-20160726, pgoyette-localcount
Changes since 1.48: +5 -5 lines
Diff to previous 1.48 (colored) to selected 1.11 (colored)

more descriptive errors

Revision 1.48 / (download) - annotate - [select for diffs], Wed Jul 29 18:22:06 2015 UTC (8 years, 8 months ago) by christos
Branch: MAIN
Changes since 1.47: +3 -3 lines
Diff to previous 1.47 (colored) to selected 1.11 (colored)

Be more specific about the type errors

Revision 1.45.2.2 / (download) - annotate - [select for diffs], Wed Aug 20 00:05:06 2014 UTC (9 years, 7 months ago) by tls
Branch: tls-maxphys
Changes since 1.45.2.1: +1 -1 lines
Diff to previous 1.45.2.1 (colored) to branchpoint 1.45 (colored) next main 1.46 (colored) to selected 1.11 (colored)

Rebase to HEAD as of a few days ago.

Revision 1.44.2.2 / (download) - annotate - [select for diffs], Thu May 22 11:42:52 2014 UTC (9 years, 10 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.44.2.1: +9 -6 lines
Diff to previous 1.44.2.1 (colored) to branchpoint 1.44 (colored) next main 1.45 (colored) to selected 1.11 (colored)

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")

Revision 1.47 / (download) - annotate - [select for diffs], Tue Feb 18 22:01:36 2014 UTC (10 years, 1 month ago) by christos
Branch: MAIN
CVS Tags: yamt-pagecache-base9, tls-maxphys-base, tls-earlyentropy-base, tls-earlyentropy, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-base, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0, netbsd-7
Changes since 1.46: +3 -3 lines
Diff to previous 1.46 (colored) to selected 1.11 (colored)

add __extension__ and typeof

Revision 1.45.2.1 / (download) - annotate - [select for diffs], Sun Jun 23 06:29:02 2013 UTC (10 years, 9 months ago) by tls
Branch: tls-maxphys
Changes since 1.45: +8 -5 lines
Diff to previous 1.45 (colored) to selected 1.11 (colored)

resync from head

Revision 1.46 / (download) - annotate - [select for diffs], Fri Apr 19 17:43:05 2013 UTC (10 years, 11 months ago) by christos
Branch: MAIN
CVS Tags: riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2
Changes since 1.45: +8 -5 lines
Diff to previous 1.45 (colored) to selected 1.11 (colored)

Allow linted comments to take an argument that defines which error to suppress.

Revision 1.44.2.1 / (download) - annotate - [select for diffs], Wed May 23 10:08:28 2012 UTC (11 years, 10 months ago) by yamt
Branch: yamt-pagecache
CVS Tags: yamt-pagecache-tag8
Changes since 1.44: +4 -4 lines
Diff to previous 1.44 (colored) to selected 1.11 (colored)

sync with head.

Revision 1.45 / (download) - annotate - [select for diffs], Fri Apr 20 18:35:28 2012 UTC (11 years, 11 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, yamt-pagecache-base5, agc-symver-base, agc-symver
Branch point for: tls-maxphys
Changes since 1.44: +4 -4 lines
Diff to previous 1.44 (colored) to selected 1.11 (colored)

add __PRETTY_FUNCTION__

Revision 1.44 / (download) - annotate - [select for diffs], Tue Oct 4 16:19:59 2011 UTC (12 years, 6 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pagecache-base4, yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, netbsd-6, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus
Branch point for: yamt-pagecache
Changes since 1.43: +3 -2 lines
Diff to previous 1.43 (colored) to selected 1.11 (colored)

Handle c99 declarations in the middle of blocks.

Revision 1.43 / (download) - annotate - [select for diffs], Fri Oct 2 15:03:45 2009 UTC (14 years, 6 months ago) by christos
Branch: MAIN
CVS Tags: matt-premerge-20091211, matt-mips64-premerge-20101231, cherry-xenmp-base, cherry-xenmp, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2
Changes since 1.42: +3 -2 lines
Diff to previous 1.42 (colored) to selected 1.11 (colored)

understand __attribute__((__packed__)) and __packed.

Revision 1.38.6.1 / (download) - annotate - [select for diffs], Wed May 13 19:20:13 2009 UTC (14 years, 11 months ago) by jym
Branch: jym-xensuspend
Changes since 1.38: +12 -11 lines
Diff to previous 1.38 (colored) next main 1.39 (colored) to selected 1.11 (colored)

Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html

Revision 1.42 / (download) - annotate - [select for diffs], Sat May 2 16:10:49 2009 UTC (14 years, 11 months ago) by christos
Branch: MAIN
CVS Tags: jym-xensuspend-nbase, jym-xensuspend-base
Changes since 1.41: +6 -6 lines
Diff to previous 1.41 (colored) to selected 1.11 (colored)

Add __alignof__.

Revision 1.41 / (download) - annotate - [select for diffs], Fri May 1 22:03:36 2009 UTC (14 years, 11 months ago) by christos
Branch: MAIN
Changes since 1.40: +3 -2 lines
Diff to previous 1.40 (colored) to selected 1.11 (colored)

add variable declarations in for loops for c99

Revision 1.40 / (download) - annotate - [select for diffs], Wed Apr 15 01:20:57 2009 UTC (15 years ago) by christos
Branch: MAIN
Changes since 1.39: +4 -4 lines
Diff to previous 1.39 (colored) to selected 1.11 (colored)

Lukemify (WARNS=4)

Revision 1.39 / (download) - annotate - [select for diffs], Mon Apr 13 21:17:37 2009 UTC (15 years ago) by christos
Branch: MAIN
Changes since 1.38: +5 -5 lines
Diff to previous 1.38 (colored) to selected 1.11 (colored)

since we know the types, print what they are in error messages.

Revision 1.36.2.1 / (download) - annotate - [select for diffs], Thu Sep 18 04:29:27 2008 UTC (15 years, 7 months ago) by wrstuden
Branch: wrstuden-revivesa
Changes since 1.36: +4 -2 lines
Diff to previous 1.36 (colored) next main 1.37 (colored) to selected 1.11 (colored)

Sync with wrstuden-revivesa-base-2.

Revision 1.38 / (download) - annotate - [select for diffs], Thu Jul 31 15:21:34 2008 UTC (15 years, 8 months ago) by christos
Branch: MAIN
CVS Tags: wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, netbsd-5-base, netbsd-5-2-RELEASE, netbsd-5-2-RC1, netbsd-5-2-3-RELEASE, netbsd-5-2-2-RELEASE, netbsd-5-2-1-RELEASE, netbsd-5-2, netbsd-5-1-RELEASE, netbsd-5-1-RC4, netbsd-5-1-RC3, netbsd-5-1-RC2, netbsd-5-1-RC1, netbsd-5-1-5-RELEASE, netbsd-5-1-4-RELEASE, netbsd-5-1-3-RELEASE, netbsd-5-1-2-RELEASE, netbsd-5-1-1-RELEASE, netbsd-5-1, netbsd-5-0-RELEASE, netbsd-5-0-RC4, netbsd-5-0-RC3, netbsd-5-0-RC2, netbsd-5-0-RC1, netbsd-5-0-2-RELEASE, netbsd-5-0-1-RELEASE, netbsd-5-0, netbsd-5, matt-nb5-pq3-base, matt-nb5-pq3, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-premerge-20091211, matt-nb5-mips64-k15, matt-nb5-mips64, matt-nb4-mips64-k7-u2a-k9b, matt-mips64-base2
Branch point for: jym-xensuspend
Changes since 1.37: +3 -2 lines
Diff to previous 1.37 (colored) to selected 1.11 (colored)

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.

Revision 1.37 / (download) - annotate - [select for diffs], Fri Jul 25 18:33:53 2008 UTC (15 years, 8 months ago) by dsl
Branch: MAIN
Changes since 1.36: +3 -2 lines
Diff to previous 1.36 (colored) to selected 1.11 (colored)

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!

Revision 1.32.2.1 / (download) - annotate - [select for diffs], Sun May 18 12:36:11 2008 UTC (15 years, 11 months ago) by yamt
Branch: yamt-pf42
Changes since 1.32: +10 -10 lines
Diff to previous 1.32 (colored) next main 1.33 (colored) to selected 1.11 (colored)

sync with head.

Revision 1.36 / (download) - annotate - [select for diffs], Sun Apr 27 01:45:04 2008 UTC (15 years, 11 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pf42-base4, yamt-pf42-base3, yamt-pf42-base2, wrstuden-revivesa-base-1, wrstuden-revivesa-base, hpcarm-cleanup-nbase
Branch point for: wrstuden-revivesa
Changes since 1.35: +6 -6 lines
Diff to previous 1.35 (colored) to selected 1.11 (colored)

print the types involved in an error.

Revision 1.35 / (download) - annotate - [select for diffs], Sun Apr 27 00:13:58 2008 UTC (15 years, 11 months ago) by christos
Branch: MAIN
Changes since 1.34: +4 -6 lines
Diff to previous 1.34 (colored) to selected 1.11 (colored)

reorder a couple of error messages.

Revision 1.34 / (download) - annotate - [select for diffs], Sat Apr 26 16:14:23 2008 UTC (15 years, 11 months ago) by christos
Branch: MAIN
Changes since 1.33: +3 -3 lines
Diff to previous 1.33 (colored) to selected 1.11 (colored)

fix "long double" type recognition which broke with the complex changes.

Revision 1.33 / (download) - annotate - [select for diffs], Fri Apr 25 22:18:34 2008 UTC (15 years, 11 months ago) by christos
Branch: MAIN
Changes since 1.32: +5 -3 lines
Diff to previous 1.32 (colored) to selected 1.11 (colored)

preliminary _Complex support.
NB: Does not really understand type conversions between complex and doubles.

Revision 1.31.14.1 / (download) - annotate - [select for diffs], Mon Mar 24 07:16:35 2008 UTC (16 years ago) by keiichi
Branch: keiichi-mipv6
Changes since 1.31: +3 -3 lines
Diff to previous 1.31 (colored) next main 1.32 (colored) to selected 1.11 (colored)

sync with head.

Revision 1.31.8.1 / (download) - annotate - [select for diffs], Sun Mar 23 00:49:03 2008 UTC (16 years ago) by matt
Branch: matt-armv6
Changes since 1.31: +3 -3 lines
Diff to previous 1.31 (colored) next main 1.32 (colored) to selected 1.11 (colored)

sync with HEAD

Revision 1.32 / (download) - annotate - [select for diffs], Tue Mar 4 02:41:46 2008 UTC (16 years, 1 month ago) by christos
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base, matt-armv6-nbase, keiichi-mipv6-nbase, keiichi-mipv6-base
Branch point for: yamt-pf42
Changes since 1.31: +3 -3 lines
Diff to previous 1.31 (colored) to selected 1.11 (colored)

PR/38142: YAMAMOTO Takashi: lint -S complains on variable length arrays

Revision 1.31 / (download) - annotate - [select for diffs], Mon Oct 23 00:15:58 2006 UTC (17 years, 5 months ago) by christos
Branch: MAIN
CVS Tags: wrstuden-fixsa-newbase, wrstuden-fixsa-base-1, wrstuden-fixsa-base, wrstuden-fixsa, netbsd-4-base, netbsd-4-0-RELEASE, netbsd-4-0-RC5, netbsd-4-0-RC4, netbsd-4-0-RC3, netbsd-4-0-RC2, netbsd-4-0-RC1, netbsd-4-0-1-RELEASE, netbsd-4-0, netbsd-4, matt-mips64-base, matt-mips64, matt-armv6-prevmlocking, matt-armv6-base, hpcarm-cleanup-base, hpcarm-cleanup, cube-autoconf-base, cube-autoconf
Branch point for: matt-armv6, keiichi-mipv6
Changes since 1.30: +3 -3 lines
Diff to previous 1.30 (colored) to selected 1.11 (colored)

allow 0 sized structs in c9x

Revision 1.30 / (download) - annotate - [select for diffs], Mon Oct 23 00:10:29 2006 UTC (17 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.29: +5 -4 lines
Diff to previous 1.29 (colored) to selected 1.11 (colored)

add zero sized array handling. It is a little too chatty now.

Revision 1.29 / (download) - annotate - [select for diffs], Sun Jan 2 10:40:49 2005 UTC (19 years, 3 months ago) by christos
Branch: MAIN
CVS Tags: netbsd-3-base, netbsd-3-1-RELEASE, netbsd-3-1-RC4, netbsd-3-1-RC3, netbsd-3-1-RC2, netbsd-3-1-RC1, netbsd-3-1-1-RELEASE, netbsd-3-1, netbsd-3-0-RELEASE, netbsd-3-0-RC6, netbsd-3-0-RC5, netbsd-3-0-RC4, netbsd-3-0-RC3, netbsd-3-0-RC2, netbsd-3-0-RC1, netbsd-3-0-3-RELEASE, netbsd-3-0-2-RELEASE, netbsd-3-0-1-RELEASE, netbsd-3-0, netbsd-3, chap-midi-nbase, chap-midi-base, chap-midi, abandoned-netbsd-4-base, abandoned-netbsd-4
Changes since 1.28: +4 -4 lines
Diff to previous 1.28 (colored) to selected 1.11 (colored)

say from what type to what time we are converting.

Revision 1.28 / (download) - annotate - [select for diffs], Tue Aug 3 12:11:54 2004 UTC (19 years, 8 months ago) by yamt
Branch: MAIN
Changes since 1.27: +3 -2 lines
Diff to previous 1.27 (colored) to selected 1.11 (colored)

recognize C99 array initializer designators.  PR/18896.

Revision 1.26.2.1 / (download) - annotate - [select for diffs], Tue Jun 22 07:27:50 2004 UTC (19 years, 9 months ago) by tron
Branch: netbsd-2-0
CVS Tags: netbsd-2-base, netbsd-2-1-RELEASE, netbsd-2-1-RC6, netbsd-2-1-RC5, netbsd-2-1-RC4, netbsd-2-1-RC3, netbsd-2-1-RC2, netbsd-2-1-RC1, netbsd-2-1, netbsd-2-0-RELEASE, netbsd-2-0-RC5, netbsd-2-0-RC4, netbsd-2-0-RC3, netbsd-2-0-RC2, netbsd-2-0-RC1, netbsd-2-0-3-RELEASE, netbsd-2-0-2-RELEASE, netbsd-2-0-1-RELEASE, netbsd-2
Changes since 1.26: +6 -2 lines
Diff to previous 1.26 (colored) next main 1.27 (colored) to selected 1.11 (colored)

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

Revision 1.27 / (download) - annotate - [select for diffs], Sun Jun 20 22:20:16 2004 UTC (19 years, 10 months ago) by jmc
Branch: MAIN
Changes since 1.26: +6 -2 lines
Diff to previous 1.26 (colored) to selected 1.11 (colored)

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

Revision 1.26 / (download) - annotate - [select for diffs], Sat Nov 2 20:14:10 2002 UTC (21 years, 5 months ago) by perry
Branch: MAIN
CVS Tags: netbsd-2-0-base, fvdl_fs64_base
Branch point for: netbsd-2-0
Changes since 1.25: +8 -2 lines
Diff to previous 1.25 (colored) to selected 1.11 (colored)

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.

Revision 1.25 / (download) - annotate - [select for diffs], Sat Nov 2 20:09:27 2002 UTC (21 years, 5 months ago) by perry
Branch: MAIN
Changes since 1.24: +23 -2 lines
Diff to previous 1.24 (colored) to selected 1.11 (colored)

add c99ism(), by analogy to gnuism(), for c99 construct (un)warnings

Revision 1.24 / (download) - annotate - [select for diffs], Tue Oct 22 22:50:11 2002 UTC (21 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.23: +3 -2 lines
Diff to previous 1.23 (colored) to selected 1.11 (colored)

add support for ({}) gcc shit.

Revision 1.23 / (download) - annotate - [select for diffs], Tue Oct 22 18:15:00 2002 UTC (21 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.22: +3 -2 lines
Diff to previous 1.22 (colored) to selected 1.11 (colored)

add C9X/GCC compound literal expressions.

Revision 1.22 / (download) - annotate - [select for diffs], Tue Oct 22 13:48:50 2002 UTC (21 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.21: +3 -2 lines
Diff to previous 1.21 (colored) to selected 1.11 (colored)

add variable array dimension.

Revision 1.21 / (download) - annotate - [select for diffs], Tue Oct 22 13:31:34 2002 UTC (21 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.20: +4 -2 lines
Diff to previous 1.20 (colored) to selected 1.11 (colored)

handle gcc __FUNCTION__ and C9X __func__

Revision 1.20 / (download) - annotate - [select for diffs], Mon Oct 21 21:14:51 2002 UTC (21 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.19: +5 -2 lines
Diff to previous 1.19 (colored) to selected 1.11 (colored)

support for c99 style and gnu style structure and union named initializers.

Revision 1.19 / (download) - annotate - [select for diffs], Fri Sep 13 14:59:24 2002 UTC (21 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.18: +6 -5 lines
Diff to previous 1.18 (colored) to selected 1.11 (colored)

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.

Revision 1.18 / (download) - annotate - [select for diffs], Thu Mar 7 20:17:37 2002 UTC (22 years, 1 month ago) by tv
Branch: MAIN
CVS Tags: netbsd-1-6-base, netbsd-1-6-RELEASE, netbsd-1-6-RC3, netbsd-1-6-RC2, netbsd-1-6-RC1, netbsd-1-6-PATCH002-RELEASE, netbsd-1-6-PATCH002-RC4, netbsd-1-6-PATCH002-RC3, netbsd-1-6-PATCH002-RC2, netbsd-1-6-PATCH002-RC1, netbsd-1-6-PATCH002, netbsd-1-6-PATCH001-RELEASE, netbsd-1-6-PATCH001-RC3, netbsd-1-6-PATCH001-RC2, netbsd-1-6-PATCH001-RC1, netbsd-1-6-PATCH001, netbsd-1-6
Changes since 1.17: +9 -9 lines
Diff to previous 1.17 (colored) to selected 1.11 (colored)

Rename `basename' as `lbasename' so as not to confuse with the libgen.h
prototyped function of the same name.

Revision 1.17 / (download) - annotate - [select for diffs], Thu Jan 31 19:36:54 2002 UTC (22 years, 2 months ago) by tv
Branch: MAIN
Changes since 1.16: +3 -3 lines
Diff to previous 1.16 (colored) to selected 1.11 (colored)

Protect __RCSID and __COPYRIGHT from being invoked if not defined.

Revision 1.16 / (download) - annotate - [select for diffs], Thu Dec 13 23:56:00 2001 UTC (22 years, 4 months ago) by augustss
Branch: MAIN
Changes since 1.15: +5 -8 lines
Diff to previous 1.15 (colored) to selected 1.11 (colored)

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.

Revision 1.15 / (download) - annotate - [select for diffs], Mon May 28 12:40:37 2001 UTC (22 years, 10 months ago) by lukem
Branch: MAIN
Changes since 1.14: +9 -68 lines
Diff to previous 1.14 (colored) to selected 1.11 (colored)

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.

Revision 1.14 / (download) - annotate - [select for diffs], Thu May 24 12:10:39 2001 UTC (22 years, 10 months ago) by lukem
Branch: MAIN
Changes since 1.13: +3 -2 lines
Diff to previous 1.13 (colored) to selected 1.11 (colored)

support // comments if -g is given

Revision 1.13 / (download) - annotate - [select for diffs], Sat Feb 24 00:43:51 2001 UTC (23 years, 1 month ago) by cgd
Branch: MAIN
Changes since 1.12: +2 -2 lines
Diff to previous 1.12 (colored) to selected 1.11 (colored)

fix broken NetBSD RCS id tags

Revision 1.12 / (download) - annotate - [select for diffs], Thu Jul 6 01:09:20 2000 UTC (23 years, 9 months ago) by christos
Branch: MAIN
Changes since 1.11: +38 -10 lines
Diff to previous 1.11 (colored)

- support for -X flag
- support for -m flag
- print the error number in each message

Revision 1.11 / (download) - annotate - [selected], Mon Jul 27 13:50:47 1998 UTC (25 years, 8 months ago) by mycroft
Branch: MAIN
CVS Tags: wrstuden-devbsize-base, wrstuden-devbsize-19991221, wrstuden-devbsize, netbsd-1-5-base, netbsd-1-5-RELEASE, netbsd-1-5-PATCH003, netbsd-1-5-PATCH002, netbsd-1-5-PATCH001, netbsd-1-5-BETA2, netbsd-1-5-BETA, netbsd-1-5-ALPHA2, netbsd-1-5, netbsd-1-4-base, netbsd-1-4-RELEASE, netbsd-1-4-PATCH003, netbsd-1-4-PATCH002, netbsd-1-4-PATCH001, netbsd-1-4, minoura-xpg4dl-base, minoura-xpg4dl, comdex-fall-1999-base, comdex-fall-1999
Changes since 1.10: +5 -5 lines
Diff to previous 1.10 (colored)

Fix a recurring typo: comparision -> comparison.

Revision 1.10 / (download) - annotate - [select for diffs], Sun Feb 22 15:40:39 1998 UTC (26 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.9: +3 -2 lines
Diff to previous 1.9 (colored) to selected 1.11 (colored)

WARNSify

Revision 1.8.4.1 / (download) - annotate - [select for diffs], Tue Nov 4 21:42:23 1997 UTC (26 years, 5 months ago) by thorpej
Branch: netbsd-1-3
CVS Tags: netbsd-1-3-RELEASE, netbsd-1-3-PATCH003-CANDIDATE2, netbsd-1-3-PATCH003-CANDIDATE1, netbsd-1-3-PATCH003-CANDIDATE0, netbsd-1-3-PATCH003, netbsd-1-3-PATCH002, netbsd-1-3-PATCH001, netbsd-1-3-BETA
Changes since 1.8: +4 -2 lines
Diff to previous 1.8 (colored) next main 1.9 (colored) to selected 1.11 (colored)

Pull up from trunk: make renaming work and other minor fixes.

Revision 1.9 / (download) - annotate - [select for diffs], Mon Nov 3 22:36:41 1997 UTC (26 years, 5 months ago) by cgd
Branch: MAIN
Changes since 1.8: +4 -2 lines
Diff to previous 1.8 (colored) to selected 1.11 (colored)

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.

Revision 1.8 / (download) - annotate - [select for diffs], Mon Oct 2 17:37:00 1995 UTC (28 years, 6 months ago) by jpo
Branch: MAIN
CVS Tags: netbsd-1-3-base, netbsd-1-2-base, netbsd-1-2-RELEASE, netbsd-1-2-PATCH001, netbsd-1-2-BETA, netbsd-1-2, netbsd-1-1-base, netbsd-1-1-RELEASE, netbsd-1-1-PATCH001, netbsd-1-1
Branch point for: netbsd-1-3
Changes since 1.7: +3 -3 lines
Diff to previous 1.7 (colored) to selected 1.11 (colored)

removed some dubious warnings about conversion of constant operands of
bitwise operators

Revision 1.7 / (download) - annotate - [select for diffs], Mon Oct 2 17:29:49 1995 UTC (28 years, 6 months ago) by jpo
Branch: MAIN
Changes since 1.6: +3 -3 lines
Diff to previous 1.6 (colored) to selected 1.11 (colored)

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.

Revision 1.6 / (download) - annotate - [select for diffs], Mon Oct 2 17:22:48 1995 UTC (28 years, 6 months ago) by jpo
Branch: MAIN
Changes since 1.5: +3 -3 lines
Diff to previous 1.5 (colored) to selected 1.11 (colored)

some minor bug fixes

Revision 1.5 / (download) - annotate - [select for diffs], Mon Oct 2 17:21:30 1995 UTC (28 years, 6 months ago) by jpo
Branch: MAIN
Changes since 1.4: +12 -5 lines
Diff to previous 1.4 (colored) to selected 1.11 (colored)

prototypes override old style function definitions
this is a gnu extension to ansi c

Revision 1.4 / (download) - annotate - [select for diffs], Mon Oct 2 17:19:01 1995 UTC (28 years, 6 months ago) by jpo
Branch: MAIN
Changes since 1.3: +5 -7 lines
Diff to previous 1.3 (colored) to selected 1.11 (colored)

__{const,signed,volatile}{__,} added
const, signed and volatile are disabled with -t

Revision 1.3 / (download) - annotate - [select for diffs], Mon Oct 2 17:14:17 1995 UTC (28 years, 6 months ago) by jpo
Branch: MAIN
Changes since 1.2: +80 -45 lines
Diff to previous 1.2 (colored) to selected 1.11 (colored)

added inline keywords
"inline" is enabled by -g, "__inline" and "__inline__" are always available

Revision 1.2 / (download) - annotate - [select for diffs], Mon Jul 3 21:24:04 1995 UTC (28 years, 9 months ago) by cgd
Branch: MAIN
Changes since 1.1: +3 -3 lines
Diff to previous 1.1 (colored) to selected 1.11 (colored)

RCS id cleanup

Revision 1.1.1.1 / (download) - annotate - [select for diffs] (vendor branch), Mon Jul 3 20:56:36 1995 UTC (28 years, 9 months ago) by cgd
Branch: Jochen_Pohl
CVS Tags: Jochen_Pohl-950703
Changes since 1.1: +0 -0 lines
Diff to previous 1.1 (colored) to selected 1.11 (colored)

lint(1) implementation, by Jochen Pohl.  named 'xlint' for a similar
reason to why 'install' is named 'xinstall'.

Revision 1.1 / (download) - annotate - [select for diffs], Mon Jul 3 20:56:36 1995 UTC (28 years, 9 months ago) by cgd
Branch: MAIN
Diff to selected 1.11 (colored)

Initial revision

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>