The NetBSD Project

CVS log for src/usr.bin/xlint/lint1/externs1.h

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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.216 / (download) - annotate - [select for diffs], Mon Feb 5 23:11:22 2024 UTC (2 weeks, 6 days ago) by rillig
Branch: MAIN
CVS Tags: HEAD
Changes since 1.215: +4 -4 lines
Diff to previous 1.215 (colored)

lint: make function call arguments directly accessible

Previously, the arguments of a function call expression were arranged in
a linear tree structure, from right to left.  To allow easier access to
the arguments, store them in an array instead.

Revision 1.215 / (download) - annotate - [select for diffs], Sat Feb 3 19:25:16 2024 UTC (3 weeks, 1 day ago) by rillig
Branch: MAIN
Changes since 1.214: +2 -1 lines
Diff to previous 1.214 (colored)

lint: keep strings in their source representation

This allows further analysis depending on whether individual characters are
escaped as octal, hexadecimal or not at all.

Revision 1.214 / (download) - annotate - [select for diffs], Sat Feb 3 12:57:12 2024 UTC (3 weeks, 1 day ago) by rillig
Branch: MAIN
Changes since 1.213: +3 -3 lines
Diff to previous 1.213 (colored)

lint: clean up comments, reduce scope of variables

Revision 1.213 / (download) - annotate - [select for diffs], Thu Feb 1 18:37:06 2024 UTC (3 weeks, 3 days ago) by rillig
Branch: MAIN
Changes since 1.212: +3 -3 lines
Diff to previous 1.212 (colored)

lint: use standard buffer for storing string values

No functional change.

Revision 1.212 / (download) - annotate - [select for diffs], Tue Jan 23 19:44:28 2024 UTC (4 weeks, 5 days ago) by rillig
Branch: MAIN
Changes since 1.211: +3 -3 lines
Diff to previous 1.211 (colored)

lint: rename symt_t to symbol_kind

It was confusing to have two kinds of "symbol type" (s_type and s_symt),
so rename all related identifiers to be more distinctive.

No functional change.

Revision 1.211 / (download) - annotate - [select for diffs], Thu Jan 11 23:06:19 2024 UTC (6 weeks, 3 days ago) by rillig
Branch: MAIN
Changes since 1.210: +2 -2 lines
Diff to previous 1.210 (colored)

lint: correctly set system-header flag on cast-expression

When a cast-expression comes partly from a system header, determine at
the ')' whether the whole cast-expression comes from the system header.
Previously, it was based on the operand, which contradicted the
documentation of tn_sys.

Mainly affects strict bool mode (where expressions from system headers
are handled more leniently), as well as query 9 for parenthesized return
expressions.

Discovered upon manual inspection, as calling expr_alloc_tnode should
never be necessary when creating an expression node with operands;
there's build_op for that purpose.

Revision 1.210 / (download) - annotate - [select for diffs], Tue Jan 9 23:46:54 2024 UTC (6 weeks, 5 days ago) by rillig
Branch: MAIN
Changes since 1.209: +3 -2 lines
Diff to previous 1.209 (colored)

lint: allow complex offsetof(type, member-designator)

Both GCC 11 and Clang 8 accept member-designators that are not
identifiers but designator sequences, such as in 'offsetof(struct stat,
st_atim.tv_sec)', so make lint accept them as well.

