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


Keyword substitution: kv
Default branch: MAIN


Revision 1.191: download - view: text, markup, annotated - select for diffs
Sat Nov 30 10:43:49 2024 UTC (4 days, 11 hours ago) by rillig
Branches: MAIN
CVS tags: HEAD
Diff to: previous 1.190: preferred, colored
Changes since revision 1.190: +3 -3 lines
lint: add back optimization for non-query mode

The main point of the optimization is to skip the expensive calls to
type_name when preparing the message details.  This was not spelled out
explicitly in the comment.

While here, fix the stray 'previous declaration' message that occurred
whenever a function was first declared as 'static' and later defined
without 'static', see query 16.

Revision 1.190: download - view: text, markup, annotated - select for diffs
Fri Nov 29 06:57:43 2024 UTC (5 days, 15 hours ago) by rillig
Branches: MAIN
Diff to: previous 1.189: preferred, colored
Changes since revision 1.189: +3 -4 lines
lint: remove premature optimization for non-query scenarios

Revision 1.189: download - view: text, markup, annotated - select for diffs
Wed Nov 13 04:32:49 2024 UTC (3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.188: preferred, colored
Changes since revision 1.188: +19 -19 lines
lint: add more details to 'statement not reached' message

In lib/libcompat/regexp/regexp.c, the FAIL macro expands to a compound
statement containing a function call statement and a return statement,
and the macro invocation is followed by a semicolon, forming an extra
empty statement.  Which of these statements is unreachable now becomes
clear from the diagnostic, without having to inspect the preprocessed
source code.

Revision 1.188: download - view: text, markup, annotated - select for diffs
Wed Nov 13 03:43:00 2024 UTC (3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.187: preferred, colored
Changes since revision 1.187: +8 -2 lines
lint: handle _Noreturn, [[noreturn]] and __attribute__((__noreturn__))

Revision 1.187: download - view: text, markup, annotated - select for diffs
Sun May 12 12:28:34 2024 UTC (6 months, 3 weeks ago) by rillig
Branches: MAIN
CVS tags: perseant-exfatfs-base-20240630, perseant-exfatfs-base, perseant-exfatfs
Diff to: previous 1.186: preferred, colored
Changes since revision 1.186: +9 -8 lines
lint: in strict bool mode, allow do-while-0

Even though 0 is not a boolean constant, allow this common idiom, to
help in those cases where the C preprocessor used by lint does not mark
tokens as coming from system headers (Clang).

Revision 1.186: download - view: text, markup, annotated - select for diffs
Fri Mar 29 08:35:32 2024 UTC (8 months, 1 week ago) by rillig
Branches: MAIN
Diff to: previous 1.185: preferred, colored
Changes since revision 1.185: +3 -4 lines
lint: clean up

Revision 1.185: download - view: text, markup, annotated - select for diffs
Wed Mar 27 19:28:20 2024 UTC (8 months, 1 week ago) by rillig
Branches: MAIN
Diff to: previous 1.184: preferred, colored
Changes since revision 1.184: +6 -6 lines
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 - view: text, markup, annotated - select for diffs
Sat Mar 9 13:54:47 2024 UTC (8 months, 3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.183: preferred, colored
Changes since revision 1.183: +11 -11 lines
lint: inline accessor macros for tnode_t

Revision 1.183: download - view: text, markup, annotated - select for diffs
Sat Mar 9 13:20:55 2024 UTC (8 months, 3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.182: preferred, colored
Changes since revision 1.182: +7 -7 lines
lint: inline accessor macros for type_t

Revision 1.182: download - view: text, markup, annotated - select for diffs
Sat Mar 9 10:54:12 2024 UTC (8 months, 3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.181: preferred, colored
Changes since revision 1.181: +33 -31 lines
lint: internally store case label values in order of appearance

Revision 1.181: download - view: text, markup, annotated - select for diffs
Thu Feb 8 20:45:20 2024 UTC (9 months, 3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.180: preferred, colored
Changes since revision 1.180: +13 -24 lines
lint: clean up redundant braces

No functional change.

Revision 1.180: download - view: text, markup, annotated - select for diffs
Sat Feb 3 12:57:12 2024 UTC (10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.179: preferred, colored
Changes since revision 1.179: +57 -161 lines
lint: clean up comments, reduce scope of variables

Revision 1.179: download - view: text, markup, annotated - select for diffs
Sat Jan 6 15:05:24 2024 UTC (10 months, 4 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.178: preferred, colored
Changes since revision 1.178: +3 -3 lines
lint: remove redundant parentheses, braces and comments

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

Revision 1.178: download - view: text, markup, annotated - select for diffs
Sun Dec 3 18:17:41 2023 UTC (12 months ago) by rillig
Branches: MAIN
Diff to: previous 1.177: preferred, colored
Changes since revision 1.177: +20 -20 lines
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 - view: text, markup, annotated - select for diffs
Sun Dec 3 13:12:40 2023 UTC (12 months ago) by rillig
Branches: MAIN
Diff to: previous 1.176: preferred, colored
Changes since revision 1.176: +39 -41 lines
lint: re-wrap comments

No functional change.

Revision 1.176: download - view: text, markup, annotated - select for diffs
Sun Dec 3 12:03:38 2023 UTC (12 months ago) by rillig
Branches: MAIN
Diff to: previous 1.175: preferred, colored
Changes since revision 1.175: +5 -5 lines
lint: indent statement continuations consistently

No binary change.

Revision 1.175: download - view: text, markup, annotated - select for diffs
Sat Dec 2 21:50:20 2023 UTC (12 months ago) by rillig
Branches: MAIN
Diff to: previous 1.174: preferred, colored
Changes since revision 1.174: +2 -4 lines
lint: remove redundant empty lines

No functional change.

Revision 1.174: download - view: text, markup, annotated - select for diffs
Sun Aug 6 19:44:50 2023 UTC (15 months, 4 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.173: preferred, colored
Changes since revision 1.173: +9 -8 lines
lint: since C99, a non-void function must return a value

Revision 1.173: download - view: text, markup, annotated - select for diffs
Wed Aug 2 18:51:25 2023 UTC (16 months ago) by rillig
Branches: MAIN
Diff to: previous 1.172: preferred, colored
Changes since revision 1.172: +30 -29 lines
lint: distinguish between arguments and parameters

Revision 1.172: download - view: text, markup, annotated - select for diffs
Sat Jul 29 07:49:14 2023 UTC (16 months, 1 week ago) by rillig
Branches: MAIN
Diff to: previous 1.171: preferred, colored
Changes since revision 1.171: +7 -12 lines
lint: condense code for ending a function

No functional change.

Revision 1.171: download - view: text, markup, annotated - select for diffs
Sat Jul 15 13:35:24 2023 UTC (16 months, 3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.170: preferred, colored
Changes since revision 1.170: +3 -3 lines
lint: add detailed logging for finding memory allocation bugs

Revision 1.170: download - view: text, markup, annotated - select for diffs
Thu Jul 13 08:40:38 2023 UTC (16 months, 3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.169: preferred, colored
Changes since revision 1.169: +3 -3 lines
lint: indent copyright lines consistently

Revision 1.169: download - view: text, markup, annotated - select for diffs
Thu Jul 13 07:19:24 2023 UTC (16 months, 3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.168: preferred, colored
Changes since revision 1.168: +28 -61 lines
lint: reduce code size for handling lint comments

Revision 1.168: download - view: text, markup, annotated - select for diffs
Thu Jul 13 06:41:27 2023 UTC (16 months, 3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.167: preferred, colored
Changes since revision 1.167: +23 -58 lines
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 - view: text, markup, annotated - select for diffs
Sun Jul 9 12:15:07 2023 UTC (16 months, 3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.166: preferred, colored
Changes since revision 1.166: +4 -5 lines
lint: miscellaneous cleanup

Revision 1.166: download - view: text, markup, annotated - select for diffs
Sun Jul 9 11:01:27 2023 UTC (16 months, 3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.165: preferred, colored
Changes since revision 1.165: +4 -4 lines
lint: clean up the wording of a few diagnostics

Revision 1.165: download - view: text, markup, annotated - select for diffs
Mon Jul 3 10:23:12 2023 UTC (17 months ago) by rillig
Branches: MAIN
Diff to: previous 1.164: preferred, colored
Changes since revision 1.164: +3 -3 lines
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 - view: text, markup, annotated - select for diffs
Mon Jul 3 07:03:19 2023 UTC (17 months ago) by rillig
Branches: MAIN
Diff to: previous 1.163: preferred, colored
Changes since revision 1.163: +4 -4 lines
lint: rename uppercase QUAD to LLONG

No binary change.

Revision 1.163: download - view: text, markup, annotated - select for diffs
Sun Jul 2 18:14:44 2023 UTC (17 months ago) by rillig
Branches: MAIN
Diff to: previous 1.162: preferred, colored
Changes since revision 1.162: +10 -10 lines
lint: rename 'quad' to 'signed int' or 'unsigned int'

No functional change.

Revision 1.162: download - view: text, markup, annotated - select for diffs
Sun Jul 2 10:20:45 2023 UTC (17 months ago) by rillig
Branches: MAIN
Diff to: previous 1.161: preferred, colored
Changes since revision 1.161: +3 -3 lines
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 - view: text, markup, annotated - select for diffs
Sat Jul 1 09:31:55 2023 UTC (17 months ago) by rillig
Branches: MAIN
Diff to: previous 1.160: preferred, colored
Changes since revision 1.160: +3 -3 lines
lint: clean up duplicate and dead code for integer constants

No functional change.

Revision 1.160: download - view: text, markup, annotated - select for diffs
Fri Jun 30 21:39:54 2023 UTC (17 months ago) by rillig
Branches: MAIN
Diff to: previous 1.159: preferred, colored
Changes since revision 1.159: +9 -9 lines
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 - view: text, markup, annotated - select for diffs
Thu Jun 29 22:52:44 2023 UTC (17 months ago) by rillig
Branches: MAIN
Diff to: previous 1.158: preferred, colored
Changes since revision 1.158: +3 -3 lines
lint: clean up member names of declaration levels

No functional change outside debug mode.

Revision 1.158: download - view: text, markup, annotated - select for diffs
Thu Jun 29 09:58:36 2023 UTC (17 months, 1 week ago) by rillig
Branches: MAIN
Diff to: previous 1.157: preferred, colored
Changes since revision 1.157: +20 -71 lines
lint: clean up function names

No functional change.

Revision 1.157: download - view: text, markup, annotated - select for diffs
Sat Jun 24 20:50:54 2023 UTC (17 months, 1 week ago) by rillig
Branches: MAIN
Diff to: previous 1.156: preferred, colored
Changes since revision 1.156: +4 -4 lines
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 - view: text, markup, annotated - select for diffs
Fri Jun 9 15:36:31 2023 UTC (17 months, 3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.155: preferred, colored
Changes since revision 1.155: +5 -6 lines
lint: miscellaneous clean-ups

No binary change, except for line numbers in assertions.

Revision 1.155: download - view: text, markup, annotated - select for diffs
Fri Jun 9 13:03:49 2023 UTC (17 months, 3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.154: preferred, colored
Changes since revision 1.154: +16 -16 lines
lint: indent local variables consistently

No binary change.

Revision 1.154: download - view: text, markup, annotated - select for diffs
Thu May 11 08:01:36 2023 UTC (18 months, 3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.153: preferred, colored
Changes since revision 1.153: +4 -3 lines
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 - view: text, markup, annotated - select for diffs
Sat Apr 15 11:34:45 2023 UTC (19 months, 3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.152: preferred, colored
Changes since revision 1.152: +17 -2 lines
lint: add query for parenthesized return value

Revision 1.152: download - view: text, markup, annotated - select for diffs
Sat Apr 15 10:32:46 2023 UTC (19 months, 3 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.151: preferred, colored
Changes since revision 1.151: +32 -34 lines
lint: extract checking the return value to separate function

No functional change.

Revision 1.151: download - view: text, markup, annotated - select for diffs
Tue Mar 28 20:01:21 2023 UTC (20 months, 1 week ago) by rillig
Branches: MAIN
Diff to: previous 1.150: preferred, colored
Changes since revision 1.150: +3 -6 lines
lint: clean up comments for handling 'linted' comments

No functional change.

Revision 1.150: download - view: text, markup, annotated - select for diffs
Tue Mar 28 14:44:35 2023 UTC (20 months, 1 week ago) by rillig
Branches: MAIN
Diff to: previous 1.149: preferred, colored
Changes since revision 1.149: +3 -3 lines
lint: warn about extern declarations outside headers

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

Revision 1.149: download - view: text, markup, annotated - select for diffs
Tue Feb 21 19:47:21 2023 UTC (21 months, 1 week ago) by rillig
Branches: MAIN
Diff to: previous 1.148: preferred, colored
Changes since revision 1.148: +8 -4 lines
lint: fix null pointer dereference in invalid case expression

Revision 1.148: download - view: text, markup, annotated - select for diffs
Sat Feb 18 15:18:49 2023 UTC (21 months, 2 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.147: preferred, colored
Changes since revision 1.147: +2 -8 lines
lint: remove redundant comments

Revision 1.147: download - view: text, markup, annotated - select for diffs
Sun Jan 29 18:37:20 2023 UTC (22 months ago) by rillig
Branches: MAIN
Diff to: previous 1.146: preferred, colored
Changes since revision 1.146: +4 -2 lines
lint: properly clean up when leaving a function definition

Revision 1.146: download - view: text, markup, annotated - select for diffs
Sun Jan 29 18:13:56 2023 UTC (22 months ago) by rillig
Branches: MAIN
Diff to: previous 1.145: preferred, colored
Changes since revision 1.145: +4 -4 lines
lint: rename functions for function definition

No functional change.

Revision 1.145: download - view: text, markup, annotated - select for diffs
Sat Oct 1 09:42:40 2022 UTC (2 years, 2 months ago) by rillig
Branches: MAIN
CVS tags: netbsd-10-base, netbsd-10-0-RELEASE, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10
Diff to: previous 1.144: preferred, colored
Changes since revision 1.144: +6 -6 lines
lint: add hyphen to adjective 'old-style'

Revision 1.144: download - view: text, markup, annotated - select for diffs
Sun Aug 28 19:09:12 2022 UTC (2 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.143: preferred, colored
Changes since revision 1.143: +3 -3 lines
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 - view: text, markup, annotated - select for diffs
Sun Jul 3 07:33:08 2022 UTC (2 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.142: preferred, colored
Changes since revision 1.142: +3 -3 lines
lint: verify that comment above warning_at matches the message

No binary change.

Revision 1.142: download - view: text, markup, annotated - select for diffs
Wed Jun 22 19:23:17 2022 UTC (2 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.141: preferred, colored
Changes since revision 1.141: +20 -20 lines
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 - view: text, markup, annotated - select for diffs
Mon Jun 20 21:13:35 2022 UTC (2 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.140: preferred, colored
Changes since revision 1.140: +3 -3 lines
lint: add quotes around several placeholders in messages

Revision 1.140: download - view: text, markup, annotated - select for diffs
Wed Jun 15 18:29:21 2022 UTC (2 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.139: preferred, colored
Changes since revision 1.139: +3 -3 lines
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 - view: text, markup, annotated - select for diffs
Sat Jun 11 12:23:59 2022 UTC (2 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.138: preferred, colored
Changes since revision 1.138: +4 -4 lines
lint: add quotes around placeholders for a few more messages

Revision 1.138: download - view: text, markup, annotated - select for diffs
Thu May 26 13:40:49 2022 UTC (2 years, 6 months ago) by rillig
Branches: MAIN
Diff to: previous 1.137: preferred, colored
Changes since revision 1.137: +10 -9 lines
lint: rename olwarn and LWARN_BAD to be more expressive

No functional change.

Revision 1.137: download - view: text, markup, annotated - select for diffs
Sun May 22 13:58:59 2022 UTC (2 years, 6 months ago) by rillig
Branches: MAIN
Diff to: previous 1.136: preferred, colored
Changes since revision 1.136: +3 -3 lines
lint: fix wrong warning about unhandled enum constants in switch

Revision 1.136: download - view: text, markup, annotated - select for diffs
Fri May 20 21:18:55 2022 UTC (2 years, 6 months ago) by rillig
Branches: MAIN
Diff to: previous 1.135: preferred, colored
Changes since revision 1.135: +3 -3 lines
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 - view: text, markup, annotated - select for diffs
Sat Apr 30 22:31:23 2022 UTC (2 years, 7 months ago) by rillig
Branches: MAIN
Diff to: previous 1.134: preferred, colored
Changes since revision 1.134: +7 -4 lines
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 - view: text, markup, annotated - select for diffs
Sat Apr 30 21:38:03 2022 UTC (2 years, 7 months ago) by rillig
Branches: MAIN
Diff to: previous 1.133: preferred, colored
Changes since revision 1.133: +4 -4 lines
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 - view: text, markup, annotated - select for diffs
Sat Apr 30 19:18:48 2022 UTC (2 years, 7 months ago) by rillig
Branches: MAIN
Diff to: previous 1.132: preferred, colored
Changes since revision 1.132: +3 -3 lines
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 - view: text, markup, annotated - select for diffs
Sat Apr 9 23:41:22 2022 UTC (2 years, 7 months ago) by rillig
Branches: MAIN
Diff to: previous 1.131: preferred, colored
Changes since revision 1.131: +9 -9 lines
lint: distinguish between storage class and declaration kind

These types overlap but are not the same.

No functional change.

Revision 1.131: download - view: text, markup, annotated - select for diffs
Sat Apr 9 13:38:17 2022 UTC (2 years, 7 months ago) by rillig
Branches: MAIN
Diff to: previous 1.130: preferred, colored
Changes since revision 1.130: +3 -3 lines
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 - view: text, markup, annotated - select for diffs
Sat Apr 2 20:12:46 2022 UTC (2 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.129: preferred, colored
Changes since revision 1.129: +4 -2 lines
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 - view: text, markup, annotated - select for diffs
Sat Apr 2 14:28:30 2022 UTC (2 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.128: preferred, colored
Changes since revision 1.128: +5 -5 lines
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 - view: text, markup, annotated - select for diffs
Sun Feb 27 10:44:45 2022 UTC (2 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.127: preferred, colored
Changes since revision 1.127: +4 -3 lines
lint: unabbreviate some fields in sym_t

No functional change.

Revision 1.127: download - view: text, markup, annotated - select for diffs
Sun Feb 27 08:31:26 2022 UTC (2 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.126: preferred, colored
Changes since revision 1.126: +3 -3 lines
lint: encode lifetime of allocated memory in the function names

No functional change.

Revision 1.126: download - view: text, markup, annotated - select for diffs
Tue Nov 16 21:01:05 2021 UTC (3 years ago) by rillig
Branches: MAIN
Diff to: previous 1.125: preferred, colored
Changes since revision 1.125: +4 -4 lines
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 - view: text, markup, annotated - select for diffs
Tue Nov 16 17:41:23 2021 UTC (3 years ago) by rillig
Branches: MAIN
Diff to: previous 1.124: preferred, colored
Changes since revision 1.124: +4 -4 lines
lint: rename attron to in_gcc_attribute

No functional change.

Revision 1.124: download - view: text, markup, annotated - select for diffs
Sat Sep 4 12:37:46 2021 UTC (3 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.123: preferred, colored
Changes since revision 1.123: +3 -4 lines
lint: remove redundant and duplicate code

Revision 1.123: download - view: text, markup, annotated - select for diffs
Sat Sep 4 12:30:46 2021 UTC (3 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.122: preferred, colored
Changes since revision 1.122: +3 -3 lines
lint: spell out abbreviations in comments

No functional change.

Revision 1.122: download - view: text, markup, annotated - select for diffs
Sat Aug 28 13:29:26 2021 UTC (3 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.121: preferred, colored
Changes since revision 1.121: +3 -3 lines
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 - view: text, markup, annotated - select for diffs
Sat Aug 28 12:21:53 2021 UTC (3 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.120: preferred, colored
Changes since revision 1.120: +3 -3 lines
lint: un-abbreviate unsigned integer types

No functional change.

Revision 1.120: download - view: text, markup, annotated - select for diffs
Sun Aug 22 13:52:19 2021 UTC (3 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.119: preferred, colored
Changes since revision 1.119: +4 -4 lines
lint: use standard quotes in messages 203 and 271

Revision 1.119: download - view: text, markup, annotated - select for diffs
Tue Aug 3 18:44:33 2021 UTC (3 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.118: preferred, colored
Changes since revision 1.118: +3 -3 lines
lint: add quotes around placeholder in message 214

function '%s' expects to return value

Revision 1.118: download - view: text, markup, annotated - select for diffs
Sun Aug 1 06:40:37 2021 UTC (3 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.117: preferred, colored
Changes since revision 1.117: +4 -6 lines
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 - view: text, markup, annotated - select for diffs
Sat Jul 31 19:07:52 2021 UTC (3 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.116: preferred, colored
Changes since revision 1.116: +8 -12 lines
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 - view: text, markup, annotated - select for diffs
Sat Jul 31 11:03:04 2021 UTC (3 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.115: preferred, colored
Changes since revision 1.115: +3 -4 lines
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 - view: text, markup, annotated - select for diffs
Fri Jul 23 17:06:37 2021 UTC (3 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.114: preferred, colored
Changes since revision 1.114: +52 -52 lines
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 - view: text, markup, annotated - select for diffs
Tue Jul 20 19:35:53 2021 UTC (3 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.113: preferred, colored
Changes since revision 1.113: +3 -3 lines
lint: split 'build' into build_binary and build_unary

No functional change.

Revision 1.113: download - view: text, markup, annotated - select for diffs
Sun Jul 4 07:09:39 2021 UTC (3 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.112: preferred, colored
Changes since revision 1.112: +2 -3 lines
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 - view: text, markup, annotated - select for diffs
Wed Jun 30 11:29:29 2021 UTC (3 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.111: preferred, colored
Changes since revision 1.111: +20 -18 lines
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 - view: text, markup, annotated - select for diffs
Sat Jun 19 19:59:02 2021 UTC (3 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.110: preferred, colored
Changes since revision 1.110: +6 -2 lines
lint: fix assertion after malformed for loop

Found using afl.

Revision 1.110: download - view: text, markup, annotated - select for diffs
Sat Jun 19 16:05:07 2021 UTC (3 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.109: preferred, colored
Changes since revision 1.109: +5 -3 lines
lint: fix assertion failure after malformed statement

Found using afl.

Revision 1.109: download - view: text, markup, annotated - select for diffs
Sat Jun 19 15:51:11 2021 UTC (3 years, 5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.108: preferred, colored
Changes since revision 1.108: +10 -3 lines
lint: fix crash in malformed initialization

Revision 1.107.2.1: download - view: text, markup, annotated - select for diffs
Mon May 31 22:15:26 2021 UTC (3 years, 6 months ago) by cjep
Branches: cjep_staticlib_x
Diff to: previous 1.107: preferred, colored; next MAIN 1.108: preferred, colored
Changes since revision 1.107: +27 -3 lines
sync with head

Revision 1.108: download - view: text, markup, annotated - select for diffs
Sat May 15 19:12:14 2021 UTC (3 years, 6 months ago) by rillig
Branches: MAIN
CVS tags: cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1
Diff to: previous 1.107: preferred, colored
Changes since revision 1.107: +27 -3 lines
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 - view: text, markup, annotated - select for diffs
Mon May 3 07:08:54 2021 UTC (3 years, 7 months ago) by rillig
Branches: MAIN
CVS tags: cjep_staticlib_x-base
Branch point for: cjep_staticlib_x
Diff to: previous 1.106: preferred, colored
Changes since revision 1.106: +8 -2 lines
lint: allow variables to be named 'pcs'

Revision 1.106: download - view: text, markup, annotated - select for diffs
Mon Apr 19 13:18:43 2021 UTC (3 years, 7 months ago) by rillig
Branches: MAIN
Diff to: previous 1.105: preferred, colored
Changes since revision 1.105: +7 -2 lines
lint: add debug logging for reachability

Revision 1.105: download - view: text, markup, annotated - select for diffs
Sun Apr 18 17:36:18 2021 UTC (3 years, 7 months ago) by rillig
Branches: MAIN
Diff to: previous 1.104: preferred, colored
Changes since revision 1.104: +6 -6 lines
lint: pass pos_t via const pointer

Thanks for the suggestion, christos@.

Revision 1.104: download - view: text, markup, annotated - select for diffs
Sun Apr 18 09:39:53 2021 UTC (3 years, 7 months ago) by rillig
Branches: MAIN
Diff to: previous 1.103: preferred, colored
Changes since revision 1.103: +6 -15 lines
lint: migrate global_clean_up_decl to warning_at

Revision 1.103: download - view: text, markup, annotated - select for diffs
Sat Apr 10 18:06:53 2021 UTC (3 years, 7 months ago) by rillig
Branches: MAIN
Diff to: previous 1.102: preferred, colored
Changes since revision 1.102: +3 -6 lines
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 - view: text, markup, annotated - select for diffs
Fri Apr 2 15:06:35 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.101: preferred, colored
Changes since revision 1.101: +3 -3 lines
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 - view: text, markup, annotated - select for diffs
Fri Apr 2 12:16:50 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.100: preferred, colored
Changes since revision 1.100: +7 -7 lines
lint: add parentheses after sizeof, as required by share/misc/style

No functional change.

Revision 1.100: download - view: text, markup, annotated - select for diffs
Fri Apr 2 11:53:25 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.99: preferred, colored
Changes since revision 1.99: +3 -3 lines
lint: rename functions for duplicating types

No functional change.

Revision 1.99: download - view: text, markup, annotated - select for diffs
Fri Apr 2 10:13:03 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.98: preferred, colored
Changes since revision 1.98: +8 -8 lines
lint: name memory allocation functions consistently

No functional change.

Revision 1.98: download - view: text, markup, annotated - select for diffs
Fri Mar 26 20:31:07 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.97: preferred, colored
Changes since revision 1.97: +5 -5 lines
lint: in malloc calls, use 'sizeof *ptr' instead of 'sizeof(type)'

No functional change.

Revision 1.97: download - view: text, markup, annotated - select for diffs
Fri Mar 26 19:17:58 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.96: preferred, colored
Changes since revision 1.96: +24 -23 lines
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 - view: text, markup, annotated - select for diffs
Fri Mar 26 18:54:39 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.95: preferred, colored
Changes since revision 1.95: +16 -16 lines
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 - view: text, markup, annotated - select for diffs
Sun Mar 21 19:14:40 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.94: preferred, colored
Changes since revision 1.94: +3 -9 lines
lint: warn about unreachable statement after joining the 'if' branches

Revision 1.94: download - view: text, markup, annotated - select for diffs
Sun Mar 21 19:08:10 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.93: preferred, colored
Changes since revision 1.93: +11 -10 lines
lint: invert 'rchflag', call it warn_about_unreachable instead

No functional change.

Revision 1.93: download - view: text, markup, annotated - select for diffs
Sun Mar 21 18:58:34 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.92: preferred, colored
Changes since revision 1.92: +48 -35 lines
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 - view: text, markup, annotated - select for diffs
Sun Mar 21 15:44:57 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.91: preferred, colored
Changes since revision 1.91: +7 -4 lines
lint: fix reachability for while (0)

Revision 1.91: download - view: text, markup, annotated - select for diffs
Sun Mar 21 15:34:13 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.90: preferred, colored
Changes since revision 1.90: +4 -5 lines
lint: fix reachability for constant controlling expression in for loop

Revision 1.90: download - view: text, markup, annotated - select for diffs
Sun Mar 21 15:24:55 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.89: preferred, colored
Changes since revision 1.89: +8 -7 lines
lint: fix reachability for if-then-else statements

Revision 1.89: download - view: text, markup, annotated - select for diffs
Sun Mar 21 14:49:21 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.88: preferred, colored
Changes since revision 1.88: +7 -7 lines
lint: rename functions for handling control statements

No functional change.

Revision 1.88: download - view: text, markup, annotated - select for diffs
Sun Mar 21 14:36:59 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.87: preferred, colored
Changes since revision 1.87: +8 -3 lines
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 - view: text, markup, annotated - select for diffs
Sun Mar 21 13:03:42 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.86: preferred, colored
Changes since revision 1.86: +5 -5 lines
lint: rename c_rchif to c_reached_end_of_then

No functional change.

Revision 1.86: download - view: text, markup, annotated - select for diffs
Sun Mar 21 12:10:27 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.85: preferred, colored
Changes since revision 1.85: +3 -3 lines
lint: document why an unreachable statement is set to reachable

No functional change.

Revision 1.85: download - view: text, markup, annotated - select for diffs
Sun Mar 21 12:08:34 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.84: preferred, colored
Changes since revision 1.84: +7 -6 lines
lint: rename c_cont to c_continue

No functional change.

Revision 1.84: download - view: text, markup, annotated - select for diffs
Sun Mar 21 12:03:56 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.83: preferred, colored
Changes since revision 1.83: +10 -9 lines
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 - view: text, markup, annotated - select for diffs
Sun Mar 21 11:55:59 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.82: preferred, colored
Changes since revision 1.82: +6 -7 lines
lint: fix wrong 'falls off bottom' after return in do-while

Revision 1.82: download - view: text, markup, annotated - select for diffs
Sun Mar 21 11:38:24 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.81: preferred, colored
Changes since revision 1.81: +4 -5 lines
lint: remove redundant braces in doreturn

No functional change.

Revision 1.81: download - view: text, markup, annotated - select for diffs
Sun Mar 21 10:30:28 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.80: preferred, colored
Changes since revision 1.80: +9 -8 lines
lint: rename d_fargs, d_fdpos and d_fpsyms to be less abbreviated

No functional change.

Revision 1.80: download - view: text, markup, annotated - select for diffs
Sun Mar 21 10:21:07 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.79: preferred, colored
Changes since revision 1.79: +3 -3 lines
lint: rename d_rdcsym to d_redeclared_symbol

No functional change.

Revision 1.79: download - view: text, markup, annotated - select for diffs
Sun Mar 21 10:08:01 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.78: preferred, colored
Changes since revision 1.78: +11 -11 lines
lint: rename clst to case_labels

No functional change.

Revision 1.78: download - view: text, markup, annotated - select for diffs
Sat Mar 20 16:16:32 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.77: preferred, colored
Changes since revision 1.77: +10 -10 lines
lint: rename ftflg to seen_fallthrough

One less abbreviation to remember when reading the code.

No functional change.

Revision 1.77: download - view: text, markup, annotated - select for diffs
Wed Mar 17 01:15:31 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.76: preferred, colored
Changes since revision 1.76: +4 -4 lines
lint: rename 'blklev' to 'block_level'

No functional change.

Revision 1.76: download - view: text, markup, annotated - select for diffs
Wed Mar 10 00:02:00 2021 UTC (3 years, 8 months ago) by rillig
Branches: MAIN
Diff to: previous 1.75: preferred, colored
Changes since revision 1.75: +4 -2 lines
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 - view: text, markup, annotated - select for diffs
Fri Mar 5 17:10:05 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.74: preferred, colored
Changes since revision 1.74: +20 -2 lines
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 - view: text, markup, annotated - select for diffs
Sun Feb 28 19:16:05 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.73: preferred, colored
Changes since revision 1.73: +5 -5 lines
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 - view: text, markup, annotated - select for diffs
Mon Feb 22 15:09:50 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.72: preferred, colored
Changes since revision 1.72: +6 -6 lines
lint: change spelling of initialisation to initialization

That's the wording from the ISO C99 standard.

Revision 1.72: download - view: text, markup, annotated - select for diffs
Sun Feb 21 09:17:55 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.71: preferred, colored
Changes since revision 1.71: +19 -7 lines
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 - view: text, markup, annotated - select for diffs
Fri Feb 19 22:27:49 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.70: preferred, colored
Changes since revision 1.70: +5 -5 lines
lint: rename t_isenum and t_aincompl to be more expressive

No functional change.

Revision 1.70: download - view: text, markup, annotated - select for diffs
Fri Feb 19 22:20:18 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.69: preferred, colored
Changes since revision 1.69: +3 -3 lines
lint: rename tenum_t and its members to be more expressive

Revision 1.69: download - view: text, markup, annotated - select for diffs
Fri Feb 19 21:35:44 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.68: preferred, colored
Changes since revision 1.68: +6 -7 lines
lint: replace cryptic sym.s_rimpl with expressive name

No functional change.

Revision 1.68: download - view: text, markup, annotated - select for diffs
Fri Feb 19 12:28:56 2021 UTC (3 years, 9 months ago) by rillig
Branches: MAIN
Diff to: previous 1.67: preferred, colored
Changes since revision 1.67: +10 -3 lines
lint: warn about mismatch in getopt handling

Revision 1.67: download - view: text, markup, annotated - select for diffs
Sun Jan 31 12:44:34 2021 UTC (3 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.66: preferred, colored
Changes since revision 1.66: +10 -10 lines
lint: don't warn about constant condition in 'do { } while (0)'

Revision 1.66: download - view: text, markup, annotated - select for diffs
Sat Jan 30 18:16:45 2021 UTC (3 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.65: preferred, colored
Changes since revision 1.65: +3 -3 lines
lint: rename incompl to is_incomplete

No functional change.

Revision 1.65: download - view: text, markup, annotated - select for diffs
Sat Jan 23 22:20:17 2021 UTC (3 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.64: preferred, colored
Changes since revision 1.64: +3 -3 lines
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 - view: text, markup, annotated - select for diffs
Mon Jan 18 20:02:34 2021 UTC (3 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.63: preferred, colored
Changes since revision 1.63: +3 -3 lines
lint: clean up code (mostly comments)

Revision 1.63: download - view: text, markup, annotated - select for diffs
Mon Jan 18 19:24:09 2021 UTC (3 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.62: preferred, colored
Changes since revision 1.62: +15 -19 lines
lint: clean up member names of control_structure and comments

Revision 1.62: download - view: text, markup, annotated - select for diffs
Sun Jan 17 14:50:11 2021 UTC (3 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.61: preferred, colored
Changes since revision 1.61: +3 -3 lines
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 - view: text, markup, annotated - select for diffs
Sun Jan 17 11:28:01 2021 UTC (3 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.60: preferred, colored
Changes since revision 1.60: +3 -3 lines
lint: fix type mismatch for strict bool mode

No functional change.

Revision 1.60: download - view: text, markup, annotated - select for diffs
Sat Jan 16 16:53:23 2021 UTC (3 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.59: preferred, colored
Changes since revision 1.59: +14 -14 lines
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 - view: text, markup, annotated - select for diffs
Sat Jan 16 02:40:02 2021 UTC (3 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.58: preferred, colored
Changes since revision 1.58: +69 -71 lines
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 - view: text, markup, annotated - select for diffs
Fri Jan 15 23:43:51 2021 UTC (3 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.57: preferred, colored
Changes since revision 1.57: +7 -23 lines
lint: merge duplicate code for non-zero detection

Revision 1.57: download - view: text, markup, annotated - select for diffs
Tue Jan 12 20:42:01 2021 UTC (3 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.56: preferred, colored
Changes since revision 1.56: +8 -2 lines
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 - view: text, markup, annotated - select for diffs
Sun Jan 10 11:17:53 2021 UTC (3 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.55: preferred, colored
Changes since revision 1.55: +3 -3 lines
lint: rename cvtcon to convert_constant

No functional change.

Revision 1.55: download - view: text, markup, annotated - select for diffs
Sun Jan 10 00:05:46 2021 UTC (3 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.54: preferred, colored
Changes since revision 1.54: +9 -9 lines
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 - view: text, markup, annotated - select for diffs
Sat Jan 9 03:08:54 2021 UTC (3 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.53: preferred, colored
Changes since revision 1.53: +9 -9 lines
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 - view: text, markup, annotated - select for diffs
Fri Jan 8 02:11:45 2021 UTC (3 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.52: preferred, colored
Changes since revision 1.52: +3 -6 lines
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 - view: text, markup, annotated - select for diffs
Fri Jan 8 01:40:03 2021 UTC (3 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.51: preferred, colored
Changes since revision 1.51: +4 -2 lines
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 - view: text, markup, annotated - select for diffs
Tue Jan 5 00:22:04 2021 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.50: preferred, colored
Changes since revision 1.50: +4 -4 lines
lint: clean up comments

Revision 1.50: download - view: text, markup, annotated - select for diffs
Mon Jan 4 22:26:50 2021 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.49: preferred, colored
Changes since revision 1.49: +11 -7 lines
lint: fix typos and other minor stylistic issues

Revision 1.49: download - view: text, markup, annotated - select for diffs
Sun Jan 3 20:14:38 2021 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.48: preferred, colored
Changes since revision 1.48: +15 -15 lines
lint: rename prflstrg to printflike_argnum, likewise for scflstrg

Revision 1.48: download - view: text, markup, annotated - select for diffs
Sun Jan 3 20:04:08 2021 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.47: preferred, colored
Changes since revision 1.47: +55 -55 lines
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 - view: text, markup, annotated - select for diffs
Sat Jan 2 18:44:58 2021 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.46: preferred, colored
Changes since revision 1.46: +6 -6 lines
lint: convert bitfieldtype_ok from int to bool

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

Revision 1.46: download - view: text, markup, annotated - select for diffs
Fri Jan 1 11:41:01 2021 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.45: preferred, colored
Changes since revision 1.45: +4 -3 lines
lint: add missing redundant messages in source code

Revision 1.45: download - view: text, markup, annotated - select for diffs
Fri Jan 1 11:14:06 2021 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.44: preferred, colored
Changes since revision 1.44: +3 -3 lines
lint: complete message 203 for case labels

Revision 1.44: download - view: text, markup, annotated - select for diffs
Fri Jan 1 11:09:40 2021 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.43: preferred, colored
Changes since revision 1.43: +6 -6 lines
lint: rename tokens for left and right parentheses

Revision 1.43: download - view: text, markup, annotated - select for diffs
Fri Jan 1 11:01:03 2021 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.42: preferred, colored
Changes since revision 1.42: +66 -57 lines
lint: extract main part of case_label into separate function

Revision 1.42: download - view: text, markup, annotated - select for diffs
Fri Jan 1 10:55:28 2021 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.41: preferred, colored
Changes since revision 1.41: +101 -103 lines
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 - view: text, markup, annotated - select for diffs
Fri Jan 1 09:11:40 2021 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.40: preferred, colored
Changes since revision 1.40: +12 -18 lines
lint: replace some more LERROR with lint_assert

Revision 1.40: download - view: text, markup, annotated - select for diffs
Fri Jan 1 00:00:24 2021 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.39: preferred, colored
Changes since revision 1.39: +9 -9 lines
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 - view: text, markup, annotated - select for diffs
Thu Dec 31 18:51:28 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.38: preferred, colored
Changes since revision 1.38: +29 -29 lines
lint: check that in "if (cond)", cond is scalar

Revision 1.38: download - view: text, markup, annotated - select for diffs
Wed Dec 30 13:17:42 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.37: preferred, colored
Changes since revision 1.37: +3 -3 lines
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 - view: text, markup, annotated - select for diffs
Wed Dec 30 11:56:10 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.36: preferred, colored
Changes since revision 1.36: +4 -4 lines
lint: spell check comments

Revision 1.36: download - view: text, markup, annotated - select for diffs
Wed Dec 30 11:39:55 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.35: preferred, colored
Changes since revision 1.35: +23 -23 lines
lint: inline STRUCT_ASSIGN

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

Revision 1.35: download - view: text, markup, annotated - select for diffs
Wed Dec 30 11:14:03 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.34: preferred, colored
Changes since revision 1.34: +5 -5 lines
lint: un-abbreviate s_dpos, s_spos and s_upos

Revision 1.34: download - view: text, markup, annotated - select for diffs
Wed Dec 30 10:49:10 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.33: preferred, colored
Changes since revision 1.33: +3 -3 lines
lint: rename remaining _nxt members to _next

Revision 1.33: download - view: text, markup, annotated - select for diffs
Wed Dec 30 10:46:11 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.32: preferred, colored
Changes since revision 1.32: +13 -13 lines
lint: rename more _nxt members to _next

Revision 1.32: download - view: text, markup, annotated - select for diffs
Wed Dec 30 10:26:12 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.31: preferred, colored
Changes since revision 1.31: +5 -5 lines
lint: rename s_nxt to s_next

Revision 1.31: download - view: text, markup, annotated - select for diffs
Tue Dec 29 13:33:03 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.30: preferred, colored
Changes since revision 1.30: +22 -22 lines
lint: rename functions with very short names

Revision 1.30: download - view: text, markup, annotated - select for diffs
Tue Dec 29 12:18:42 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.29: preferred, colored
Changes since revision 1.29: +3 -3 lines
lint: fix indentation and alignment that used space-tab

Revision 1.29: download - view: text, markup, annotated - select for diffs
Tue Dec 29 10:24:22 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.28: preferred, colored
Changes since revision 1.28: +14 -14 lines
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 - view: text, markup, annotated - select for diffs
Mon Dec 28 21:24:55 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.27: preferred, colored
Changes since revision 1.27: +15 -15 lines
lint: spell check

Revision 1.27: download - view: text, markup, annotated - select for diffs
Mon Dec 28 18:49:02 2020 UTC (3 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.26: preferred, colored
Changes since revision 1.26: +11 -11 lines
lint: rename tspec macros

Revision 1.26: download - view: text, markup, annotated - select for diffs
Fri Aug 19 10:58:15 2016 UTC (8 years, 3 months ago) by christos
Branches: 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-4-RELEASE, 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-3-RELEASE, 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
Diff to: previous 1.25: preferred, colored
Changes since revision 1.25: +3 -3 lines
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 - view: text, markup, annotated - select for diffs
Thu May 22 11:42:52 2014 UTC (10 years, 6 months ago) by yamt
Branches: yamt-pagecache
Diff to: previous 1.24: preferred, colored; next MAIN 1.25: preferred, colored
Changes since revision 1.24: +9 -5 lines
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 - view: text, markup, annotated - select for diffs
Sun Jun 23 06:29:02 2013 UTC (11 years, 5 months ago) by tls
Branches: tls-maxphys
Diff to: previous 1.24: preferred, colored; next MAIN 1.25: preferred, colored
Changes since revision 1.24: +9 -5 lines
resync from head

Revision 1.25: download - view: text, markup, annotated - select for diffs
Fri Apr 19 17:43:05 2013 UTC (11 years, 7 months ago) by christos
Branches: 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
Diff to: previous 1.24: preferred, colored
Changes since revision 1.24: +9 -5 lines
Allow linted comments to take an argument that defines which error to suppress.

Revision 1.24: download - view: text, markup, annotated - select for diffs
Sun Nov 16 07:06:37 2008 UTC (16 years ago) by dholland
Branches: 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
Diff to: previous 1.23: preferred, colored
Changes since revision 1.23: +5 -5 lines
WARNS=4

Revision 1.22.22.1: download - view: text, markup, annotated - select for diffs
Thu Sep 18 04:29:28 2008 UTC (16 years, 2 months ago) by wrstuden
Branches: wrstuden-revivesa
Diff to: previous 1.22: preferred, colored; next MAIN 1.23: preferred, colored
Changes since revision 1.22: +4 -2 lines
Sync with wrstuden-revivesa-base-2.

Revision 1.23: download - view: text, markup, annotated - select for diffs
Fri Jul 25 18:33:53 2008 UTC (16 years, 4 months ago) by dsl
Branches: 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
Diff to: previous 1.22: preferred, colored
Changes since revision 1.22: +4 -2 lines
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 - view: text, markup, annotated - select for diffs
Sat Sep 24 15:30:35 2005 UTC (19 years, 2 months ago) by perry
Branches: 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
Diff to: previous 1.21: preferred, colored
Changes since revision 1.21: +3 -3 lines
in several comments:
  implizit -> implicit
  explizit -> explicit

Revision 1.20.2.1: download - view: text, markup, annotated - select for diffs
Tue Jun 22 07:26:01 2004 UTC (20 years, 5 months ago) by tron
Branches: 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
Diff to: previous 1.20: preferred, colored; next MAIN 1.21: preferred, colored
Changes since revision 1.20: +6 -2 lines
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 - view: text, markup, annotated - select for diffs
Sun Jun 20 22:20:17 2004 UTC (20 years, 5 months ago) by jmc
Branches: 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
Diff to: previous 1.20: preferred, colored
Changes since revision 1.20: +6 -2 lines
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 - view: text, markup, annotated - select for diffs
Wed Oct 23 00:36:36 2002 UTC (22 years, 1 month ago) by christos
Branches: MAIN
CVS tags: netbsd-2-0-base, fvdl_fs64_base
Branch point for: netbsd-2-0
Diff to: previous 1.19: preferred, colored
Changes since revision 1.19: +10 -10 lines
forgot to commit those.

Revision 1.19: download - view: text, markup, annotated - select for diffs
Tue Oct 22 13:48:50 2002 UTC (22 years, 1 month ago) by christos
Branches: MAIN
Diff to: previous 1.18: preferred, colored
Changes since revision 1.18: +3 -3 lines
add variable array dimension.

Revision 1.18: download - view: text, markup, annotated - select for diffs
Fri Sep 13 14:59:24 2002 UTC (22 years, 2 months ago) by christos
Branches: MAIN
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +10 -10 lines
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 - view: text, markup, annotated - select for diffs
Thu Jan 31 19:36:54 2002 UTC (22 years, 10 months ago) by tv
Branches: 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
Diff to: previous 1.16: preferred, colored
Changes since revision 1.16: +3 -3 lines
Protect __RCSID and __COPYRIGHT from being invoked if not defined.

Revision 1.16: download - view: text, markup, annotated - select for diffs
Thu Jan 3 04:25:15 2002 UTC (22 years, 11 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +23 -2 lines
* 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 - view: text, markup, annotated - select for diffs
Wed Nov 21 17:33:29 2001 UTC (23 years ago) by wiz
Branches: MAIN
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +3 -3 lines
Explicitly write explicitly without a second e.

Revision 1.14: download - view: text, markup, annotated - select for diffs
Mon May 28 12:40:37 2001 UTC (23 years, 6 months ago) by lukem
Branches: MAIN
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +63 -65 lines
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 - view: text, markup, annotated - select for diffs
Thu May 24 11:56:36 2001 UTC (23 years, 6 months ago) by lukem
Branches: MAIN
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +3 -3 lines
minor whitespace/knf

Revision 1.12: download - view: text, markup, annotated - select for diffs
Mon Nov 23 14:37:08 1998 UTC (26 years ago) by christos
Branches: 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
Diff to: previous 1.11: preferred, colored
Changes since revision 1.11: +5 -2 lines
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 - view: text, markup, annotated - select for diffs
Sat Oct 10 20:51:48 1998 UTC (26 years, 2 months ago) by itohy
Branches: MAIN
Diff to: previous 1.10: preferred, colored
Changes since revision 1.10: +11 -10 lines
Eliminate memory leaks at case labels.

Revision 1.10: download - view: text, markup, annotated - select for diffs
Thu Apr 9 00:32:38 1998 UTC (26 years, 8 months ago) by tv
Branches: MAIN
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +3 -3 lines
.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 - view: text, markup, annotated - select for diffs
Tue Apr 7 19:27:24 1998 UTC (26 years, 8 months ago) by tv
Branches: MAIN
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +2 -2 lines
Fix __RCSID() macro

Revision 1.8: download - view: text, markup, annotated - select for diffs
Sun Feb 22 15:40:40 1998 UTC (26 years, 9 months ago) by christos
Branches: MAIN
Diff to: previous 1.7: preferred, colored
Changes since revision 1.7: +4 -3 lines
WARNSify

Revision 1.7: download - view: text, markup, annotated - select for diffs
Mon Oct 2 17:31:40 1995 UTC (29 years, 2 months ago) by jpo
Branches: 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
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +8 -6 lines
don't print warnings about unused variables or arguments in compound
statements which contain asm statements.

Revision 1.6: download - view: text, markup, annotated - select for diffs
Mon Oct 2 17:29:53 1995 UTC (29 years, 2 months ago) by jpo
Branches: MAIN
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +33 -17 lines
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 - view: text, markup, annotated - select for diffs
Mon Oct 2 17:21:35 1995 UTC (29 years, 2 months ago) by jpo
Branches: MAIN
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +6 -20 lines
prototypes override old style function definitions
this is a gnu extension to ansi c

Revision 1.4: download - view: text, markup, annotated - select for diffs
Mon Oct 2 17:14:26 1995 UTC (29 years, 2 months ago) by jpo
Branches: MAIN
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +19 -6 lines
added inline keywords
"inline" is enabled by -g, "__inline" and "__inline__" are always available

Revision 1.3: download - view: text, markup, annotated - select for diffs
Mon Oct 2 17:08:38 1995 UTC (29 years, 2 months ago) by jpo
Branches: MAIN
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +18 -18 lines
prefixed members of dinfo_t with 'd_'

Revision 1.2: download - view: text, markup, annotated - select for diffs
Mon Jul 3 21:24:11 1995 UTC (29 years, 5 months ago) by cgd
Branches: MAIN
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +3 -3 lines
RCS id cleanup

Revision 1.1.1.1 (vendor branch): download - view: text, markup, annotated - select for diffs
Mon Jul 3 20:56:37 1995 UTC (29 years, 5 months ago) by cgd
Branches: Jochen_Pohl
CVS tags: Jochen_Pohl-950703
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +0 -0 lines
lint(1) implementation, by Jochen Pohl.  named 'xlint' for a similar
reason to why 'install' is named 'xinstall'.

Revision 1.1: download - view: text, markup, annotated - select for diffs
Mon Jul 3 20:56:37 1995 UTC (29 years, 5 months ago) by cgd
Branches: MAIN
Initial revision

Diff request

This form allows you to request diffs 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.

Log view options

CVSweb <webmaster@jp.NetBSD.org>