The NetBSD Project

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

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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.185 / (download) - annotate - [select for diffs], Wed Mar 27 19:28:20 2024 UTC (16 hours, 39 minutes ago) by rillig
Branch: MAIN
CVS Tags: HEAD
Changes since 1.184: +6 -6 lines
Diff to previous 1.184 (colored) to selected 1.77 (colored)

lint: don't use 'long' in diagnostics

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

Revision 1.184 / (download) - annotate - [select for diffs], Sat Mar 9 13:54:47 2024 UTC (2 weeks, 4 days ago) by rillig
Branch: MAIN
Changes since 1.183: +11 -11 lines
Diff to previous 1.183 (colored) to selected 1.77 (colored)

lint: inline accessor macros for tnode_t

Revision 1.183 / (download) - annotate - [select for diffs], Sat Mar 9 13:20:55 2024 UTC (2 weeks, 4 days ago) by rillig
Branch: MAIN
Changes since 1.182: +7 -7 lines
Diff to previous 1.182 (colored) to selected 1.77 (colored)

lint: inline accessor macros for type_t

Revision 1.182 / (download) - annotate - [select for diffs], Sat Mar 9 10:54:12 2024 UTC (2 weeks, 5 days ago) by rillig
Branch: MAIN
Changes since 1.181: +33 -31 lines
Diff to previous 1.181 (colored) to selected 1.77 (colored)

lint: internally store case label values in order of appearance

Revision 1.181 / (download) - annotate - [select for diffs], Thu Feb 8 20:45:20 2024 UTC (6 weeks, 6 days ago) by rillig
Branch: MAIN
Changes since 1.180: +13 -24 lines
Diff to previous 1.180 (colored) to selected 1.77 (colored)

lint: clean up redundant braces

No functional change.

Revision 1.180 / (download) - annotate - [select for diffs], Sat Feb 3 12:57:12 2024 UTC (7 weeks, 4 days ago) by rillig
Branch: MAIN
Changes since 1.179: +57 -161 lines
Diff to previous 1.179 (colored) to selected 1.77 (colored)

lint: clean up comments, reduce scope of variables

