The NetBSD Project

CVS log for src/tests/usr.bin/xlint/lint1/d_c99_bool_strict_syshdr.c

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

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.27: download - view: text, markup, annotated - select for diffs
Thu Apr 10 20:37:48 2025 UTC (2 weeks, 1 day ago) by rillig
Branches: MAIN
CVS tags: HEAD
Diff to: previous 1.26: preferred, colored
Changes since revision 1.26: +8 -8 lines
lint: remove now-unnecessary CONSTCOND comments

Revision 1.26: download - view: text, markup, annotated - select for diffs
Wed Nov 20 23:01:52 2024 UTC (5 months ago) by rillig
Branches: MAIN
Diff to: previous 1.25: preferred, colored
Changes since revision 1.25: +44 -46 lines
tests/lint: clean up

Revision 1.25: download - view: text, markup, annotated - select for diffs
Wed Nov 13 04:32:49 2024 UTC (5 months, 1 week ago) by rillig
Branches: MAIN
Diff to: previous 1.24: preferred, colored
Changes since revision 1.24: +3 -3 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.24: download - view: text, markup, annotated - select for diffs
Sun May 12 12:28:35 2024 UTC (11 months, 2 weeks ago) by rillig
Branches: MAIN
CVS tags: perseant-exfatfs-base-20240630, perseant-exfatfs-base, perseant-exfatfs
Diff to: previous 1.23: preferred, colored
Changes since revision 1.23: +13 -13 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.23: download - view: text, markup, annotated - select for diffs
Sun May 12 11:46:14 2024 UTC (11 months, 2 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.22: preferred, colored
Changes since revision 1.22: +121 -1 lines
tests/lint: clean up tests for strict bool mode

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

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

Revision 1.20: download - view: text, markup, annotated - select for diffs
Sun Jul 9 10:42:07 2023 UTC (21 months, 2 weeks ago) by rillig
Branches: MAIN
Diff to: previous 1.19: preferred, colored
Changes since revision 1.19: +3 -3 lines
lint: remove redundant '#' after 'argument' in diagnostics

Revision 1.19: download - view: text, markup, annotated - select for diffs
Tue Mar 28 14:44:34 2023 UTC (2 years ago) by rillig
Branches: MAIN
Diff to: previous 1.18: preferred, colored
Changes since revision 1.18: +2 -2 lines
lint: warn about extern declarations outside headers

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

Revision 1.18: download - view: text, markup, annotated - select for diffs
Wed Jun 22 19:23:18 2022 UTC (2 years, 10 months ago) by rillig
Branches: MAIN
CVS tags: netbsd-10-base, netbsd-10-1-RELEASE, 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.17: preferred, colored
Changes since revision 1.17: +2 -2 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.17: download - view: text, markup, annotated - select for diffs
Sun Jun 19 12:14:34 2022 UTC (2 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.16: preferred, colored
Changes since revision 1.16: +2 -2 lines
lint: add quotes around placeholders in 4 messages

Revision 1.16: download - view: text, markup, annotated - select for diffs
Sat Jun 11 14:17:33 2022 UTC (2 years, 10 months ago) by rillig
Branches: MAIN
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +44 -5 lines
tests/lint: demonstrate wrong syshdr check in strict bool mode

Revision 1.15: download - view: text, markup, annotated - select for diffs
Fri May 20 21:03:04 2022 UTC (2 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +4 -4 lines
tests/lint: sync comment with reality

Revision 1.14: download - view: text, markup, annotated - select for diffs
Thu May 19 17:24:14 2022 UTC (2 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +2 -2 lines
lint: in strict bool mode, check function arguments more strictly

When a system header defined the constant FALSE = 0, that constant could
be passed as a bool argument.  On the other hand, the constant TRUE = 1
could not be passed in the same way.  Remove this inconsistency.

Revision 1.13: download - view: text, markup, annotated - select for diffs
Thu May 19 17:10:50 2022 UTC (2 years, 11 months ago) by rillig
Branches: MAIN
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +49 -5 lines
tests/lint: extend tests for type mismatch in strict bool mode

Seen in games/gomoku when calling curses functions.

Revision 1.12: download - view: text, markup, annotated - select for diffs
Wed Dec 22 15:36:37 2021 UTC (3 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.11: preferred, colored
Changes since revision 1.11: +7 -13 lines
lint: fix wrong error in strict bool mode in condition with comma

For the result of the comma operator, it doesn't matter whether the
comma itself comes from a system header or not.  Instead, it's the main
operator of the right operand.

Since 2021-11-16.

Revision 1.11: download - view: text, markup, annotated - select for diffs
Wed Dec 22 15:20:08 2021 UTC (3 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.10: preferred, colored
Changes since revision 1.10: +33 -1 lines
lint: clean up lex.c

Rename 'struct kwtab' to 'struct keyword' since a single keyword is not
a whole keyword table.

Sync comment for lex_name with reality: sbuf_t no longer contains the
hash value.

Remove redundant tests for EOF, as EOF is neither a space nor a digit
nor an xdigit.

No functional change.

Revision 1.10: download - view: text, markup, annotated - select for diffs
Tue Dec 21 16:25:14 2021 UTC (3 years, 4 months ago) by rillig
Branches: MAIN
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +29 -32 lines
tests/lint: remove false assumptions from comments

https://stackoverflow.com/q/65868752

Revision 1.9: download - view: text, markup, annotated - select for diffs
Mon Apr 5 01:35:34 2021 UTC (4 years ago) by rillig
Branches: MAIN
CVS tags: cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +2 -2 lines
tests/lint: one comment per expected diagnostic

This makes it possible to check for diagnostics that contain commas.

Revision 1.8: download - view: text, markup, annotated - select for diffs
Sun Jan 24 09:18:42 2021 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.7: preferred, colored
Changes since revision 1.7: +31 -20 lines
lint: improve introduction of test d_c99_bool_strict_syshdr

Revision 1.7: download - view: text, markup, annotated - select for diffs
Sun Jan 24 07:58:48 2021 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +40 -7 lines
lint: explain why !finite(x) is not allowed in strict bool mode

Revision 1.6: download - view: text, markup, annotated - select for diffs
Sat Jan 23 23:11:40 2021 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +17 -1 lines
lint: apply strict bool mode to lex.c

There are 2 remaining expressions:

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

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

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

Revision 1.5: download - view: text, markup, annotated - select for diffs
Sat Jan 23 22:34:01 2021 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +3 -3 lines
lint: fix error message for relaxed bool operations in system headers

In strict mode, allowing 1 as bool constant expression is probably not
needed in practice since most comparisons are != 0 instead of == 0.

Furthermore, in the expression (flags & 0x0002) == true, comparing with
true is misleading since the '==' operator can never evaluate to true in
this case.

Revision 1.4: download - view: text, markup, annotated - select for diffs
Sat Jan 23 22:20:18 2021 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +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.3: download - view: text, markup, annotated - select for diffs
Sat Jan 23 19:03:55 2021 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +55 -25 lines
lint: extend test for strict bool mode and system headers

Revision 1.2: download - view: text, markup, annotated - select for diffs
Sun Jan 17 23:04:09 2021 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +2 -2 lines
lint: allow system headers to use int as bool, even in strict bool mode

Revision 1.1: download - view: text, markup, annotated - select for diffs
Sun Jan 17 23:00:41 2021 UTC (4 years, 3 months ago) by rillig
Branches: MAIN
lint: add more tests for system headers in strict bool mode

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>