Revision 1.209 / (download) - annotate - [select for diffs], Sun Dec 10 15:29:38 2023 UTC (2 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.208: +2 -1 lines
Diff to previous 1.208 (colored)

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

Revision 1.208 / (download) - annotate - [select for diffs], Sun Dec 3 18:17:41 2023 UTC (2 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.207: +268 -268 lines
Diff to previous 1.207 (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.207 / (download) - annotate - [select for diffs], Wed Aug 2 21:58:11 2023 UTC (6 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.206: +1 -2 lines
Diff to previous 1.206 (colored)

lint: remove unused string literals

Revision 1.206 / (download) - annotate - [select for diffs], Wed Aug 2 21:11:35 2023 UTC (6 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.205: +2 -1 lines
Diff to previous 1.205 (colored)

lint: fix handling of unnamed function parameters

Revision 1.205 / (download) - annotate - [select for diffs], Wed Aug 2 18:51:25 2023 UTC (6 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.204: +3 -3 lines
Diff to previous 1.204 (colored)

lint: distinguish between arguments and parameters

Revision 1.204 / (download) - annotate - [select for diffs], Tue Aug 1 16:08:58 2023 UTC (6 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.203: +9 -3 lines
Diff to previous 1.203 (colored)

lint: improve debug logging for declarators

Revision 1.203 / (download) - annotate - [select for diffs], Sun Jul 30 22:27:21 2023 UTC (6 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.202: +3 -3 lines
Diff to previous 1.202 (colored)

lint: in debug mode, default to indenting the debug log

Only the 'parsing' lines are not indented, as line breaks are
independent from the structure of the code.

Revision 1.202 / (download) - annotate - [select for diffs], Sat Jul 29 07:49:14 2023 UTC (6 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.201: +2 -2 lines
Diff to previous 1.201 (colored)

lint: condense code for ending a function

No functional change.

Revision 1.201 / (download) - annotate - [select for diffs], Sat Jul 29 07:26:53 2023 UTC (6 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.200: +4 -4 lines
Diff to previous 1.200 (colored)

lint: constify

Revision 1.200 / (download) - annotate - [select for diffs], Sat Jul 29 06:44:44 2023 UTC (6 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.199: +2 -3 lines
Diff to previous 1.199 (colored)

lint: use standard function attribute for noreturn functions

Revision 1.199 / (download) - annotate - [select for diffs], Fri Jul 28 21:50:03 2023 UTC (6 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.198: +2 -2 lines
Diff to previous 1.198 (colored)

lint: extract 'vararg' and 'prototype' flags from global 'dcs'

These flags are only relevant for parameter lists, so add a separate
type for it.

No functional change.

Revision 1.198 / (download) - annotate - [select for diffs], Sat Jul 15 15:51:22 2023 UTC (7 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.197: +2 -2 lines
Diff to previous 1.197 (colored)

lint: clean up duplicate code for finding struct/union members

Revision 1.197 / (download) - annotate - [select for diffs], Sat Jul 15 13:51:36 2023 UTC (7 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.196: +2 -1 lines
Diff to previous 1.196 (colored)

lint: fix use-after-free bug in GCC statement expressions

Revision 1.196 / (download) - annotate - [select for diffs], Sat Jul 15 13:35:24 2023 UTC (7 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.195: +13 -1 lines
Diff to previous 1.195 (colored)

lint: add detailed logging for finding memory allocation bugs

Revision 1.195 / (download) - annotate - [select for diffs], Thu Jul 13 23:11:11 2023 UTC (7 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.194: +5 -4 lines
Diff to previous 1.194 (colored)

lint: use separate types for parsing pointer types and type qualifiers

The documentation of the previous 'qual_ptr_t' was misleading, as that
type was used for other type qualifier lists as well, even if these were
not related to pointer types.

Revision 1.194 / (download) - annotate - [select for diffs], Thu Jul 13 08:40:38 2023 UTC (7 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.193: +2 -2 lines
Diff to previous 1.193 (colored)

lint: indent copyright lines consistently

Revision 1.193 / (download) - annotate - [select for diffs], Thu Jul 13 07:19:24 2023 UTC (7 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.192: +2 -13 lines
Diff to previous 1.192 (colored)

lint: reduce code size for handling lint comments

Revision 1.192 / (download) - annotate - [select for diffs], Thu Jul 13 06:41:27 2023 UTC (7 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.191: +5 -5 lines
Diff to previous 1.191 (colored)

lint: clean up code related to lint comments

Remove type information from variable names, as the word 'flag' did not
indicate that the variables were negated.

Remove contradicting comments. Suppressing a warning for 'this line',
'this and the following line' and 'this statement or declaration' cannot
all be accurate at the same time.

Revision 1.191 / (download) - annotate - [select for diffs], Wed Jul 12 16:07:35 2023 UTC (7 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.190: +3 -1 lines
Diff to previous 1.190 (colored)

lint: don't treat 'inline' as a storage class

The additional conflict in the grammar is in the same place as the other
conflicts, as T_SCLASS and T_FUNCTION_SPECIFIER are now separate tokens.

No functional change.

Revision 1.190 / (download) - annotate - [select for diffs], Fri Jul 7 19:45:22 2023 UTC (7 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.189: +2 -1 lines
Diff to previous 1.189 (colored)

lint: warn about function definitions without header declaration

The existing warning was only issued for function declarations, not for
function definitions.

The interesting change in the tests is in msg_351.c.  Many other tests
use non-static functions due to their syntactic brevity.  In these
tests, the warning is disabled individually, to allow new functions to
be added without generating warning 351.

Revision 1.189 / (download) - annotate - [select for diffs], Fri Jul 7 06:03:31 2023 UTC (7 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.188: +3 -2 lines
Diff to previous 1.188 (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.188 / (download) - annotate - [select for diffs], Sun Jul 2 23:40:23 2023 UTC (7 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.187: +3 -1 lines
Diff to previous 1.187 (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.187 / (download) - annotate - [select for diffs], Sun Jul 2 18:14:44 2023 UTC (7 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.186: +2 -2 lines
Diff to previous 1.186 (colored)

lint: rename 'quad' to 'signed int' or 'unsigned int'

No functional change.

Revision 1.186 / (download) - annotate - [select for diffs], Sun Jul 2 10:20:45 2023 UTC (7 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.185: +4 -4 lines
Diff to previous 1.185 (colored)

lint: extend debug logging for declaration levels

Indent the debug logging according to the declaration level.

Since there are a few cases where the enclosing declaration levels are
modified, log the whole declaration level stack whenever a level begins
or ends.

Revision 1.185 / (download) - annotate - [select for diffs], Sat Jul 1 09:31:55 2023 UTC (7 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.184: +2 -2 lines
Diff to previous 1.184 (colored)

lint: clean up duplicate and dead code for integer constants

No functional change.

Revision 1.184 / (download) - annotate - [select for diffs], Sat Jul 1 06:09:24 2023 UTC (7 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.183: +2 -1 lines
Diff to previous 1.183 (colored)

lint: fix initialization of unnamed union member

Revision 1.183 / (download) - annotate - [select for diffs], Fri Jun 30 21:39:54 2023 UTC (7 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.182: +6 -6 lines
Diff to previous 1.182 (colored)

lint: clean up names related to declaration levels

The previous prefix 'DK_' (declaration level kind) had a conflict with
the 'DK_' (designator kind) in init.c, so change the prefix to 'DLK_'.
The new name for dinfo_t is decl_level, which is more expressive.

No functional change.

Revision 1.182 / (download) - annotate - [select for diffs], Fri Jun 30 21:06:18 2023 UTC (7 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.181: +2 -1 lines
Diff to previous 1.181 (colored)

lint: fix handling of unnamed struct/union members

The support for unnamed struct/union members that was added in decl.c
1.60 from 2015-10-13 was simple but wrong. It didn't cover initializers
of these structures and computed wrong sizes for structures containing
anonymous unions. At that time, the handling of initializers was broken
as well, it was fixed 6 years later in init.c 1.229 from 2021-12-22.

Real-life examples for code that lint couldn't handle are:

	* external/bsd/jemalloc/dist/src/jemalloc.c
	* external/mit/xorg/lib/dri.old/Makefile

Revision 1.181 / (download) - annotate - [select for diffs], Fri Jun 30 19:10:49 2023 UTC (7 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.180: +3 -3 lines
Diff to previous 1.180 (colored)

lint: clean up handling of declarations

No functional change.

Revision 1.180 / (download) - annotate - [select for diffs], Thu Jun 29 09:58:36 2023 UTC (7 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.179: +18 -18 lines
Diff to previous 1.179 (colored)

lint: clean up function names

No functional change.

Revision 1.179 / (download) - annotate - [select for diffs], Thu Jun 29 05:03:03 2023 UTC (7 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.178: +3 -3 lines
Diff to previous 1.178 (colored)

lint: clean up completion of struct, union and enum declarations

No functional change.

Revision 1.178 / (download) - annotate - [select for diffs], Sat Jun 24 07:15:08 2023 UTC (8 months ago) by rillig
Branch: MAIN
Changes since 1.177: +203 -207 lines
Diff to previous 1.177 (colored)

lint: remove redundant 'extern' from function declarations

No binary change.

Revision 1.177 / (download) - annotate - [select for diffs], Sun Apr 23 09:04:44 2023 UTC (10 months ago) by rillig
Branch: MAIN
Changes since 1.176: +2 -2 lines
Diff to previous 1.176 (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.176 / (download) - annotate - [select for diffs], Tue Apr 11 17:52:11 2023 UTC (10 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.175: +5 -5 lines
Diff to previous 1.175 (colored)

lint: in debug mode, use different names for macro and function

No functional change.

Revision 1.175 / (download) - annotate - [select for diffs], Tue Mar 28 14:44:35 2023 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.174: +6 -2 lines
Diff to previous 1.174 (colored)

lint: warn about extern declarations outside headers

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

Revision 1.174 / (download) - annotate - [select for diffs], Sat Feb 18 15:21:34 2023 UTC (12 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.173: +1 -3 lines
Diff to previous 1.173 (colored)

lint: remove unused internal_error

Revision 1.173 / (download) - annotate - [select for diffs], Mon Feb 6 21:01:55 2023 UTC (12 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.172: +2 -2 lines
Diff to previous 1.172 (colored)

lint: eliminate unnecessary indirection

No functional change.

Revision 1.172 / (download) - annotate - [select for diffs], Sun Jan 29 18:13:56 2023 UTC (12 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.171: +3 -3 lines
Diff to previous 1.171 (colored)

lint: rename functions for function definition

No functional change.

Revision 1.171 / (download) - annotate - [select for diffs], Fri Jan 13 19:41:50 2023 UTC (13 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.170: +3 -5 lines
Diff to previous 1.170 (colored)

lint: remove custom memory allocator

Besides adding complexity, the custom memory allocator didn't invalidate
freed memory, which made it harder to find possible use-after-free bugs.

Revision 1.170 / (download) - annotate - [select for diffs], Sat Oct 1 09:59:40 2022 UTC (16 months, 3 weeks ago) by rillig
Branch: MAIN
CVS Tags: netbsd-10-base, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10
Changes since 1.169: +2 -2 lines
Diff to previous 1.169 (colored)

lint: reduce pointer indirection for unnamed entities

No functional change.

Revision 1.169 / (download) - annotate - [select for diffs], Sun Aug 28 19:09:12 2022 UTC (17 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.168: +2 -2 lines
Diff to previous 1.168 (colored)

lint: inline previous_declaration for nonconstant message IDs

This adds back the compile-time printf validation in debug mode that was
missing before.

Revision 1.168 / (download) - annotate - [select for diffs], Sun Aug 28 12:04:47 2022 UTC (17 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.167: +5 -3 lines
Diff to previous 1.167 (colored)

lint: clean up visual clutter

No functional change.

Revision 1.167 / (download) - annotate - [select for diffs], Sun Aug 28 10:43:18 2022 UTC (17 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.166: +5 -5 lines
Diff to previous 1.166 (colored)

lint: rename functions to be clearer

No need anymore to keep external identifiers at the "6 significant
initial characters" mandated by C90.

Revision 1.166 / (download) - annotate - [select for diffs], Sun Aug 28 08:41:06 2022 UTC (17 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.165: +9 -9 lines
Diff to previous 1.165 (colored)

lint: rename dcs manipulation functions to be clearer

No functional change.

Revision 1.165 / (download) - annotate - [select for diffs], Tue Jul 5 22:50:41 2022 UTC (19 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.164: +5 -1 lines
Diff to previous 1.164 (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.164 / (download) - annotate - [select for diffs], Sun Jul 3 14:15:38 2022 UTC (19 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.163: +3 -1 lines
Diff to previous 1.163 (colored)

lint: add debug logging for struct and enum details

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

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

No functional change.

Revision 1.162 / (download) - annotate - [select for diffs], Wed Jun 15 18:29:21 2022 UTC (20 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.161: +2 -2 lines
Diff to previous 1.161 (colored)

lint: rename mod_t.m_requires_bool to m_compares_with_zero

The operators NOT, LOGAND, LOGOR and QUEST only require _Bool in strict
bool mode, in default mode they accept any scalar expression and compare
it with zero.  The new names are more accurate.

No functional change.

Revision 1.161 / (download) - annotate - [select for diffs], Wed Jun 15 18:06:51 2022 UTC (20 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.160: +1 -2 lines
Diff to previous 1.160 (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.160 / (download) - annotate - [select for diffs], Sat Apr 30 22:31:23 2022 UTC (21 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.159: +1 -13 lines
Diff to previous 1.159 (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.159 / (download) - annotate - [select for diffs], Sat Apr 30 21:38:03 2022 UTC (21 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.158: +2 -3 lines
Diff to previous 1.158 (colored)

lint: inline macro 'tflag'

The definition of the macro tested both allow_trad and allow_c90, but
there is only a single mode in which allow_c90 is false, therefore it
suffices to test only that.

While double-checking each occurrence of tflag individually, I learned
why lint performs lookups of struct members only by name, independently
of the struct in which they are declared.  See typeok_arrow for details.

No functional change.

Revision 1.158 / (download) - annotate - [select for diffs], Sat Apr 30 20:24:57 2022 UTC (21 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.157: +1 -2 lines
Diff to previous 1.157 (colored)

lint: document why C11 keywords are available in C99 mode as well

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

lint: inline macro c11flag

No functional change.

Revision 1.156 / (download) - annotate - [select for diffs], Sat Apr 16 19:18:17 2022 UTC (22 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.155: +5 -6 lines
Diff to previous 1.155 (colored)

lint: migrate gflag to allow_gcc

No functional change.

Revision 1.155 / (download) - annotate - [select for diffs], Sat Apr 16 13:25:27 2022 UTC (22 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.154: +23 -6 lines
Diff to previous 1.154 (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.154 / (download) - annotate - [select for diffs], Sat Apr 9 23:41:22 2022 UTC (22 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.153: +3 -2 lines
Diff to previous 1.153 (colored)

lint: distinguish between storage class and declaration kind

These types overlap but are not the same.

No functional change.

Revision 1.153 / (download) - annotate - [select for diffs], Sat Apr 9 13:22:05 2022 UTC (22 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.152: +2 -2 lines
Diff to previous 1.152 (colored)

lint: rename length to length_in_bits

No functional change.

Revision 1.152 / (download) - annotate - [select for diffs], Sat Apr 2 17:28:06 2022 UTC (22 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.151: +1 -2 lines
Diff to previous 1.151 (colored)

lint: inline setcomplete

No functional change.

Revision 1.151 / (download) - annotate - [select for diffs], Sat Apr 2 12:24:55 2022 UTC (22 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.150: +6 -2 lines
Diff to previous 1.150 (colored)

lint: add debug logging for the declaration stack

To track down the wrong edge cases in decl_direct_abstract.c.

Revision 1.150 / (download) - annotate - [select for diffs], Sun Mar 13 14:40:36 2022 UTC (23 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.149: +2 -2 lines
Diff to previous 1.149 (colored)

lint: rename function 'cleanup' to be more expressive

No functional change.

Revision 1.149 / (download) - annotate - [select for diffs], Tue Mar 1 00:17:12 2022 UTC (23 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.148: +6 -2 lines
Diff to previous 1.148 (colored)

lint: add debug logging for symbols and the symbol table

This logging is not active by default, the functions debug_sym and
debug_symtab can be called as needed during a debug session.

Revision 1.148 / (download) - annotate - [select for diffs], Sun Feb 27 10:31:58 2022 UTC (23 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.147: +3 -3 lines
Diff to previous 1.147 (colored)

lint: encode lifetime of allocated memory in function names

No functional change.

Revision 1.147 / (download) - annotate - [select for diffs], Sun Feb 27 08:31:26 2022 UTC (23 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.146: +7 -8 lines
Diff to previous 1.146 (colored)

lint: encode lifetime of allocated memory in the function names

No functional change.

Revision 1.146 / (download) - annotate - [select for diffs], Sat Feb 26 20:36:11 2022 UTC (23 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.145: +2 -1 lines
Diff to previous 1.145 (colored)

lint: fix memory corruption in statement expressions (since 2021-12-17)

The commit that introduced the assertion failure looks innocent, it only
adds a few predefined functions for GCC mode.  Nevertheless, before that
commit, lint consistently complained about 'error: void type illegal in
expression [109]', which doesn't make sense either.

This fix also removes the creative use of the initialization stack to
store the type of the statement expression.  Having a separate stack for
these statement expressions makes the code easier to understand.

Revision 1.145 / (download) - annotate - [select for diffs], Sat Feb 26 19:01:09 2022 UTC (23 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.144: +4 -1 lines
Diff to previous 1.144 (colored)

lint: extract code for handling statement expressions from the grammar

This prepares the fix of the memory corruption bug that is demonstrated
in t_integration.sh, test case assertion_failures.

No functional change.

Revision 1.144 / (download) - annotate - [select for diffs], Tue Dec 21 21:04:08 2021 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.143: +4 -5 lines
Diff to previous 1.143 (colored)

lint: rename debug_indent to debug_print_indent

The previous name could be mistaken to mean "increase the indentation of
the debug output".  Instead, the function prints the current indentation.

In externs1.h, the macro definition was a duplicate, the macros were
sorted differently than the functions a few lines above.

No binary change.

Revision 1.143 / (download) - annotate - [select for diffs], Mon Dec 20 19:34:01 2021 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.142: +2 -1 lines
Diff to previous 1.142 (colored)

lint: add grammar rule for the beginning of a designation

This will be necessary to properly implement handling of initializers
and braced initializer-lists.

No functional change for now since the designation is already reset
after each expression and '}'.  To handle initializations properly, the
designation must not be reset after each expression, it must advance to
the next member instead.

Revision 1.142 / (download) - annotate - [select for diffs], Thu Dec 16 23:46:21 2021 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.141: +2 -2 lines
Diff to previous 1.141 (colored)

lint: narrow down parameter of build_name

Passing an arbitrary tokenizer symbol left too much freedom and
uncertainty to the caller, and 0 was a magic number in this context.

No functional change.

Revision 1.141 / (download) - annotate - [select for diffs], Wed Dec 15 00:44:05 2021 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.140: +1 -2 lines
Diff to previous 1.140 (colored)

lint: unexport struct_or_union_member

Strangely, lint2 didn't notice this unnecessary export.

Revision 1.140 / (download) - annotate - [select for diffs], Tue Nov 16 21:01:05 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.139: +6 -6 lines
Diff to previous 1.139 (colored)

lint: fix check for function calls in strict bool mode

Previously, if a function call occurred in the controlling expression,
its return type could be any scalar, not just bool.  This was against
the goal of strict bool mode, which makes bool a separate and
incompabile type to all other types.  For example, it would allow
controlling expressions like 'strcmp(a, b)' without the usual '!= 0',
but only if at least one of 'a' and 'b' came from a macro definition
from a system header.

The fix is that the decision of whether the type of the controlling
expression may be scalar is no longer based on the operand types but on
the main operator of the controlling expression.

Revision 1.139 / (download) - annotate - [select for diffs], Tue Nov 16 17:41:23 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.138: +2 -2 lines
Diff to previous 1.138 (colored)

lint: rename attron to in_gcc_attribute

No functional change.

Revision 1.138 / (download) - annotate - [select for diffs], Tue Aug 31 17:51:30 2021 UTC (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.137: +1 -2 lines
Diff to previous 1.137 (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.137 / (download) - annotate - [select for diffs], Sun Aug 29 15:49:04 2021 UTC (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.136: +2 -2 lines
Diff to previous 1.136 (colored)

lint: add __sync_ and _mm_ as prefixes for builtin functions

These two additions cover all cases that occur in the current NetBSD
build on x86_64.  This allows build_name to use the usual pattern 'if
Sflag then error else if sflag then warning'.  That function currently
issues a warning in C99 as well, even though C99 prohibits implicit
function declarations.

Revision 1.136 / (download) - annotate - [select for diffs], Sat Aug 28 16:36:54 2021 UTC (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.135: +2 -1 lines
Diff to previous 1.135 (colored)

lint: do not emit GCC builtin functions

Lint1 no longer emits declarations of GCC builtin functions and calls to
them.

Previously, lint generated 3421 useless warnings in a default NetBSD
build, like this:

	__atomic_load_n, arg 1 used inconsistently
	    acl.c(216)[pointer to unsigned int]
	    rbtdb.c(921)[pointer to unsigned short]

This was because lint just doesn't understand that these functions are
type-generic, which is indeed unusual in C.

These useless warnings made the lint output more frightening than it
should actually be.  Together with the strange formatting of the
diagnostics (space-space-tab after the main message, two spaces and two
colons between the occurrences, symbols are listed in hashcode order),
this creates the impression that lint is not intended to be a
user-friendly tool.

For now, fix the excess warnings, leaving the other items for later.

Revision 1.135 / (download) - annotate - [select for diffs], Sat Aug 28 13:11:10 2021 UTC (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.134: +2 -2 lines
Diff to previous 1.134 (colored)

lint: use 'unsigned int' for bit-size of types in convert_integer

There was no need to have two separate magic values (0 and -1) to mean
the same.

No functional change.

Revision 1.134 / (download) - annotate - [select for diffs], Sat Aug 28 12:59:25 2021 UTC (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.133: +2 -2 lines
Diff to previous 1.133 (colored)

lint: use 'unsigned int' for bit-size of types

Lint does not need to support any types larger than 256 MB since they
don't occur in practice.  Practically, such large types have never been
supported at all since the function type_size_in_bits used int for the
internal calculations, resulting in overflows.

Revision 1.133 / (download) - annotate - [select for diffs], Sat Aug 28 12:41:03 2021 UTC (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.132: +2 -2 lines
Diff to previous 1.132 (colored)

lint: fix a few lint warnings about type conversions

A simple 'unsigned int' is more than enough for representing the size of
a bit-field, as well as the maximum alignment of any type.

No functional change.

Revision 1.132 / (download) - annotate - [select for diffs], Mon Aug 23 06:26:37 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.131: +1 -2 lines
Diff to previous 1.131 (colored)

lint: inline msb

This reduces the binary size on x86_64 by about 500 bytes.

No functional change.

Revision 1.131 / (download) - annotate - [select for diffs], Mon Aug 23 06:21:59 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.130: +2 -2 lines
Diff to previous 1.130 (colored)

lint: remove unnecessary width parameter for msb

No functional change.

Revision 1.130 / (download) - annotate - [select for diffs], Sun Aug 22 14:50:06 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.129: +3 -1 lines
Diff to previous 1.129 (colored)

lint: remove Tflag and pflag from common declarations

These flags are only needed by lint1 and lint2, but not by the driver
xlint.

No functional change.

Revision 1.129 / (download) - annotate - [select for diffs], Thu Aug 19 21:13:58 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.128: +2 -2 lines
Diff to previous 1.128 (colored)

lint: change return type of 'msb' from int to bool

No functional change.

Revision 1.128 / (download) - annotate - [select for diffs], Sun Aug 1 19:11:54 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.127: +3 -3 lines
Diff to previous 1.127 (colored)

lint: merge duplicate debugging code

The functions 'debug_node' and 'display_expression' were similar enough
to be merged.

Migrate debug_node to use the existing debug logging functions.

Remove the now unused option 'd' from the options string.

Revision 1.127 / (download) - annotate - [select for diffs], Sun Aug 1 18:37:29 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.126: +1 -2 lines
Diff to previous 1.126 (colored)

lint: remove option -d, clean up debug logging

The command line option -d was not used by /usr/bin/lint, and it only
triggered a handful of debug messages.  Move this debug logging over to
the compile-time -DDEBUG setting.

Move display_expression further up to avoid the forward declaration.

Revision 1.126 / (download) - annotate - [select for diffs], Sat Jul 31 19:12:35 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.125: +2 -3 lines
Diff to previous 1.125 (colored)

lint: do not evaluate arguments of debug_step

To analyze the unexpected test failure of op_shl_lp64, I had reverted
debug_step to evaluate its arguments.  I then accidentally committed
that without running the tests again.

Anyway, the previous commit can now be used as a demonstration that
initdecl is indeed missing the initialization for __uint128_t, which
leads to the internal error in op_shl_lp64.

Revision 1.125 / (download) - annotate - [select for diffs], Sat Jul 31 19:07:52 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.124: +5 -12 lines
Diff to previous 1.124 (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.124 / (download) - annotate - [select for diffs], Sat Jul 31 18:16:42 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.123: +37 -6 lines
Diff to previous 1.123 (colored)

lint: extract debug logging to separate file

Lint currently has several different kinds of debug log:

* The -DDEBUG log is controlled at compile time.
* The -d command line options enables some other debug logging.
* The -DYYDEBUG log for parsing is controlled at compile time.
* The -y command line option only has an effect in -DYYDEBUG mode.

Extracting the logging into a separate file is a first step towards
unifying these logs and making the code for debug logging stand out less
than the current #ifdef DEBUG.

No functional change.

Revision 1.123 / (download) - annotate - [select for diffs], Sat Jul 31 17:09:21 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.122: +2 -1 lines
Diff to previous 1.122 (colored)

lint: add debugging output for the grammar tokens

No functional change outside debug mode.

Revision 1.122 / (download) - annotate - [select for diffs], Sat Jul 31 11:03:04 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.121: +2 -1 lines
Diff to previous 1.121 (colored)

lint: merge duplicate code for generating unqualified type

This is a preparation for fixing the wrong warnings in msg_115.c.

No functional change.

Revision 1.121 / (download) - annotate - [select for diffs], Sun Jul 25 22:14:36 2021 UTC (2 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.120: +1 -6 lines
Diff to previous 1.120 (colored)

lint: move scl_name from print.c to decl.c

It is only needed there.

Revision 1.120 / (download) - annotate - [select for diffs], Tue Jul 20 19:44:36 2021 UTC (2 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.119: +6 -6 lines
Diff to previous 1.119 (colored)

lint: use consistent naming scheme for functions that build nodes

No functional change.

Revision 1.119 / (download) - annotate - [select for diffs], Tue Jul 20 19:35:53 2021 UTC (2 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.118: +3 -2 lines
Diff to previous 1.118 (colored)

lint: split 'build' into build_binary and build_unary

No functional change.

Revision 1.118 / (download) - annotate - [select for diffs], Thu Jul 15 17:03:50 2021 UTC (2 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.117: +1 -2 lines
Diff to previous 1.117 (colored)

lint: replace call to ttos with type_name

Since tyname.c 1.20 from 2021-01-02, type_name is as simple to use as
ttos and more expressive.  It can also be called multiple times without
invalidating the returned strings.

Used only in debug mode.

Revision 1.117 / (download) - annotate - [select for diffs], Wed Jul 14 17:07:24 2021 UTC (2 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.116: +2 -1 lines
Diff to previous 1.116 (colored)

lint: extract build_member_access from the grammar

No functional change.

Revision 1.116 / (download) - annotate - [select for diffs], Sat Jul 10 17:35:54 2021 UTC (2 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.115: +3 -3 lines
Diff to previous 1.115 (colored)

lint: rename clrtyp/deftyp to begin_type/end_type

The abbreviations clr/def did not make it obvious that these two
functions or grammar rules form pairs.

No functional change.

Revision 1.115 / (download) - annotate - [select for diffs], Tue Jul 6 04:44:20 2021 UTC (2 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.114: +2 -2 lines
Diff to previous 1.114 (colored)

lint: rename type generic_association_types to generic_association

The word 'types' was misleading and unnecessary.

No functional change.

Revision 1.114 / (download) - annotate - [select for diffs], Tue Jun 29 21:16:54 2021 UTC (2 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.113: +2 -2 lines
Diff to previous 1.113 (colored)

lint: rename xsign to convert_integer

The term sign-extend was too specific, the function actually does a
broader conversion.

No functional change.

Revision 1.113 / (download) - annotate - [select for diffs], Mon Jun 28 08:52:55 2021 UTC (2 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.112: +3 -3 lines
Diff to previous 1.112 (colored)

lint: rename pqinf_t to qual_ptr and clean up code

The 'inf' from the type name meant 'information' and was redundant. Each
object of that type represents a single pointer level, which made the
documentation about 'pointers' a bit confusing.

The members of struct qual_ptr are now in the canonical reading order,
which is 'const volatile pointer'.

No functional change.

Revision 1.112 / (download) - annotate - [select for diffs], Sun Jun 27 20:47:13 2021 UTC (2 years, 8 months ago) by rillig
Branch: MAIN
Changes since 1.111: +4 -1 lines
Diff to previous 1.111 (colored)

lint: fix result type of _Generic expressions

Revision 1.111 / (download) - annotate - [select for diffs], Sun Jun 20 20:59:08 2021 UTC (2 years, 8 months ago) by rillig
Branch: MAIN
Changes since 1.110: +1 -2 lines
Diff to previous 1.110 (colored)

lint: remove unused print_tnode

The function display_expression serves the same purpose and prints more
details.

Revision 1.110 / (download) - annotate - [select for diffs], Sat Jun 19 14:08:45 2021 UTC (2 years, 8 months ago) by rillig
Branch: MAIN
Changes since 1.109: +2 -1 lines
Diff to previous 1.109 (colored)

lint: in debug mode, print name of the "storage class"

This helps in tracking down the internal errors related to declarations,
found by running afl.

Revision 1.109 / (download) - annotate - [select for diffs], Tue Jun 15 20:46:45 2021 UTC (2 years, 8 months ago) by rillig
Branch: MAIN
Changes since 1.108: +1 -2 lines
Diff to previous 1.108 (colored)

lint: replace array access with function calls

First and foremost, the test d_c99_complex_split accessed the array
qlmasks out-of-bounds, with an index of 128 for the type 'double
_Complex'.  This invoked undefined behavior since the maximum allowed
index was 64.

Replacing the raw array accesses with function calls allows for bounds
checks to catch these errors early.

Determining the value bits for a 'double _Complex' does not make sense
at all since it is not an integer type.  This means that lint didn't
handle these types correctly for several years.  Support for int128_t
has been added in inittyp.c 1.12 from 2018-09-07, support for _Complex
has been added in inittyp.c 1.9 from 2008-04-26.

Determining the value bits for an int128_t would make sense, but the
unit tests don't contain examples for this type since at the moment all
unit tests must produce the same results on 32-bit and 64-bit platforms,
and the 32-bit platforms don't support int128_t.

Revision 1.108 / (download) - annotate - [select for diffs], Sun Apr 18 17:36:18 2021 UTC (2 years, 10 months ago) by rillig
Branch: MAIN
CVS Tags: cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Changes since 1.107: +4 -4 lines
Diff to previous 1.107 (colored)

lint: pass pos_t via const pointer

Thanks for the suggestion, christos@.

Revision 1.107 / (download) - annotate - [select for diffs], Sun Apr 18 08:52:04 2021 UTC (2 years, 10 months ago) by rillig
Branch: MAIN
Changes since 1.106: +4 -1 lines
Diff to previous 1.106 (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.106 / (download) - annotate - [select for diffs], Sun Apr 18 08:07:04 2021 UTC (2 years, 10 months ago) by rillig
Branch: MAIN
Changes since 1.105: +2 -2 lines
Diff to previous 1.105 (colored)

lint: do not allow the diagnostics to be modified

Revision 1.105 / (download) - annotate - [select for diffs], Wed Apr 14 20:06:40 2021 UTC (2 years, 10 months ago) by rillig
Branch: MAIN
Changes since 1.104: +2 -1 lines
Diff to previous 1.104 (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.104 / (download) - annotate - [select for diffs], Wed Apr 14 18:35:40 2021 UTC (2 years, 10 months ago) by rillig
Branch: MAIN
Changes since 1.103: +2 -1 lines
Diff to previous 1.103 (colored)

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

Revision 1.103 / (download) - annotate - [select for diffs], Fri Apr 9 15:58:43 2021 UTC (2 years, 10 months ago) by rillig
Branch: MAIN
Changes since 1.102: +2 -2 lines
Diff to previous 1.102 (colored)

lint: clean up handling of preprocessing output lines

No functional change.

Revision 1.102 / (download) - annotate - [select for diffs], Thu Apr 8 22:18:27 2021 UTC (2 years, 10 months ago) by rillig
Branch: MAIN
Changes since 1.101: +2 -1 lines
Diff to previous 1.101 (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.101 / (download) - annotate - [select for diffs], Tue Apr 6 13:17:04 2021 UTC (2 years, 10 months ago) by rillig
Branch: MAIN
Changes since 1.100: +8 -1 lines
Diff to previous 1.100 (colored)

lint: move check for strict bool mode into separate file

No functional change.

Revision 1.100 / (download) - annotate - [select for diffs], Mon Apr 5 02:05:47 2021 UTC (2 years, 10 months ago) by rillig
Branch: MAIN
Changes since 1.99: +8 -1 lines
Diff to previous 1.99 (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.99 / (download) - annotate - [select for diffs], Fri Apr 2 11:53:25 2021 UTC (2 years, 10 months ago) by rillig
Branch: MAIN
Changes since 1.98: +3 -3 lines
Diff to previous 1.98 (colored)

lint: rename functions for duplicating types

No functional change.

Revision 1.98 / (download) - annotate - [select for diffs], Fri Apr 2 10:13:03 2021 UTC (2 years, 10 months ago) by rillig
Branch: MAIN
Changes since 1.97: +8 -8 lines
Diff to previous 1.97 (colored)

lint: name memory allocation functions consistently

No functional change.

Revision 1.97 / (download) - annotate - [select for diffs], Fri Apr 2 09:52:36 2021 UTC (2 years, 10 months ago) by rillig
Branch: MAIN
Changes since 1.96: +2 -2 lines
Diff to previous 1.96 (colored)

lint: rename getnode to expr_zalloc_tnode

The new name highlights that the returned memory is only valid in the
scope of the current expression.  This was misleading before since the
other related functions all have a 't' (probably for 'temporary') in
their names.

Also encode in the function name that the returned memory is zeroed out
as that could not be inferred from the old name.

No functional change.

Revision 1.96 / (download) - annotate - [select for diffs], Fri Apr 2 09:39:25 2021 UTC (2 years, 10 months ago) by rillig
Branch: MAIN
Changes since 1.95: +3 -3 lines
Diff to previous 1.95 (colored)

lint: rename mbl to memory_block

No functional change.

Revision 1.95 / (download) - annotate - [select for diffs], Tue Mar 30 14:25:28 2021 UTC (2 years, 10 months ago) by rillig
Branch: MAIN
Changes since 1.94: +2 -4 lines
Diff to previous 1.94 (colored)

lint: rewrite handling of initializations, fixing several bugs

The previous implementation had a wrong model of how initialization
happens in C99, its assertions failed in all kind of edge cases and it
was not possible to fix the remaining bugs one at a time without running
into even more obscure assertion failures.

The debug logging was detailed but did not help to clarify the
situation.  After about 20 failed attempts at fixing the small details I
decided to start all over and rewrite the initialization code from
scratch.  I left the low-level parts of handling designators, the code
that is independent of brace_level and the high-level parts of how the
parser calls into this module.  Everything else is completely new.

The concept of a brace level stays since that is how C99 describes
initialization.  The previous code could not handle multi-level
designations (see d_init_pop_member.c).  There are no more assertion
failures in the initialization code.

Some TODO comments have been left in the tests to keep the line numbers
the same in this commit.  These will be cleaned up in a follow-up
commit.

The new implementation does not handle initialization with "missing"
braces.  This is an edge case that both GCC and Clang warn about, so it
is not widely used.  If necessary, it may be added later.

The new implementation does not use any global variables in the vast
majority of the functions, to make all dependencies and possible
modifications obvious.

Revision 1.94 / (download) - annotate - [select for diffs], Sun Mar 28 13:09:43 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.93: +8 -8 lines
Diff to previous 1.93 (colored)

lint: sprinkle const on function declarations

No functional change.

Revision 1.93 / (download) - annotate - [select for diffs], Sun Mar 28 10:09:34 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.92: +3 -3 lines
Diff to previous 1.92 (colored)

lint: rename public designator functions

Their previous names were too similar to the actual implementation
functions, which was confusing.

No functional change.

Revision 1.92 / (download) - annotate - [select for diffs], Sat Mar 27 22:04:39 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.91: +1 -2 lines
Diff to previous 1.91 (colored)

lint: rename decl1ext, reduce visibility

No functional change.

Revision 1.91 / (download) - annotate - [select for diffs], Sat Mar 27 12:42:22 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.90: +2 -2 lines
Diff to previous 1.90 (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.90 / (download) - annotate - [select for diffs], Sat Mar 27 12:32:19 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.89: +4 -4 lines
Diff to previous 1.89 (colored)

lint: rename filename management functions

No functional change.

Revision 1.89 / (download) - annotate - [select for diffs], Sat Mar 27 11:50:34 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.88: +2 -2 lines
Diff to previous 1.88 (colored)

lint: rename fnaddreplsrcdir to something less cryptic

No functional change.

Revision 1.88 / (download) - annotate - [select for diffs], Sat Mar 27 11:47:59 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.87: +1 -2 lines
Diff to previous 1.87 (colored)

lint: remove unused fnalloc

Revision 1.87 / (download) - annotate - [select for diffs], Fri Mar 26 18:54:39 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.86: +3 -3 lines
Diff to previous 1.86 (colored)

lint: rename pushctrl and popctrl to be more expressive

While here, remove the magic number 0 that in this context means
"function body".

No functional change.

Revision 1.86 / (download) - annotate - [select for diffs], Fri Mar 26 17:44:52 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.85: +3 -3 lines
Diff to previous 1.85 (colored)

lint: rename pushdecl and popdecl to be more expressive

The previous names were highly ambiguous.  The 'decl' could have meant
'declaration', which would be the usual abbreviation.  It could also be
split into 'dec' and 'l', meaning 'declaration level', which would make
more sense in this particular context.

To avoid having to guess anything about these names, rename the
functions.  Instead of 'push' and 'pop', I renamed them to 'begin' and
'end' since these are the high-level operation that are of interest.
That the hierarchy of declaration levels is implemented as a stack is
nice to know but not as important to understand the whole situation.

No functional change.

Revision 1.85 / (download) - annotate - [select for diffs], Thu Mar 25 21:51:55 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.84: +3 -3 lines
Diff to previous 1.84 (colored)

lint: fix names of functions dealing with designations

These functions modify the whole designation, not only a single
designator.

No functional change.

Revision 1.84 / (download) - annotate - [select for diffs], Tue Mar 23 18:40:50 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.83: +3 -1 lines
Diff to previous 1.83 (colored)

lint: fix wrong error message about type mismatch in compound literal

Now that the code contains explicit markers for starting and ending an
initialization, and having the guarantee that an assertion fails
whenever some code accesses the state of the "current initialization"
even though there is no ongoing initialization gives me much more
confidence in the correctness of the code.  The calls to
begin_initialization and end_initialization always appear in pairs,
enclosing the minimal amount of code necessary for initialization.

In a nutshell, global modifiable state is error-prone and hard to
understand.

A nice side effect is that the grammar no longer needs a special rule
for the outermost initializer since the functions for the debug logging
are now called explicitly.

The code that misuses the initialization state just because it needs to
temporarily store a sym_t somewhere is now clearly marked as such.  A
GCC statement expression can appear anywhere and is therefore
independent of the initialization.  Most probably the code can simply
refer to the local variable in the grammar rule itself, or this variable
needs to be encoded in the grammar %union.  For sure there is a better
way to handle this.

There is no longer a need that the function 'declare' initializes the
initialization state, it was just the wrong place to do this.

Revision 1.83 / (download) - annotate - [select for diffs], Tue Mar 23 17:36:56 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.82: +3 -3 lines
Diff to previous 1.82 (colored)

lint: add indirection for accessing the current initialization

This indirection will be needed to handle nested initializations, which
are a new feature of C99.  These are currently not handled correctly,
see msg_171.c.

No functional change.

Revision 1.82 / (download) - annotate - [select for diffs], Sun Mar 21 19:08:10 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.81: +2 -2 lines
Diff to previous 1.81 (colored)

lint: invert 'rchflag', call it warn_about_unreachable instead

No functional change.

Revision 1.81 / (download) - annotate - [select for diffs], Sun Mar 21 14:49:21 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.80: +6 -6 lines
Diff to previous 1.80 (colored)

lint: rename functions for handling control statements

No functional change.

Revision 1.80 / (download) - annotate - [select for diffs], Sat Mar 20 16:16:32 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.79: +2 -2 lines
Diff to previous 1.79 (colored)

lint: rename ftflg to seen_fallthrough

One less abbreviation to remember when reading the code.

No functional change.

Revision 1.79 / (download) - annotate - [select for diffs], Fri Mar 19 08:23:39 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.78: +2 -2 lines
Diff to previous 1.78 (colored)

lint: use standard form of statement macro for debug_node

No functional change.

Revision 1.78 / (download) - annotate - [select for diffs], Fri Mar 19 08:19:24 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.77: +2 -2 lines
Diff to previous 1.77 (colored)

lint: rename tsize to type_size_in_bits

The shorter name size_in_bits was already taken by the function-like
macro with argument type tspec_t.

No functional change.

Revision 1.77 / (download) - annotate - [select for diffs], Fri Mar 19 00:55:02 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.76: +2 -2 lines
Diff to previous 1.76 (colored)

lint: rename push_member and pop_member

These two functions are supposed to model the designator that is used
for initializing structs and arrays.  The implementation is still buggy
and does not work at all for C99 designators with multiple names, see
d_init_pop_member.c.

For now, just rename the functions to head in the right direction.

No functional change.

Revision 1.76 / (download) - annotate - [select for diffs], Wed Mar 17 15:45:30 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.75: +2 -1 lines
Diff to previous 1.75 (colored)

lint: add debug logging for C99-style initialization of arrays

No functional change outside debug mode.

Revision 1.75 / (download) - annotate - [select for diffs], Wed Mar 17 01:53:21 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.74: +2 -1 lines
Diff to previous 1.74 (colored)

lint: move to_int_constant from the grammar to decl.c

This way, the code is covered by running 'make lint'.  The code from the
grammar is not covered, therefore it still uses int instead of bool in a
few places.

Inline the comparison functions for uint64_t.  These functions didn't
add any clarity to the code.

No functional change.

Revision 1.74 / (download) - annotate - [select for diffs], Wed Mar 17 01:38:31 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.73: +2 -1 lines
Diff to previous 1.73 (colored)

lint: move main part of idecl over to decl.c and rename it

No functional change.

Revision 1.73 / (download) - annotate - [select for diffs], Wed Mar 17 01:15:31 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.72: +3 -3 lines
Diff to previous 1.72 (colored)

lint: rename 'blklev' to 'block_level'

No functional change.

Revision 1.72 / (download) - annotate - [select for diffs], Sun Feb 28 00:23:55 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.71: +2 -2 lines
Diff to previous 1.71 (colored)

lint: rename getbound to alignment_in_bits

No functional change.

Revision 1.71 / (download) - annotate - [select for diffs], Sun Feb 21 15:02:16 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.70: +2 -2 lines
Diff to previous 1.70 (colored)

lint: extract check_non_constant_initializer from init_using_expr

No functional change.

Revision 1.70 / (download) - annotate - [select for diffs], Sun Feb 21 07:59:17 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.69: +2 -2 lines
Diff to previous 1.69 (colored)

lint: fix definition of debug_node in non-debug mode

Revision 1.69 / (download) - annotate - [select for diffs], Sun Feb 21 07:21:57 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.68: +2 -2 lines
Diff to previous 1.68 (colored)

lint: indent node details in debug mode

Revision 1.68 / (download) - annotate - [select for diffs], Sat Feb 20 16:34:57 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.67: +6 -1 lines
Diff to previous 1.67 (colored)

lint: extend debugging for initializing objects

No functional change outside debug mode.

Revision 1.67 / (download) - annotate - [select for diffs], Sat Feb 20 16:03:56 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.66: +2 -3 lines
Diff to previous 1.66 (colored)

lint: rename mkinit to init_using_expr

No functional change outside debug mode.

Revision 1.66 / (download) - annotate - [select for diffs], Fri Feb 19 12:28:56 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.65: +10 -1 lines
Diff to previous 1.65 (colored)

lint: warn about mismatch in getopt handling

Revision 1.65 / (download) - annotate - [select for diffs], Sun Jan 31 12:44:34 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.64: +2 -2 lines
Diff to previous 1.64 (colored)

lint: don't warn about constant condition in 'do { } while (0)'

Revision 1.64 / (download) - annotate - [select for diffs], Sat Jan 30 18:16:45 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.63: +2 -2 lines
Diff to previous 1.63 (colored)

lint: rename incompl to is_incomplete

No functional change.

Revision 1.63 / (download) - annotate - [select for diffs], Sun Jan 24 09:25:16 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.62: +9 -9 lines
Diff to previous 1.62 (colored)

lint: expand abbreviations in lexer function names

No functional change.

Revision 1.62 / (download) - annotate - [select for diffs], Sat Jan 23 23:11:40 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.61: +1 -2 lines
Diff to previous 1.61 (colored)

lint: apply strict bool mode to lex.c

There are 2 remaining expressions:

In line 244, !(kw->kw_deco & deco) is a bitwise and.  This is already
allowed for enums, it needs to be allowed for arbitrary integer
expressions as well.  This covers the many places where plain integers
are used for bit fields, together with #define.  This pattern is not as
typesafe as using enums, still it is common practice.

In line 769, the expression !finite(f) is a legitimate use of a function
that has return type int for traditional reasons.  It's the same as for
ferror.

There are several other functions like unlink, open or strcmp that have
return type int as well, but with a different meaning.  It is not yet
clear what the best way is to handle these different meanings.  Having
to write finite(f) == 0 in strict bool mode doesn't look idiomatic, on
the other hand, !strcmp(s1, s2) is exactly the pattern that strict bool
mode wants to avoid.

Revision 1.61 / (download) - annotate - [select for diffs], Sat Jan 23 22:20:17 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.60: +2 -2 lines
Diff to previous 1.60 (colored)

lint: fix two wrong error messages in strict bool mode

The strict bool mode gets complicated because for system headers the
rules need to be relaxed since they cannot be changed easily, often not at all.

Still, if lint validates a program in strict bool mode, that program
must run with equal behavior regarding boolean expressions even on a
pre-C99 platform.

Revision 1.60 / (download) - annotate - [select for diffs], Sat Jan 23 17:58:03 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.59: +19 -1 lines
Diff to previous 1.59 (colored)

lint: move lexer code from scan.l to lex.c

Previously, the generated scan.c was not included when running "make
lint".  Similarly, cgram.c is still not included.

Revision 1.59 / (download) - annotate - [select for diffs], Mon Jan 18 16:41:57 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.58: +2 -2 lines
Diff to previous 1.58 (colored)

lint: expand abbreviations in function names

Revision 1.58 / (download) - annotate - [select for diffs], Sun Jan 17 23:04:09 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.57: +2 -1 lines
Diff to previous 1.57 (colored)

lint: allow system headers to use int as bool, even in strict bool mode

Revision 1.57 / (download) - annotate - [select for diffs], Sun Jan 17 15:40:27 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.56: +2 -2 lines
Diff to previous 1.56 (colored)

lint: fix return type of conaddr

Revision 1.56 / (download) - annotate - [select for diffs], Sat Jan 16 02:40:02 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.55: +51 -49 lines
Diff to previous 1.55 (colored)

lint: replace 0 and 1 with false and true, where appropriate

Change in behavior: Passing the option -h exactly 4294967296 times or
any multiple thereof is no longer equivalent to passing it never at all,
it is now equivalent to passing it once.  See main2.c, hflag++ for the
actual change.

Other than that, no functional change intended.

A very large portion of the code already conformed to the requirements
of the strict bool mode.  The only missing thing was using the constant
literals false and true instead of 0 and 1.  For sure there are some
integer literals left that can be converted.  For now, all literals that
appeared in the form " = 0" or " = 1" have been replaced.

Revision 1.55 / (download) - annotate - [select for diffs], Tue Jan 12 20:42:01 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.54: +2 -1 lines
Diff to previous 1.54 (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.54 / (download) - annotate - [select for diffs], Mon Jan 11 19:29:49 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.53: +14 -14 lines
Diff to previous 1.53 (colored)

lint: sprinkle a few const modifiers throughout the code

Revision 1.53 / (download) - annotate - [select for diffs], Sun Jan 10 14:09:57 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.52: +2 -2 lines
Diff to previous 1.52 (colored)

lint: change return type of eqptrtype to bool

Revision 1.52 / (download) - annotate - [select for diffs], Sun Jan 10 14:07:34 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.51: +3 -3 lines
Diff to previous 1.51 (colored)

lint: rename functions with short names

Revision 1.51 / (download) - annotate - [select for diffs], Sun Jan 10 11:17:53 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.50: +2 -2 lines
Diff to previous 1.50 (colored)

lint: rename cvtcon to convert_constant

No functional change.

Revision 1.50 / (download) - annotate - [select for diffs], Sat Jan 9 19:13:17 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.49: +2 -2 lines
Diff to previous 1.49 (colored)

lint: change return type of typeok to bool

No functional change.

Revision 1.49 / (download) - annotate - [select for diffs], Sat Jan 9 13:12:13 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.48: +2 -2 lines
Diff to previous 1.48 (colored)

lint: rename ename to enumeration_constant

Revision 1.48 / (download) - annotate - [select for diffs], Sun Jan 3 20:38:26 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.47: +3 -3 lines
Diff to previous 1.47 (colored)

lint: rename funcarg and funccall to longer names

From the previous short names, it was no obvious that these functions
create a new tree node.

The function named funccall in lint2 has been left as-is, since it has a
completely different prototype.

Revision 1.47 / (download) - annotate - [select for diffs], Sun Jan 3 20:31:08 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.46: +4 -4 lines
Diff to previous 1.46 (colored)

lint: rename functions that create nodes

Revision 1.46 / (download) - annotate - [select for diffs], Sun Jan 3 20:14:38 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.45: +3 -3 lines
Diff to previous 1.45 (colored)

lint: rename prflstrg to printflike_argnum, likewise for scflstrg

Revision 1.45 / (download) - annotate - [select for diffs], Sun Jan 3 17:42:45 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.44: +3 -3 lines
Diff to previous 1.44 (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.44 / (download) - annotate - [select for diffs], Sat Jan 2 18:44:58 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.43: +2 -2 lines
Diff to previous 1.43 (colored)

lint: convert bitfieldtype_ok from int to bool

No functional change intended, except for the output in debug mode.

Revision 1.43 / (download) - annotate - [select for diffs], Fri Jan 1 10:55:28 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.42: +4 -2 lines
Diff to previous 1.42 (colored)

lint: split label handling into separate functions

The only thing these cases have in common is the name "label" and the
"reached = 1" assignment.  That's not reason enough to combine
completely unrelated functions.

Revision 1.42 / (download) - annotate - [select for diffs], Wed Dec 30 13:17:42 2020 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.41: +4 -2 lines
Diff to previous 1.41 (colored)

lint: split cluparg into separate functions

That function did more than its short name could express, and the things
it did were not related in any way.

Revision 1.41 / (download) - annotate - [select for diffs], Wed Dec 30 01:33:30 2020 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.40: +3 -1 lines
Diff to previous 1.40 (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.40 / (download) - annotate - [select for diffs], Tue Dec 29 17:29:31 2020 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.39: +3 -2 lines
Diff to previous 1.39 (colored)

lint: split complete_tag into separate functions

Revision 1.39 / (download) - annotate - [select for diffs], Tue Dec 29 16:48:53 2020 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.38: +2 -2 lines
Diff to previous 1.38 (colored)

lint: rename functions for handling the initialization stack

Revision 1.38 / (download) - annotate - [select for diffs], Tue Dec 29 13:33:03 2020 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.37: +24 -24 lines
Diff to previous 1.37 (colored)

lint: rename functions with very short names

Revision 1.37 / (download) - annotate - [select for diffs], Tue Dec 29 10:24:22 2020 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.36: +22 -22 lines
Diff to previous 1.36 (colored)

lint: rename functions that had very short names

C99 guarantees that the first 31 characters of an identifier with
external linkage are significant.  This removes the need to use
abbreviations for common words.

Revision 1.36 / (download) - annotate - [select for diffs], Mon Dec 28 22:31:31 2020 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.35: +2 -2 lines
Diff to previous 1.35 (colored)

lint: rename confusing function setcompl

The previous function name suggested that it would set the complete flag
of the type, but it was the exact opposite.  To reduce confusion, negate
the meaning of the parameter.

Revision 1.34.2.1 / (download) - annotate - [select for diffs], Fri Apr 21 16:54:16 2017 UTC (6 years, 10 months ago) by bouyer
Branch: bouyer-socketcan
Changes since 1.34: +2 -1 lines
Diff to previous 1.34 (colored) next main 1.35 (colored)

Sync with HEAD

Revision 1.32.6.2 / (download) - annotate - [select for diffs], Mon Mar 20 06:58:06 2017 UTC (6 years, 11 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.32.6.1: +2 -1 lines
Diff to previous 1.32.6.1 (colored) to branchpoint 1.32 (colored) next main 1.33 (colored)

Sync with HEAD

Revision 1.35 / (download) - annotate - [select for diffs], Mon Mar 6 21:01:39 2017 UTC (6 years, 11 months ago) by christos
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, phil-wifi-base, phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, phil-wifi-20191119, phil-wifi-20190609, phil-wifi, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-compat-merge-20190127, pgoyette-compat-base, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, 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, pgoyette-compat, perseant-stdc-iso10646-base, perseant-stdc-iso10646, 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, 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, is-mlppp-base, is-mlppp, bouyer-socketcan-base1
Changes since 1.34: +2 -1 lines
Diff to previous 1.34 (colored)

fix typeof, add __builtin_offsetof

Revision 1.32.6.1 / (download) - annotate - [select for diffs], Sat Jan 7 08:56:59 2017 UTC (7 years, 1 month ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.32: +4 -1 lines
Diff to previous 1.32 (colored)

Sync with HEAD.  (Note that most of these changes are simply $NetBSD$
tag issues.)

Revision 1.34 / (download) - annotate - [select for diffs], Tue Dec 27 21:52:35 2016 UTC (7 years, 2 months ago) by christos
Branch: MAIN
CVS Tags: pgoyette-localcount-20170107, bouyer-socketcan-base
Branch point for: bouyer-socketcan
Changes since 1.33: +2 -1 lines
Diff to previous 1.33 (colored)

teach lint __attribute__((__unused__))

Revision 1.33 / (download) - annotate - [select for diffs], Sat Dec 24 17:43:45 2016 UTC (7 years, 2 months ago) by christos
Branch: MAIN
Changes since 1.32: +3 -1 lines
Diff to previous 1.32 (colored)

Add -R (source filename remapping) for MKREPRO

Revision 1.30.10.2 / (download) - annotate - [select for diffs], Wed Aug 20 00:05:06 2014 UTC (9 years, 6 months ago) by tls
Branch: tls-maxphys
Changes since 1.30.10.1: +1 -0 lines
Diff to previous 1.30.10.1 (colored) to branchpoint 1.30 (colored) next main 1.31 (colored)

Rebase to HEAD as of a few days ago.

Revision 1.31.4.1 / (download) - annotate - [select for diffs], Sun Aug 10 06:59:20 2014 UTC (9 years, 6 months ago) by tls
Branch: tls-earlyentropy
Changes since 1.31: +2 -1 lines
Diff to previous 1.31 (colored) next main 1.32 (colored)

Rebase.

Revision 1.30.4.1 / (download) - annotate - [select for diffs], Thu May 22 11:42:52 2014 UTC (9 years, 9 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.30: +3 -2 lines
Diff to previous 1.30 (colored) next main 1.31 (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.32 / (download) - annotate - [select for diffs], Fri Apr 18 00:23:46 2014 UTC (9 years, 10 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pagecache-base9, tls-maxphys-base, tls-earlyentropy-base, pgoyette-localcount-base, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, 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, localcount-20160914
Branch point for: pgoyette-localcount
Changes since 1.31: +2 -1 lines
Diff to previous 1.31 (colored)

Handle the rest of gcc __attribute__ s.

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

resync from head

Revision 1.31 / (download) - annotate - [select for diffs], Fri Apr 19 17:43:05 2013 UTC (10 years, 10 months ago) by christos
Branch: MAIN
CVS Tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2
Branch point for: tls-earlyentropy
Changes since 1.30: +2 -2 lines
Diff to previous 1.30 (colored)

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

Revision 1.29.2.1 / (download) - annotate - [select for diffs], Tue Feb 8 16:20:13 2011 UTC (13 years ago) by bouyer
Branch: bouyer-quota2
Changes since 1.29: +1 -2 lines
Diff to previous 1.29 (colored) next main 1.30 (colored)

Sync with HEAD

Revision 1.30 / (download) - annotate - [select for diffs], Sat Feb 5 17:14:14 2011 UTC (13 years ago) by christos
Branch: MAIN
CVS Tags: yamt-pagecache-tag8, yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, yamt-pagecache-base5, 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, cherry-xenmp-base, cherry-xenmp, bouyer-quota2-nbase, bouyer-quota2-base, agc-symver-base, agc-symver
Branch point for: yamt-pagecache, tls-maxphys
Changes since 1.29: +1 -2 lines
Diff to previous 1.29 (colored)

as promised make the last ops table auto-generated.

Revision 1.29 / (download) - annotate - [select for diffs], Fri Oct 2 21:04:03 2009 UTC (14 years, 4 months ago) by christos
Branch: MAIN
CVS Tags: matt-premerge-20091211, matt-mips64-premerge-20101231
Branch point for: bouyer-quota2
Changes since 1.28: +2 -1 lines
Diff to previous 1.28 (colored)

compute sizes by the new tsize() function.

Revision 1.28 / (download) - annotate - [select for diffs], Fri Oct 2 15:03:45 2009 UTC (14 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.27: +2 -1 lines
Diff to previous 1.27 (colored)

understand __attribute__((__packed__)) and __packed.

Revision 1.24.2.1 / (download) - annotate - [select for diffs], Wed May 13 19:20:13 2009 UTC (14 years, 9 months ago) by jym
Branch: jym-xensuspend
Changes since 1.24: +4 -2 lines
Diff to previous 1.24 (colored) next main 1.25 (colored)

Sync with HEAD.

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

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

Add __alignof__.

Revision 1.26 / (download) - annotate - [select for diffs], Wed Apr 15 01:20:57 2009 UTC (14 years, 10 months ago) by christos
Branch: MAIN
Changes since 1.25: +2 -2 lines
Diff to previous 1.25 (colored)

Lukemify (WARNS=4)

Revision 1.25 / (download) - annotate - [select for diffs], Mon Mar 2 20:53:10 2009 UTC (14 years, 11 months ago) by christos
Branch: MAIN
Changes since 1.24: +2 -1 lines
Diff to previous 1.24 (colored)

Don't produce type mismatch warnings if one side of ?: is "[qual] void *"
and the other side is "[qual] pointer".

Revision 1.24 / (download) - annotate - [select for diffs], Sun Nov 16 07:06:37 2008 UTC (15 years, 3 months ago) by dholland
Branch: MAIN
Branch point for: jym-xensuspend
Changes since 1.23: +2 -2 lines
Diff to previous 1.23 (colored)

WARNS=4

Revision 1.22.18.1 / (download) - annotate - [select for diffs], Thu Sep 18 04:29:28 2008 UTC (15 years, 5 months ago) by wrstuden
Branch: wrstuden-revivesa
Changes since 1.22: +2 -1 lines
Diff to previous 1.22 (colored) next main 1.23 (colored)

Sync with wrstuden-revivesa-base-2.

Revision 1.23 / (download) - annotate - [select for diffs], Thu Jul 31 15:21:34 2008 UTC (15 years, 6 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
Changes since 1.22: +2 -1 lines
Diff to previous 1.22 (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.22 / (download) - annotate - [select for diffs], Sat Oct 14 21:08:50 2006 UTC (17 years, 4 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base4, yamt-pf42-base3, yamt-pf42-base2, yamt-pf42-base, yamt-pf42, wrstuden-revivesa-base-1, wrstuden-revivesa-base, 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-nbase, matt-armv6-base, matt-armv6, keiichi-mipv6-nbase, keiichi-mipv6-base, keiichi-mipv6, hpcarm-cleanup-nbase, hpcarm-cleanup-base, hpcarm-cleanup, cube-autoconf-base, cube-autoconf
Branch point for: wrstuden-revivesa
Changes since 1.21: +6 -1 lines
Diff to previous 1.21 (colored)

Fix c99 initialization issues. Now the regression tests work.

Revision 1.21 / (download) - annotate - [select for diffs], Thu Apr 7 16:28:40 2005 UTC (18 years, 10 months ago) by christos
Branch: MAIN
CVS Tags: chap-midi-nbase, chap-midi-base, chap-midi, abandoned-netbsd-4-base, abandoned-netbsd-4
Changes since 1.20: +1 -3 lines
Diff to previous 1.20 (colored)

Factor out tyname() so that it can be used both by lint1 and lint2.
Since type_t is different between lint1.h and lint2.h include the
appropriate file depending on the pass. Make the argument mismatch
error print the type names of the types involved. Now that we have
a tyname() function we can fix the rest of the pass2 warnings to be
more explanatory, but not now.

Revision 1.20 / (download) - annotate - [select for diffs], Sat Nov 2 20:09:27 2002 UTC (21 years, 3 months ago) by perry
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, 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-base, 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-0, netbsd-2, fvdl_fs64_base
Changes since 1.19: +2 -1 lines
Diff to previous 1.19 (colored)

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

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

add support for ({}) gcc shit.

Revision 1.18 / (download) - annotate - [select for diffs], Tue Oct 22 18:15:00 2002 UTC (21 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.17: +3 -1 lines
Diff to previous 1.17 (colored)

add C9X/GCC compound literal expressions.

Revision 1.17 / (download) - annotate - [select for diffs], Tue Oct 22 13:48:52 2002 UTC (21 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.16: +2 -2 lines
Diff to previous 1.16 (colored)

add variable array dimension.

Revision 1.16 / (download) - annotate - [select for diffs], Mon Oct 21 21:14:52 2002 UTC (21 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.15: +2 -0 lines
Diff to previous 1.15 (colored)

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

Revision 1.15 / (download) - annotate - [select for diffs], Fri Sep 13 14:59:24 2002 UTC (21 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.14: +4 -4 lines
Diff to previous 1.14 (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.14 / (download) - annotate - [select for diffs], Tue Feb 5 03:04:28 2002 UTC (22 years ago) by thorpej
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.13: +5 -5 lines
Diff to previous 1.13 (colored)

Replace u_quad_t with uint64_t and quad_t with int64_t, and use
<inttypes.h> to get those type definitions.  These types are more
portable, and a little more sane to do autoconf tests for.

Revision 1.13 / (download) - annotate - [select for diffs], Fri Jan 18 21:01:39 2002 UTC (22 years, 1 month ago) by thorpej
Branch: MAIN
Changes since 1.12: +1 -2 lines
Diff to previous 1.12 (colored)

Centralize the initialization/declaration of the ttab.

Revision 1.12 / (download) - annotate - [select for diffs], Thu Jan 3 04:25:15 2002 UTC (22 years, 1 month ago) by thorpej
Branch: MAIN
Changes since 1.11: +3 -1 lines
Diff to previous 1.11 (colored)

* Add header files (ilp32.h and lp64.h) that describe the two
  models of type sizes that we currently support, and include
  the appropriate one in each arch's targparam.h.
* Use the type size constants provided by targparam.h in the
  type table, rather than using "sizeof(type) * CHAR_BIT" (which
  would get the host's type size, not the target's).  XXX Not
  yet done for floating point types.
* Add a new BITFIELDTYPE lint comment that suppresses illegal
  bitfield type errors if the type is an integer type (e.g.
  long, long long), and also suppresses non-portable bitfield
  type warnings.

Revision 1.11 / (download) - annotate - [select for diffs], Mon May 28 12:40:37 2001 UTC (22 years, 9 months ago) by lukem
Branch: MAIN
Changes since 1.10: +154 -154 lines
Diff to previous 1.10 (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.8.2.1 / (download) - annotate - [select for diffs], Thu Oct 19 16:33:20 2000 UTC (23 years, 4 months ago) by he
Branch: netbsd-1-4
CVS Tags: netbsd-1-4-PATCH003
Changes since 1.8: +3 -2 lines
Diff to previous 1.8 (colored) next main 1.9 (colored)

Pull up revision 1.10 (requested by he):
  Format string cleanup.

Revision 1.8.10.1 / (download) - annotate - [select for diffs], Wed Oct 18 01:32:54 2000 UTC (23 years, 4 months ago) by tv
Branch: netbsd-1-5
CVS Tags: netbsd-1-5-RELEASE, netbsd-1-5-PATCH003, netbsd-1-5-PATCH002, netbsd-1-5-PATCH001, netbsd-1-5-BETA2, netbsd-1-5-BETA
Changes since 1.8: +3 -2 lines
Diff to previous 1.8 (colored) next main 1.9 (colored)

Pullup usr.bin string format fixes [is].
See "cvs log" for explicit revision numbers per file, from sommerfeld.

Revision 1.10 / (download) - annotate - [select for diffs], Wed Oct 11 14:46:23 2000 UTC (23 years, 4 months ago) by is
Branch: MAIN
Changes since 1.9: +3 -2 lines
Diff to previous 1.9 (colored)

More format string cleanup by sommerfeld.

Revision 1.9 / (download) - annotate - [select for diffs], Thu Jul 6 01:09:56 2000 UTC (23 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.8: +3 -1 lines
Diff to previous 1.8 (colored)

new function and new flag...

Revision 1.8 / (download) - annotate - [select for diffs], Sun Feb 22 15:40:39 1998 UTC (26 years ago) by christos
Branch: MAIN
CVS Tags: wrstuden-devbsize-base, wrstuden-devbsize-19991221, wrstuden-devbsize, netbsd-1-5-base, netbsd-1-5-ALPHA2, netbsd-1-4-base, netbsd-1-4-RELEASE, netbsd-1-4-PATCH002, netbsd-1-4-PATCH001, minoura-xpg4dl-base, minoura-xpg4dl, comdex-fall-1999-base, comdex-fall-1999
Branch point for: netbsd-1-5, netbsd-1-4
Changes since 1.7: +2 -2 lines
Diff to previous 1.7 (colored)

WARNSify

Revision 1.7 / (download) - annotate - [select for diffs], Mon Oct 2 17:31:39 1995 UTC (28 years, 5 months ago) by jpo
Branch: MAIN
CVS Tags: netbsd-1-3-base, 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, netbsd-1-3, 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
Changes since 1.6: +5 -4 lines
Diff to previous 1.6 (colored)

don't print warnings about unused variables or arguments in compound
statements which contain asm statements.

Revision 1.6 / (download) - annotate - [select for diffs], Mon Oct 2 17:29:52 1995 UTC (28 years, 5 months ago) by jpo
Branch: MAIN
Changes since 1.5: +6 -4 lines
Diff to previous 1.5 (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.5 / (download) - annotate - [select for diffs], Mon Oct 2 17:26:55 1995 UTC (28 years, 5 months ago) by jpo
Branch: MAIN
Changes since 1.4: +2 -1 lines
Diff to previous 1.4 (colored)

support asm statements and asm modifiers in declarations

asm statements consist of an asm keyword, an optional qualifier, a
left paren, a list of tokens up to and including the matching right
paren, and a semicolon.

asm modifiers consist of an asm keyword, an left paren, a string and a
right paren.

asm statements and modifiers have no semantic for lint(1), they exist only
to avoid complaints about them.

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

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

Revision 1.3 / (download) - annotate - [select for diffs], Mon Oct 2 17:14:22 1995 UTC (28 years, 5 months ago) by jpo
Branch: MAIN
Changes since 1.2: +3 -2 lines
Diff to previous 1.2 (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:08 1995 UTC (28 years, 8 months ago) by cgd
Branch: MAIN
Changes since 1.1: +2 -2 lines
Diff to previous 1.1 (colored)

RCS id cleanup

Revision 1.1.1.1 / (download) - annotate - [select for diffs] (vendor branch), Mon Jul 3 20:56:37 1995 UTC (28 years, 8 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)

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:37 1995 UTC (28 years, 8 months ago) by cgd
Branch: MAIN

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>