Revision 1.179 / (download) - annotate - [select for diffs], Sat Jan 6 15:05:24 2024 UTC (2 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.178: +3 -3 lines
Diff to previous 1.178 (colored) to selected 1.77 (colored)

lint: remove redundant parentheses, braces and comments

Rename the functions for folding constant expressions, to make the
comments redundant.

Revision 1.178 / (download) - annotate - [select for diffs], Sun Dec 3 18:17:41 2023 UTC (3 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.177: +20 -20 lines
Diff to previous 1.177 (colored) to selected 1.77 (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.177 / (download) - annotate - [select for diffs], Sun Dec 3 13:12:40 2023 UTC (3 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.176: +39 -41 lines
Diff to previous 1.176 (colored) to selected 1.77 (colored)

lint: re-wrap comments

No functional change.

Revision 1.176 / (download) - annotate - [select for diffs], Sun Dec 3 12:03:38 2023 UTC (3 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.175: +5 -5 lines
Diff to previous 1.175 (colored) to selected 1.77 (colored)

lint: indent statement continuations consistently

No binary change.

Revision 1.175 / (download) - annotate - [select for diffs], Sat Dec 2 21:50:20 2023 UTC (3 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.174: +2 -4 lines
Diff to previous 1.174 (colored) to selected 1.77 (colored)

lint: remove redundant empty lines

No functional change.

Revision 1.174 / (download) - annotate - [select for diffs], Sun Aug 6 19:44:50 2023 UTC (7 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.173: +9 -8 lines
Diff to previous 1.173 (colored) to selected 1.77 (colored)

lint: since C99, a non-void function must return a value

Revision 1.173 / (download) - annotate - [select for diffs], Wed Aug 2 18:51:25 2023 UTC (7 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.172: +30 -29 lines
Diff to previous 1.172 (colored) to selected 1.77 (colored)

lint: distinguish between arguments and parameters

Revision 1.172 / (download) - annotate - [select for diffs], Sat Jul 29 07:49:14 2023 UTC (7 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.171: +7 -12 lines
Diff to previous 1.171 (colored) to selected 1.77 (colored)

lint: condense code for ending a function

No functional change.

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

lint: add detailed logging for finding memory allocation bugs

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

lint: indent copyright lines consistently

Revision 1.169 / (download) - annotate - [select for diffs], Thu Jul 13 07:19:24 2023 UTC (8 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.168: +28 -61 lines
Diff to previous 1.168 (colored) to selected 1.77 (colored)

lint: reduce code size for handling lint comments

Revision 1.168 / (download) - annotate - [select for diffs], Thu Jul 13 06:41:27 2023 UTC (8 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.167: +23 -58 lines
Diff to previous 1.167 (colored) to selected 1.77 (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.167 / (download) - annotate - [select for diffs], Sun Jul 9 12:15:07 2023 UTC (8 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.166: +4 -5 lines
Diff to previous 1.166 (colored) to selected 1.77 (colored)

lint: miscellaneous cleanup

Revision 1.166 / (download) - annotate - [select for diffs], Sun Jul 9 11:01:27 2023 UTC (8 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.165: +4 -4 lines
Diff to previous 1.165 (colored) to selected 1.77 (colored)

lint: clean up the wording of a few diagnostics

Revision 1.165 / (download) - annotate - [select for diffs], Mon Jul 3 10:23:12 2023 UTC (8 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.164: +3 -3 lines
Diff to previous 1.164 (colored) to selected 1.77 (colored)

lint: invert the -u, -v and -z flags

Now they behave the same as in the manual page.

No functional change.

Revision 1.164 / (download) - annotate - [select for diffs], Mon Jul 3 07:03:19 2023 UTC (8 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.163: +4 -4 lines
Diff to previous 1.163 (colored) to selected 1.77 (colored)

lint: rename uppercase QUAD to LLONG

No binary change.

Revision 1.163 / (download) - annotate - [select for diffs], Sun Jul 2 18:14:44 2023 UTC (8 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.162: +10 -10 lines
Diff to previous 1.162 (colored) to selected 1.77 (colored)

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

No functional change.

Revision 1.162 / (download) - annotate - [select for diffs], Sun Jul 2 10:20:45 2023 UTC (8 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.161: +3 -3 lines
Diff to previous 1.161 (colored) to selected 1.77 (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.161 / (download) - annotate - [select for diffs], Sat Jul 1 09:31:55 2023 UTC (8 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.160: +3 -3 lines
Diff to previous 1.160 (colored) to selected 1.77 (colored)

lint: clean up duplicate and dead code for integer constants

No functional change.

Revision 1.160 / (download) - annotate - [select for diffs], Fri Jun 30 21:39:54 2023 UTC (8 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.159: +9 -9 lines
Diff to previous 1.159 (colored) to selected 1.77 (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.159 / (download) - annotate - [select for diffs], Thu Jun 29 22:52:44 2023 UTC (8 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.158: +3 -3 lines
Diff to previous 1.158 (colored) to selected 1.77 (colored)

lint: clean up member names of declaration levels

No functional change outside debug mode.

Revision 1.158 / (download) - annotate - [select for diffs], Thu Jun 29 09:58:36 2023 UTC (8 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.157: +20 -71 lines
Diff to previous 1.157 (colored) to selected 1.77 (colored)

lint: clean up function names

No functional change.

Revision 1.157 / (download) - annotate - [select for diffs], Sat Jun 24 20:50:54 2023 UTC (9 months ago) by rillig
Branch: MAIN
Changes since 1.156: +4 -4 lines
Diff to previous 1.156 (colored) to selected 1.77 (colored)

lint: reduce memory allocations

The type val_t has the same size as the tn_s member in the same union.

No functional change.

Revision 1.156 / (download) - annotate - [select for diffs], Fri Jun 9 15:36:31 2023 UTC (9 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.155: +5 -6 lines
Diff to previous 1.155 (colored) to selected 1.77 (colored)

lint: miscellaneous clean-ups

No binary change, except for line numbers in assertions.

Revision 1.155 / (download) - annotate - [select for diffs], Fri Jun 9 13:03:49 2023 UTC (9 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.154: +16 -16 lines
Diff to previous 1.154 (colored) to selected 1.77 (colored)

lint: indent local variables consistently

No binary change.

Revision 1.154 / (download) - annotate - [select for diffs], Thu May 11 08:01:36 2023 UTC (10 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.153: +4 -3 lines
Diff to previous 1.153 (colored) to selected 1.77 (colored)

lint: fix type name in diagnostic for enum as controlling expression

Previously, the type was reported as 'int' instead of 'enum'.

Continue to only report the type simple for pointer types, as the exact
pointer type is irrelevant to this message.

Revision 1.153 / (download) - annotate - [select for diffs], Sat Apr 15 11:34:45 2023 UTC (11 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.152: +17 -2 lines
Diff to previous 1.152 (colored) to selected 1.77 (colored)

lint: add query for parenthesized return value

Revision 1.152 / (download) - annotate - [select for diffs], Sat Apr 15 10:32:46 2023 UTC (11 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.151: +32 -34 lines
Diff to previous 1.151 (colored) to selected 1.77 (colored)

lint: extract checking the return value to separate function

No functional change.

Revision 1.151 / (download) - annotate - [select for diffs], Tue Mar 28 20:01:21 2023 UTC (12 months ago) by rillig
Branch: MAIN
Changes since 1.150: +3 -6 lines
Diff to previous 1.150 (colored) to selected 1.77 (colored)

lint: clean up comments for handling 'linted' comments

No functional change.

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

lint: warn about extern declarations outside headers

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

Revision 1.149 / (download) - annotate - [select for diffs], Tue Feb 21 19:47:21 2023 UTC (13 months ago) by rillig
Branch: MAIN
Changes since 1.148: +8 -4 lines
Diff to previous 1.148 (colored) to selected 1.77 (colored)

lint: fix null pointer dereference in invalid case expression

Revision 1.148 / (download) - annotate - [select for diffs], Sat Feb 18 15:18:49 2023 UTC (13 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.147: +2 -8 lines
Diff to previous 1.147 (colored) to selected 1.77 (colored)

lint: remove redundant comments

Revision 1.147 / (download) - annotate - [select for diffs], Sun Jan 29 18:37:20 2023 UTC (13 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.146: +4 -2 lines
Diff to previous 1.146 (colored) to selected 1.77 (colored)

lint: properly clean up when leaving a function definition

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

lint: rename functions for function definition

No functional change.

Revision 1.145 / (download) - annotate - [select for diffs], Sat Oct 1 09:42:40 2022 UTC (17 months, 3 weeks ago) by rillig
Branch: MAIN
CVS Tags: netbsd-10-base, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10
Changes since 1.144: +6 -6 lines
Diff to previous 1.144 (colored) to selected 1.77 (colored)

lint: add hyphen to adjective 'old-style'

Revision 1.144 / (download) - annotate - [select for diffs], Sun Aug 28 19:09:12 2022 UTC (18 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.143: +3 -3 lines
Diff to previous 1.143 (colored) to selected 1.77 (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.143 / (download) - annotate - [select for diffs], Sun Jul 3 07:33:08 2022 UTC (20 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.142: +3 -3 lines
Diff to previous 1.142 (colored) to selected 1.77 (colored)

lint: verify that comment above warning_at matches the message

No binary change.

Revision 1.142 / (download) - annotate - [select for diffs], Wed Jun 22 19:23:17 2022 UTC (21 months ago) by rillig
Branch: MAIN
Changes since 1.141: +20 -20 lines
Diff to previous 1.141 (colored) to selected 1.77 (colored)

lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.

Revision 1.141 / (download) - annotate - [select for diffs], Mon Jun 20 21:13:35 2022 UTC (21 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.140: +3 -3 lines
Diff to previous 1.140 (colored) to selected 1.77 (colored)

lint: add quotes around several placeholders in messages

Revision 1.140 / (download) - annotate - [select for diffs], Wed Jun 15 18:29:21 2022 UTC (21 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.139: +3 -3 lines
Diff to previous 1.139 (colored) to selected 1.77 (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.139 / (download) - annotate - [select for diffs], Sat Jun 11 12:23:59 2022 UTC (21 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.138: +4 -4 lines
Diff to previous 1.138 (colored) to selected 1.77 (colored)

lint: add quotes around placeholders for a few more messages

Revision 1.138 / (download) - annotate - [select for diffs], Thu May 26 13:40:49 2022 UTC (22 months ago) by rillig
Branch: MAIN
Changes since 1.137: +10 -9 lines
Diff to previous 1.137 (colored) to selected 1.77 (colored)

lint: rename olwarn and LWARN_BAD to be more expressive

No functional change.

Revision 1.137 / (download) - annotate - [select for diffs], Sun May 22 13:58:59 2022 UTC (22 months ago) by rillig
Branch: MAIN
Changes since 1.136: +3 -3 lines
Diff to previous 1.136 (colored) to selected 1.77 (colored)

lint: fix wrong warning about unhandled enum constants in switch

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

lint: use __RCSID in lint mode as well

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

No binary change.

Revision 1.135 / (download) - annotate - [select for diffs], Sat Apr 30 22:31:23 2022 UTC (22 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.134: +7 -4 lines
Diff to previous 1.134 (colored) to selected 1.77 (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.134 / (download) - annotate - [select for diffs], Sat Apr 30 21:38:03 2022 UTC (22 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.133: +4 -4 lines
Diff to previous 1.133 (colored) to selected 1.77 (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.133 / (download) - annotate - [select for diffs], Sat Apr 30 19:18:48 2022 UTC (22 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.132: +3 -3 lines
Diff to previous 1.132 (colored) to selected 1.77 (colored)

lint: inline macro Sflag in cases of expected behavior

In the grammar rules 'enums_with_opt_comma' and 'block_item_list',
checking for allow_c99 was redundant since c99ism does not warn in C99
mode.

In the grammar rule 'designator', align the two actions structurally.

No functional change.

Revision 1.132 / (download) - annotate - [select for diffs], Sat Apr 9 23:41:22 2022 UTC (23 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.131: +9 -9 lines
Diff to previous 1.131 (colored) to selected 1.77 (colored)

lint: distinguish between storage class and declaration kind

These types overlap but are not the same.

No functional change.

Revision 1.131 / (download) - annotate - [select for diffs], Sat Apr 9 13:38:17 2022 UTC (23 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.130: +3 -3 lines
Diff to previous 1.130 (colored) to selected 1.77 (colored)

lint: inline member access macros for sym_t

Having the 'u.' explicitly in the code serves as a reminder that these
members are only defined under certain conditions.

No functional change.

Revision 1.130 / (download) - annotate - [select for diffs], Sat Apr 2 20:12:46 2022 UTC (23 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.129: +4 -2 lines
Diff to previous 1.129 (colored) to selected 1.77 (colored)

lint: try harder to recover after syntax errors

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

Revision 1.129 / (download) - annotate - [select for diffs], Sat Apr 2 14:28:30 2022 UTC (23 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.128: +5 -5 lines
Diff to previous 1.128 (colored) to selected 1.77 (colored)

lint: rename dinfo_t.d_next to d_enclosing

The name d_next gave the wrong impression that the declaration infos
would be independent of each other, but they are nested.

No functional change.

Revision 1.128 / (download) - annotate - [select for diffs], Sun Feb 27 10:44:45 2022 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.127: +4 -3 lines
Diff to previous 1.127 (colored) to selected 1.77 (colored)

lint: unabbreviate some fields in sym_t

No functional change.

Revision 1.127 / (download) - annotate - [select for diffs], Sun Feb 27 08:31:26 2022 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.126: +3 -3 lines
Diff to previous 1.126 (colored) to selected 1.77 (colored)

lint: encode lifetime of allocated memory in the function names

No functional change.

Revision 1.126 / (download) - annotate - [select for diffs], Tue Nov 16 21:01:05 2021 UTC (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.125: +4 -4 lines
Diff to previous 1.125 (colored) to selected 1.77 (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.125 / (download) - annotate - [select for diffs], Tue Nov 16 17:41:23 2021 UTC (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.124: +4 -4 lines
Diff to previous 1.124 (colored) to selected 1.77 (colored)

lint: rename attron to in_gcc_attribute

No functional change.

Revision 1.124 / (download) - annotate - [select for diffs], Sat Sep 4 12:37:46 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.123: +3 -4 lines
Diff to previous 1.123 (colored) to selected 1.77 (colored)

lint: remove redundant and duplicate code

Revision 1.123 / (download) - annotate - [select for diffs], Sat Sep 4 12:30:46 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.122: +3 -3 lines
Diff to previous 1.122 (colored) to selected 1.77 (colored)

lint: spell out abbreviations in comments

No functional change.

Revision 1.122 / (download) - annotate - [select for diffs], Sat Aug 28 13:29:26 2021 UTC (2 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.121: +3 -3 lines
Diff to previous 1.121 (colored) to selected 1.77 (colored)

lint: explicitly ignore return value of some function calls

This fixes the warning from lint2 that these functions return values
which are sometimes ignored.

The remaining calls to fprintf that ignore the return value come from
scan.c.  Lint does not currently detect the auto-generated portions of
that file and the interesting ones since it assumes that scan.c is the
main filename, see expr_zalloc_tnode.

No functional change.

Revision 1.121 / (download) - annotate - [select for diffs], Sat Aug 28 12:21:53 2021 UTC (2 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.120: +3 -3 lines
Diff to previous 1.120 (colored) to selected 1.77 (colored)

lint: un-abbreviate unsigned integer types

No functional change.

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

lint: use standard quotes in messages 203 and 271

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

lint: add quotes around placeholder in message 214

function '%s' expects to return value

Revision 1.118 / (download) - annotate - [select for diffs], Sun Aug 1 06:40:37 2021 UTC (2 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.117: +4 -6 lines
Diff to previous 1.117 (colored) to selected 1.77 (colored)

lint: add debug logging for symbol table, clean up debug logging

When I tried to fix msg_115, I quickly ran into a segmentation fault,
probably related to the symbol table.  To better understand this part,
log insertions and deletions.

The other debug log messages do not need to mention the current file
position anymore, this is what lex_next_line takes care of since scan.l
1.113 from 2021-01-05.

Revision 1.117 / (download) - annotate - [select for diffs], Sat Jul 31 19:07:52 2021 UTC (2 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.116: +8 -12 lines
Diff to previous 1.116 (colored) to selected 1.77 (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.116 / (download) - annotate - [select for diffs], Sat Jul 31 11:03:04 2021 UTC (2 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.115: +3 -4 lines
Diff to previous 1.115 (colored) to selected 1.77 (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.115 / (download) - annotate - [select for diffs], Fri Jul 23 17:06:37 2021 UTC (2 years, 8 months ago) by rillig
Branch: MAIN
Changes since 1.114: +52 -52 lines
Diff to previous 1.114 (colored) to selected 1.77 (colored)

lint: rename cstk_t to control_statement

Rename the variables as well.  Their previous name 'ci' was not easy to
understand, the 'i' may have meant 'stack item'.  The new name 'cs'
simply means 'control statement'.

No functional change.

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

lint: split 'build' into build_binary and build_unary

No functional change.

Revision 1.113 / (download) - annotate - [select for diffs], Sun Jul 4 07:09:39 2021 UTC (2 years, 8 months ago) by rillig
Branch: MAIN
Changes since 1.112: +2 -3 lines
Diff to previous 1.112 (colored) to selected 1.77 (colored)

lint: in strict bool mode, continue after error message

If a controlling expression is not of type bool but of any other scalar
type, keep the expression.  Its value is still useful for control flow
analysis.

This prevents an assertion failure when running lint on the generated
scan.c, which contains a "while (1)" that does not stem from a system
header.  If it did, lint would accept it, see tn_from_system_header. But
"scan.c" is not considered a system header.  Maybe lint's definition of
a system header needs to be revisited.

After fixing this, there is another assertion failure though, so scan.c
is not yet ready to be inspected by lint.

Revision 1.112 / (download) - annotate - [select for diffs], Wed Jun 30 11:29:29 2021 UTC (2 years, 8 months ago) by rillig
Branch: MAIN
Changes since 1.111: +20 -18 lines
Diff to previous 1.111 (colored) to selected 1.77 (colored)

lint: invert condition in control flow analysis of switch statements

The condition previously contained many negations, which was hard to
understand.

No functional change.

Revision 1.111 / (download) - annotate - [select for diffs], Sat Jun 19 19:59:02 2021 UTC (2 years, 9 months ago) by rillig
Branch: MAIN
Changes since 1.110: +6 -2 lines
Diff to previous 1.110 (colored) to selected 1.77 (colored)

lint: fix assertion after malformed for loop

Found using afl.

Revision 1.110 / (download) - annotate - [select for diffs], Sat Jun 19 16:05:07 2021 UTC (2 years, 9 months ago) by rillig
Branch: MAIN
Changes since 1.109: +5 -3 lines
Diff to previous 1.109 (colored) to selected 1.77 (colored)

lint: fix assertion failure after malformed statement

Found using afl.

Revision 1.109 / (download) - annotate - [select for diffs], Sat Jun 19 15:51:11 2021 UTC (2 years, 9 months ago) by rillig
Branch: MAIN
Changes since 1.108: +10 -3 lines
Diff to previous 1.108 (colored) to selected 1.77 (colored)

lint: fix crash in malformed initialization

Revision 1.107.2.1 / (download) - annotate - [select for diffs], Mon May 31 22:15:26 2021 UTC (2 years, 9 months ago) by cjep
Branch: cjep_staticlib_x
Changes since 1.107: +27 -3 lines
Diff to previous 1.107 (colored) next main 1.108 (colored) to selected 1.77 (colored)

sync with head

Revision 1.108 / (download) - annotate - [select for diffs], Sat May 15 19:12:14 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
Changes since 1.107: +27 -3 lines
Diff to previous 1.107 (colored) to selected 1.77 (colored)

lint: warn about unreachable case labels for '&&'

See octeon_gmxreg.h 1.2 from 2020-06-18 for an example, where
RXN_RX_INBND_SPEED was cleaned up without adjusting the corresponding
code in octeon_gmx.c.

Revision 1.107 / (download) - annotate - [select for diffs], Mon May 3 07:08:54 2021 UTC (2 years, 10 months ago) by rillig
Branch: MAIN
CVS Tags: cjep_staticlib_x-base
Branch point for: cjep_staticlib_x
Changes since 1.106: +8 -2 lines
Diff to previous 1.106 (colored) to selected 1.77 (colored)

lint: allow variables to be named 'pcs'

Revision 1.106 / (download) - annotate - [select for diffs], Mon Apr 19 13:18:43 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.105: +7 -2 lines
Diff to previous 1.105 (colored) to selected 1.77 (colored)

lint: add debug logging for reachability

Revision 1.105 / (download) - annotate - [select for diffs], Sun Apr 18 17:36:18 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.104: +6 -6 lines
Diff to previous 1.104 (colored) to selected 1.77 (colored)

lint: pass pos_t via const pointer

Thanks for the suggestion, christos@.

Revision 1.104 / (download) - annotate - [select for diffs], Sun Apr 18 09:39:53 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.103: +6 -15 lines
Diff to previous 1.103 (colored) to selected 1.77 (colored)

lint: migrate global_clean_up_decl to warning_at

Revision 1.103 / (download) - annotate - [select for diffs], Sat Apr 10 18:06:53 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.102: +3 -6 lines
Diff to previous 1.102 (colored) to selected 1.77 (colored)

lint: prepare renaming of 'struct type'

It's confusing to have the same struct tag in both lint1 and lint2, with
mostly the same members, but also some differences.  Before actually
changing this, I reviewed all occurrences of the word 'type' in the
code.

No functional change.

Revision 1.102 / (download) - annotate - [select for diffs], Fri Apr 2 15:06:35 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.101: +3 -3 lines
Diff to previous 1.101 (colored) to selected 1.77 (colored)

lint: rename getopname to op_name

There are several functions called 'get' that allocate memory.  Remove
this possible confusion.

No functional change.

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

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

No functional change.

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

lint: rename functions for duplicating types

No functional change.

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

lint: name memory allocation functions consistently

No functional change.

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

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

No functional change.

Revision 1.97 / (download) - annotate - [select for diffs], Fri Mar 26 19:17:58 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.96: +24 -23 lines
Diff to previous 1.96 (colored) to selected 1.77 (colored)

lint: rename members of struct control_statement to be more expressive

C99 does not define names for the head parts of the 'for' statements, it
just calls them clause-1, expression-2 and expression-3.  Therefore the
rather abstract name 'expr3'.

No functional change.

Revision 1.96 / (download) - annotate - [select for diffs], Fri Mar 26 18:54:39 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.95: +16 -16 lines
Diff to previous 1.95 (colored) to selected 1.77 (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.95 / (download) - annotate - [select for diffs], Sun Mar 21 19:14:40 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.94: +3 -9 lines
Diff to previous 1.94 (colored) to selected 1.77 (colored)

lint: warn about unreachable statement after joining the 'if' branches

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

lint: invert 'rchflag', call it warn_about_unreachable instead

No functional change.

Revision 1.93 / (download) - annotate - [select for diffs], Sun Mar 21 18:58:34 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.92: +48 -35 lines
Diff to previous 1.92 (colored) to selected 1.77 (colored)

lint: reduce number of places where 'reached' is set

When determining the reachability of a statement, the idea was that
whenever 'reached' was set to false, 'rchflg' (the abbreviation for "do
not warn about unreachable statements") would be reset as well.

In some (trivial) cases, this was done, but many more interesting cases
simply forgot to set this second variable.  To prevent this in the
future, encapsulate this in a simple helper function.

Now even if a statement is reachable, 'rchflg' gets reset.  This does
not hurt since as long as the current statement is reachable, the value
of 'rchflg' does not matter.

No functional change.  There would be quite a big functional change
though if check_statement_reachable were to reset 'rchflg' instead of
'reached', as the comment already suggests.  In that case, with the
current code, many legitimate warnings about unreachable statements
would be skipped, especially those involving 'if' statements, since
these didn't reset 'rchflg' properly before.

Revision 1.92 / (download) - annotate - [select for diffs], Sun Mar 21 15:44:57 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.91: +7 -4 lines
Diff to previous 1.91 (colored) to selected 1.77 (colored)

lint: fix reachability for while (0)

Revision 1.91 / (download) - annotate - [select for diffs], Sun Mar 21 15:34:13 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.90: +4 -5 lines
Diff to previous 1.90 (colored) to selected 1.77 (colored)

lint: fix reachability for constant controlling expression in for loop

Revision 1.90 / (download) - annotate - [select for diffs], Sun Mar 21 15:24:55 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.89: +8 -7 lines
Diff to previous 1.89 (colored) to selected 1.77 (colored)

lint: fix reachability for if-then-else statements

Revision 1.89 / (download) - annotate - [select for diffs], Sun Mar 21 14:49:21 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.88: +7 -7 lines
Diff to previous 1.88 (colored) to selected 1.77 (colored)

lint: rename functions for handling control statements

No functional change.

Revision 1.88 / (download) - annotate - [select for diffs], Sun Mar 21 14:36:59 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.87: +8 -3 lines
Diff to previous 1.87 (colored) to selected 1.77 (colored)

lint: fix reachability computation in if statements

Previously, only loop statements were considered for reachability.  This
ignored the possibility of an early return in an if statement, or
unreachable branches.

Revision 1.87 / (download) - annotate - [select for diffs], Sun Mar 21 13:03:42 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.86: +5 -5 lines
Diff to previous 1.86 (colored) to selected 1.77 (colored)

lint: rename c_rchif to c_reached_end_of_then

No functional change.

Revision 1.86 / (download) - annotate - [select for diffs], Sun Mar 21 12:10:27 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.85: +3 -3 lines
Diff to previous 1.85 (colored) to selected 1.77 (colored)

lint: document why an unreachable statement is set to reachable

No functional change.

Revision 1.85 / (download) - annotate - [select for diffs], Sun Mar 21 12:08:34 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.84: +7 -6 lines
Diff to previous 1.84 (colored) to selected 1.77 (colored)

lint: rename c_cont to c_continue

No functional change.

Revision 1.84 / (download) - annotate - [select for diffs], Sun Mar 21 12:03:56 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.83: +10 -9 lines
Diff to previous 1.83 (colored) to selected 1.77 (colored)

lint: rename i_infinite to i_maybe_endless

Not every loop that has 'while (1)' is an endless loop.  It may still
contain a 'return' somewhere.

Revision 1.83 / (download) - annotate - [select for diffs], Sun Mar 21 11:55:59 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.82: +6 -7 lines
Diff to previous 1.82 (colored) to selected 1.77 (colored)

lint: fix wrong 'falls off bottom' after return in do-while

Revision 1.82 / (download) - annotate - [select for diffs], Sun Mar 21 11:38:24 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.81: +4 -5 lines
Diff to previous 1.81 (colored) to selected 1.77 (colored)

lint: remove redundant braces in doreturn

No functional change.

Revision 1.81 / (download) - annotate - [select for diffs], Sun Mar 21 10:30:28 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.80: +9 -8 lines
Diff to previous 1.80 (colored) to selected 1.77 (colored)

lint: rename d_fargs, d_fdpos and d_fpsyms to be less abbreviated

No functional change.

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

lint: rename d_rdcsym to d_redeclared_symbol

No functional change.

Revision 1.79 / (download) - annotate - [select for diffs], Sun Mar 21 10:08:01 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.78: +11 -11 lines
Diff to previous 1.78 (colored) to selected 1.77 (colored)

lint: rename clst to case_labels

No functional change.

Revision 1.78 / (download) - annotate - [select for diffs], Sat Mar 20 16:16:32 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.77: +10 -10 lines
Diff to previous 1.77 (colored)

lint: rename ftflg to seen_fallthrough

One less abbreviation to remember when reading the code.

No functional change.

Revision 1.77 / (download) - annotate - [selected], Wed Mar 17 01:15:31 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.76: +4 -4 lines
Diff to previous 1.76 (colored)

lint: rename 'blklev' to 'block_level'

No functional change.

Revision 1.76 / (download) - annotate - [select for diffs], Wed Mar 10 00:02:00 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.75: +4 -2 lines
Diff to previous 1.75 (colored) to selected 1.77 (colored)

lint: disable check for enum type mismatch in switch statement

This check has been too quick and broke the lint build.  Among others,
lib/libpuffs has -w included in LINTFLAGS, which means that the build
can fail even for new warnings, not only for errors.

libpuffs compares a uint16_t with constants from an unnamed enum type.
Since the enum type is completely unnamed (neither a tag nor a typedef),
there is no way to define a struct member having this type. This was a
scenario that I just didn't consider when I added the check to lint.

For now, disable the new check completely.  The previously existing lint
checks stay enabled, including the one that warns about mismatched
anonymous enum types in the '==' operator, which is very similar to the
now disabled check.

Revision 1.75 / (download) - annotate - [select for diffs], Fri Mar 5 17:10:05 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.74: +20 -2 lines
Diff to previous 1.74 (colored) to selected 1.77 (colored)

lint: warn about enum/enum or enum/int type mismatch in switch

This is something that neither GCC 10 nor Clang 8 do, even though it
seems useful.  Lint didn't do it up to now, but that was probably an
oversight since it is easy to miss the implicit '==' operator in the
switch statement.

Revision 1.74 / (download) - annotate - [select for diffs], Sun Feb 28 19:16:05 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.73: +5 -5 lines
Diff to previous 1.73 (colored) to selected 1.77 (colored)

lint: rename is_nonzero to constant_is_nonzero

The new function name emphasizes that the given node must have the
operator CON.

No functional change.

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

lint: change spelling of initialisation to initialization

That's the wording from the ISO C99 standard.

Revision 1.72 / (download) - annotate - [select for diffs], Sun Feb 21 09:17:55 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.71: +19 -7 lines
Diff to previous 1.71 (colored) to selected 1.77 (colored)

lint: fix wrong warning about main falling off the bottom in C99 mode

This gets lint a small step closer to implementing C99.

Revision 1.71 / (download) - annotate - [select for diffs], Fri Feb 19 22:27:49 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.70: +5 -5 lines
Diff to previous 1.70 (colored) to selected 1.77 (colored)

lint: rename t_isenum and t_aincompl to be more expressive

No functional change.

Revision 1.70 / (download) - annotate - [select for diffs], Fri Feb 19 22:20:18 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.69: +3 -3 lines
Diff to previous 1.69 (colored) to selected 1.77 (colored)

lint: rename tenum_t and its members to be more expressive

Revision 1.69 / (download) - annotate - [select for diffs], Fri Feb 19 21:35:44 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.68: +6 -7 lines
Diff to previous 1.68 (colored) to selected 1.77 (colored)

lint: replace cryptic sym.s_rimpl with expressive name

No functional change.

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

lint: warn about mismatch in getopt handling

Revision 1.67 / (download) - annotate - [select for diffs], Sun Jan 31 12:44:34 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.66: +10 -10 lines
Diff to previous 1.66 (colored) to selected 1.77 (colored)

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

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

lint: rename incompl to is_incomplete

No functional change.

Revision 1.65 / (download) - annotate - [select for diffs], Sat Jan 23 22:20:17 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.64: +3 -3 lines
Diff to previous 1.64 (colored) to selected 1.77 (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.64 / (download) - annotate - [select for diffs], Mon Jan 18 20:02:34 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.63: +3 -3 lines
Diff to previous 1.63 (colored) to selected 1.77 (colored)

lint: clean up code (mostly comments)

Revision 1.63 / (download) - annotate - [select for diffs], Mon Jan 18 19:24:09 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.62: +15 -19 lines
Diff to previous 1.62 (colored) to selected 1.77 (colored)

lint: clean up member names of control_structure and comments

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

lint: rename operator AMPER to ADDR

There is no operator called 'ampersand'.  The ampersand sign is merely
the textual representation of both the operator ADDR and the operator
BITAND.

Revision 1.61 / (download) - annotate - [select for diffs], Sun Jan 17 11:28:01 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.60: +3 -3 lines
Diff to previous 1.60 (colored) to selected 1.77 (colored)

lint: fix type mismatch for strict bool mode

No functional change.

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

lint: replace integer constant expressions with true and false

LINTFLAGS=-gST make lint, with manual review.

The error messages from lint are all correct, they are not complete
though.  The return value of a function returning bool may still be
compared to the integer 0.

Revision 1.59 / (download) - annotate - [select for diffs], Sat Jan 16 02:40:02 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.58: +69 -71 lines
Diff to previous 1.58 (colored) to selected 1.77 (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.58 / (download) - annotate - [select for diffs], Fri Jan 15 23:43:51 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.57: +7 -23 lines
Diff to previous 1.57 (colored) to selected 1.77 (colored)

lint: merge duplicate code for non-zero detection

Revision 1.57 / (download) - annotate - [select for diffs], Tue Jan 12 20:42:01 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.56: +8 -2 lines
Diff to previous 1.56 (colored) to selected 1.77 (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.56 / (download) - annotate - [select for diffs], Sun Jan 10 11:17:53 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.55: +3 -3 lines
Diff to previous 1.55 (colored) to selected 1.77 (colored)

lint: rename cvtcon to convert_constant

No functional change.

Revision 1.55 / (download) - annotate - [select for diffs], Sun Jan 10 00:05:46 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.54: +9 -9 lines
Diff to previous 1.54 (colored) to selected 1.77 (colored)

lint: rename type classification macros

The previous names tspec_is_int and tspec_is_uint were confusing because
there are actually tspec_t constants called INT and UINT, these
classification macros return true for other integer types as well,
though.

While here, remove the prefix "tspec_" from these macros.  It wasn't as
helpful as intended, in many cases it was obviously redundant, when it
was called as tspec_is_integer(tn->tn_type->t_tspec).

No functional change.

Revision 1.54 / (download) - annotate - [select for diffs], Sat Jan 9 03:08:54 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.53: +9 -9 lines
Diff to previous 1.53 (colored) to selected 1.77 (colored)

lint: expand abbreviations in grammar rules

stmnt -> statement
comp -> compound

The abbreviation "stmnt" was non-standard, and "comp" was ambiguous
since it is used for "comparison" as well.

Revision 1.53 / (download) - annotate - [select for diffs], Fri Jan 8 02:11:45 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.52: +3 -6 lines
Diff to previous 1.52 (colored) to selected 1.77 (colored)

lint: fix function as controlling expression (since 2020-12-31)

It's perfectly valid to directly use a function name as the controlling
expression of an if statement.  That function name is converted
implicitly to a pointer to that function, and that is a scalar value
then.

Spotted by christos in lib/libpthread/pthread.c:634.

Revision 1.52 / (download) - annotate - [select for diffs], Fri Jan 8 01:40:03 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.51: +4 -2 lines
Diff to previous 1.51 (colored) to selected 1.77 (colored)

lint: demonstrate wrong message 204 (since 2020-12-31)

In func.c 1.39 from 2020-12-31 18:51:28, the check that controlling
expressions are indeed scalar was extended from while and for loops to
if statements as well.  It just seemed to have been an oversight.

This revealed a bug in lint, which didn't accept the following valid
code snippet from lib/libpthread/pthread.c:634:

	void _malloc_thread_cleanup(void) __weak;
	...
	if (_malloc_thread_cleanup)
		_malloc_thread_cleanup();

Testing a function (instead of a function pointer) for truthiness is
probably rare since most functions are defined unconditionally.  For
weak functions it comes in handy though.

Clang-Tidy suggests to prefix the function with '&' to silence its
warning.  Doing that revealed a non-obvious behavior in build_ampersand,
which does not add the AMPER node to the expression even though it is
clearly mentioned in the code.  That is left for further research.

Once the original bug is fixed, it probably doesn't matter whether the
AMPER is discarded or retained since check_controlling_expression would
add it back.  There's probably a reason though to sometimes discard the
AMPER and sometimes retain it.

Revision 1.51 / (download) - annotate - [select for diffs], Tue Jan 5 00:22:04 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.50: +4 -4 lines
Diff to previous 1.50 (colored) to selected 1.77 (colored)

lint: clean up comments

Revision 1.50 / (download) - annotate - [select for diffs], Mon Jan 4 22:26:50 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.49: +11 -7 lines
Diff to previous 1.49 (colored) to selected 1.77 (colored)

lint: fix typos and other minor stylistic issues

Revision 1.49 / (download) - annotate - [select for diffs], Sun Jan 3 20:14:38 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.48: +15 -15 lines
Diff to previous 1.48 (colored) to selected 1.77 (colored)

lint: rename prflstrg to printflike_argnum, likewise for scflstrg

Revision 1.48 / (download) - annotate - [select for diffs], Sun Jan 3 20:04:08 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.47: +55 -55 lines
Diff to previous 1.47 (colored) to selected 1.77 (colored)

lint: rename cstk to cstmt

Most of the code that deals with control statements is only interested
in the innermost control statement, and not if that is a stack or not.
Therefore, emphasize that part in the variable name.

The member c_next was confusing since the "direction" of this "next
element" was ambiguous.  In a sequence of if statements, the "next"
element could have equally been the following one, not the surrounding
one.

Revision 1.47 / (download) - annotate - [select for diffs], Sat Jan 2 18:44:58 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.46: +6 -6 lines
Diff to previous 1.46 (colored) to selected 1.77 (colored)

lint: convert bitfieldtype_ok from int to bool

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

Revision 1.46 / (download) - annotate - [select for diffs], Fri Jan 1 11:41:01 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.45: +4 -3 lines
Diff to previous 1.45 (colored) to selected 1.77 (colored)

lint: add missing redundant messages in source code

Revision 1.45 / (download) - annotate - [select for diffs], Fri Jan 1 11:14:06 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.44: +3 -3 lines
Diff to previous 1.44 (colored) to selected 1.77 (colored)

lint: complete message 203 for case labels

Revision 1.44 / (download) - annotate - [select for diffs], Fri Jan 1 11:09:40 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.43: +6 -6 lines
Diff to previous 1.43 (colored) to selected 1.77 (colored)

lint: rename tokens for left and right parentheses

Revision 1.43 / (download) - annotate - [select for diffs], Fri Jan 1 11:01:03 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.42: +66 -57 lines
Diff to previous 1.42 (colored) to selected 1.77 (colored)

lint: extract main part of case_label into separate function

Revision 1.42 / (download) - annotate - [select for diffs], Fri Jan 1 10:55:28 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.41: +101 -103 lines
Diff to previous 1.41 (colored) to selected 1.77 (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.41 / (download) - annotate - [select for diffs], Fri Jan 1 09:11:40 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.40: +12 -18 lines
Diff to previous 1.40 (colored) to selected 1.77 (colored)

lint: replace some more LERROR with lint_assert

Revision 1.40 / (download) - annotate - [select for diffs], Fri Jan 1 00:00:24 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.39: +9 -9 lines
Diff to previous 1.39 (colored) to selected 1.77 (colored)

lint: align comments in code with actual messages

Redundancy is bad.  Especially in this case, separating the format
strings from the actual arguments prevents the compiler from
cross-checking them.

Revision 1.39 / (download) - annotate - [select for diffs], Thu Dec 31 18:51:28 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.38: +29 -29 lines
Diff to previous 1.38 (colored) to selected 1.77 (colored)

lint: check that in "if (cond)", cond is scalar

Revision 1.38 / (download) - annotate - [select for diffs], Wed Dec 30 13:17:42 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.37: +3 -3 lines
Diff to previous 1.37 (colored) to selected 1.77 (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.37 / (download) - annotate - [select for diffs], Wed Dec 30 11:56:10 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.36: +4 -4 lines
Diff to previous 1.36 (colored) to selected 1.77 (colored)

lint: spell check comments

Revision 1.36 / (download) - annotate - [select for diffs], Wed Dec 30 11:39:55 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.35: +23 -23 lines
Diff to previous 1.35 (colored) to selected 1.77 (colored)

lint: inline STRUCT_ASSIGN

This had only been necessary for some pre-C90 compilers.

Revision 1.35 / (download) - annotate - [select for diffs], Wed Dec 30 11:14:03 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.34: +5 -5 lines
Diff to previous 1.34 (colored) to selected 1.77 (colored)

lint: un-abbreviate s_dpos, s_spos and s_upos

Revision 1.34 / (download) - annotate - [select for diffs], Wed Dec 30 10:49:10 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.33: +3 -3 lines
Diff to previous 1.33 (colored) to selected 1.77 (colored)

lint: rename remaining _nxt members to _next

Revision 1.33 / (download) - annotate - [select for diffs], Wed Dec 30 10:46:11 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.32: +13 -13 lines
Diff to previous 1.32 (colored) to selected 1.77 (colored)

lint: rename more _nxt members to _next

Revision 1.32 / (download) - annotate - [select for diffs], Wed Dec 30 10:26:12 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.31: +5 -5 lines
Diff to previous 1.31 (colored) to selected 1.77 (colored)

lint: rename s_nxt to s_next

Revision 1.31 / (download) - annotate - [select for diffs], Tue Dec 29 13:33:03 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.30: +22 -22 lines
Diff to previous 1.30 (colored) to selected 1.77 (colored)

lint: rename functions with very short names

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

lint: fix indentation and alignment that used space-tab

Revision 1.29 / (download) - annotate - [select for diffs], Tue Dec 29 10:24:22 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.28: +14 -14 lines
Diff to previous 1.28 (colored) to selected 1.77 (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.28 / (download) - annotate - [select for diffs], Mon Dec 28 21:24:55 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.27: +15 -15 lines
Diff to previous 1.27 (colored) to selected 1.77 (colored)

lint: spell check

Revision 1.27 / (download) - annotate - [select for diffs], Mon Dec 28 18:49:02 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.26: +11 -11 lines
Diff to previous 1.26 (colored) to selected 1.77 (colored)

lint: rename tspec macros

Revision 1.26 / (download) - annotate - [select for diffs], Fri Aug 19 10:58:15 2016 UTC (7 years, 7 months ago) by christos
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, 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-localcount-20170107, pgoyette-localcount-20161104, 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, localcount-20160914, is-mlppp-base, is-mlppp, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan
Changes since 1.25: +3 -3 lines
Diff to previous 1.25 (colored) to selected 1.77 (colored)

be less aggressive in clearing blocks to protect against:

int
main(int argc, char *argv[])
{
	int rv;

	if ((rv = ({ int _ret = 1; if (argc == 1) {} _ret; })) != 0)
	    printf("%d\n", rv);
	return 0;
}

Revision 1.24.8.1 / (download) - annotate - [select for diffs], Thu May 22 11:42:52 2014 UTC (9 years, 10 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.24: +9 -5 lines
Diff to previous 1.24 (colored) next main 1.25 (colored) to selected 1.77 (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.24.14.1 / (download) - annotate - [select for diffs], Sun Jun 23 06:29:02 2013 UTC (10 years, 9 months ago) by tls
Branch: tls-maxphys
Changes since 1.24: +9 -5 lines
Diff to previous 1.24 (colored) next main 1.25 (colored) to selected 1.77 (colored)

resync from head

Revision 1.25 / (download) - annotate - [select for diffs], Fri Apr 19 17:43:05 2013 UTC (10 years, 11 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pagecache-base9, tls-maxphys-base, tls-earlyentropy-base, tls-earlyentropy, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, pgoyette-localcount-base, pgoyette-localcount-20160806, pgoyette-localcount-20160726, pgoyette-localcount, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-base, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0, netbsd-7
Changes since 1.24: +9 -5 lines
Diff to previous 1.24 (colored) to selected 1.77 (colored)

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

Revision 1.24 / (download) - annotate - [select for diffs], Sun Nov 16 07:06:37 2008 UTC (15 years, 4 months ago) by dholland
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-premerge-20091211, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, matt-mips64-premerge-20101231, jym-xensuspend-nbase, jym-xensuspend-base, jym-xensuspend, cherry-xenmp-base, cherry-xenmp, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2, agc-symver-base, agc-symver
Branch point for: yamt-pagecache, tls-maxphys
Changes since 1.23: +5 -5 lines
Diff to previous 1.23 (colored) to selected 1.77 (colored)

WARNS=4

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

Sync with wrstuden-revivesa-base-2.

Revision 1.23 / (download) - annotate - [select for diffs], Fri Jul 25 18:33:53 2008 UTC (15 years, 8 months ago) by dsl
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: +4 -2 lines
Diff to previous 1.22 (colored) to selected 1.77 (colored)

Add a check for 'continue' inside a 'do ... while (0)' loop.
'continue' has the same effect as 'break' - as that probably isn't
what the writer had in mind!

Revision 1.22 / (download) - annotate - [select for diffs], Sat Sep 24 15:30:35 2005 UTC (18 years, 6 months ago) by perry
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, chap-midi-nbase, chap-midi-base, chap-midi, abandoned-netbsd-4-base, abandoned-netbsd-4
Branch point for: wrstuden-revivesa
Changes since 1.21: +3 -3 lines
Diff to previous 1.21 (colored) to selected 1.77 (colored)

in several comments:
  implizit -> implicit
  explizit -> explicit

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

Pull up revision 1.21 (requested by jmc in ticket #527):
Completely rework how tools/compat is done. Purge all uses/references to
_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulting tools 'different')
Wrap all required code with the inclusion of nbtool_config.h, attempt to
only use POSIX code in all places (or when reasonable test w. configure and
provide definitions: ala u_int, etc).
Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86
NetBSD current (x86 and amd64) and Solaris 9.
Fixes PR's: PR#17762 PR#25944

Revision 1.21 / (download) - annotate - [select for diffs], Sun Jun 20 22:20:17 2004 UTC (19 years, 9 months ago) by jmc
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
Changes since 1.20: +6 -2 lines
Diff to previous 1.20 (colored) to selected 1.77 (colored)

Completely rework how tools/compat is done. Purge all uses/references to
_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulting tools 'different')

Wrap all required code with the inclusion of nbtool_config.h, attempt to
only use POSIX code in all places (or when reasonable test w. configure and
provide definitions: ala u_int, etc).

Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86
NetBSD current (x86 and amd64) and Solaris 9.

Fixes PR's: PR#17762 PR#25944

Revision 1.20 / (download) - annotate - [select for diffs], Wed Oct 23 00:36:36 2002 UTC (21 years, 5 months ago) by christos
Branch: MAIN
CVS Tags: netbsd-2-0-base, fvdl_fs64_base
Branch point for: netbsd-2-0
Changes since 1.19: +10 -10 lines
Diff to previous 1.19 (colored) to selected 1.77 (colored)

forgot to commit those.

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

add variable array dimension.

Revision 1.18 / (download) - annotate - [select for diffs], Fri Sep 13 14:59:24 2002 UTC (21 years, 6 months ago) by christos
Branch: MAIN
Changes since 1.17: +10 -10 lines
Diff to previous 1.17 (colored) to selected 1.77 (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.17 / (download) - annotate - [select for diffs], Thu Jan 31 19:36:54 2002 UTC (22 years, 2 months ago) by tv
Branch: MAIN
CVS Tags: netbsd-1-6-base, netbsd-1-6-RELEASE, netbsd-1-6-RC3, netbsd-1-6-RC2, netbsd-1-6-RC1, netbsd-1-6-PATCH002-RELEASE, netbsd-1-6-PATCH002-RC4, netbsd-1-6-PATCH002-RC3, netbsd-1-6-PATCH002-RC2, netbsd-1-6-PATCH002-RC1, netbsd-1-6-PATCH002, netbsd-1-6-PATCH001-RELEASE, netbsd-1-6-PATCH001-RC3, netbsd-1-6-PATCH001-RC2, netbsd-1-6-PATCH001-RC1, netbsd-1-6-PATCH001, netbsd-1-6
Changes since 1.16: +3 -3 lines
Diff to previous 1.16 (colored) to selected 1.77 (colored)

Protect __RCSID and __COPYRIGHT from being invoked if not defined.

Revision 1.16 / (download) - annotate - [select for diffs], Thu Jan 3 04:25:15 2002 UTC (22 years, 2 months ago) by thorpej
Branch: MAIN
Changes since 1.15: +23 -2 lines
Diff to previous 1.15 (colored) to selected 1.77 (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.15 / (download) - annotate - [select for diffs], Wed Nov 21 17:33:29 2001 UTC (22 years, 4 months ago) by wiz
Branch: MAIN
Changes since 1.14: +3 -3 lines
Diff to previous 1.14 (colored) to selected 1.77 (colored)

Explicitly write explicitly without a second e.

Revision 1.14 / (download) - annotate - [select for diffs], Mon May 28 12:40:37 2001 UTC (22 years, 10 months ago) by lukem
Branch: MAIN
Changes since 1.13: +63 -65 lines
Diff to previous 1.13 (colored) to selected 1.77 (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.13 / (download) - annotate - [select for diffs], Thu May 24 11:56:36 2001 UTC (22 years, 10 months ago) by lukem
Branch: MAIN
Changes since 1.12: +3 -3 lines
Diff to previous 1.12 (colored) to selected 1.77 (colored)

minor whitespace/knf

Revision 1.12 / (download) - annotate - [select for diffs], Mon Nov 23 14:37:08 1998 UTC (25 years, 4 months ago) by christos
Branch: MAIN
CVS Tags: wrstuden-devbsize-base, wrstuden-devbsize-19991221, wrstuden-devbsize, netbsd-1-5-base, netbsd-1-5-RELEASE, netbsd-1-5-PATCH003, netbsd-1-5-PATCH002, netbsd-1-5-PATCH001, netbsd-1-5-BETA2, netbsd-1-5-BETA, netbsd-1-5-ALPHA2, netbsd-1-5, netbsd-1-4-base, netbsd-1-4-RELEASE, netbsd-1-4-PATCH003, netbsd-1-4-PATCH002, netbsd-1-4-PATCH001, netbsd-1-4, minoura-xpg4dl-base, minoura-xpg4dl, comdex-fall-1999-base, comdex-fall-1999
Changes since 1.11: +5 -2 lines
Diff to previous 1.11 (colored) to selected 1.77 (colored)

Unfortunately lint uses c-style comments as directives and these get parsed
at the lexical analysis stage not at the syntax parsing stage. The upshot
is that:
	if (expr) {
		stmt1;
	}
	/* LINTED */
	stmt2;

stmt2 is the look-ahead token for the parser to choose between and if-then-else
statement as opposed to an if-then statement. Unfortunately the side effect
is that the LINTED directive gets reset before stmt2 gets parsed. We fix this,
by remembering the the linted directive during the if statement parsing and
restoring it at the appropriate time.

Revision 1.11 / (download) - annotate - [select for diffs], Sat Oct 10 20:51:48 1998 UTC (25 years, 5 months ago) by itohy
Branch: MAIN
Changes since 1.10: +11 -10 lines
Diff to previous 1.10 (colored) to selected 1.77 (colored)

Eliminate memory leaks at case labels.

Revision 1.10 / (download) - annotate - [select for diffs], Thu Apr 9 00:32:38 1998 UTC (25 years, 11 months ago) by tv
Branch: MAIN
Changes since 1.9: +3 -3 lines
Diff to previous 1.9 (colored) to selected 1.77 (colored)

.y.c <sys.mk> rule fixes.  Don't create a y.tab.h file unless asked for,
and use smarter creation of the header file.

Revision 1.9 / (download) - annotate - [select for diffs], Tue Apr 7 19:27:24 1998 UTC (25 years, 11 months ago) by tv
Branch: MAIN
Changes since 1.8: +2 -2 lines
Diff to previous 1.8 (colored) to selected 1.77 (colored)

Fix __RCSID() macro

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

WARNSify

Revision 1.7 / (download) - annotate - [select for diffs], Mon Oct 2 17:31:40 1995 UTC (28 years, 6 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: +8 -6 lines
Diff to previous 1.6 (colored) to selected 1.77 (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:53 1995 UTC (28 years, 6 months ago) by jpo
Branch: MAIN
Changes since 1.5: +33 -17 lines
Diff to previous 1.5 (colored) to selected 1.77 (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:21:35 1995 UTC (28 years, 6 months ago) by jpo
Branch: MAIN
Changes since 1.4: +6 -20 lines
Diff to previous 1.4 (colored) to selected 1.77 (colored)

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

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

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

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

prefixed members of dinfo_t with 'd_'

Revision 1.2 / (download) - annotate - [select for diffs], Mon Jul 3 21:24:11 1995 UTC (28 years, 9 months ago) by cgd
Branch: MAIN
Changes since 1.1: +3 -3 lines
Diff to previous 1.1 (colored) to selected 1.77 (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, 9 months ago) by cgd
Branch: Jochen_Pohl
CVS Tags: Jochen_Pohl-950703
Changes since 1.1: +0 -0 lines
Diff to previous 1.1 (colored) to selected 1.77 (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, 9 months ago) by cgd
Branch: MAIN
Diff to selected 1.77 (colored)

Initial revision

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




CVSweb <webmaster@jp.NetBSD.org>