The NetBSD Project

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

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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.66 / (download) - annotate - [select for diffs], Fri Jan 13 19:41:50 2023 UTC (2 weeks, 3 days ago) by rillig
Branch: MAIN
CVS Tags: HEAD
Changes since 1.65: +2 -3 lines
Diff to previous 1.65 (colored)

lint: remove custom memory allocator

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

Revision 1.65 / (download) - annotate - [select for diffs], Tue Jul 5 22:50:41 2022 UTC (6 months, 3 weeks ago) by rillig
Branch: MAIN
CVS Tags: netbsd-10-base, netbsd-10
Changes since 1.64: +5 -4 lines
Diff to previous 1.64 (colored)

lint: add additional queries that are not enabled by default

In the last 18 months, several lint warnings have been made adjusted to
allow common usage patterns.  For example, lint no longer warns about a
constant condition in the statement 'do { ... } while (false)' (message
161), as this pattern is well-known in statement-like macros, making it
unlikely that the 'false' is a mistake.  Another example is casts
between unequal pointer types (message 247) for a few well-known
patterns that are unlikely to be bugs.

Occasionally, it is useful to query the code for patterns or events that
would not justify a warning.  These patterns are modeled as predefined
queries that can be selected individually, in addition to and
independently of the existing warnings and errors.

New queries can be added as needed, in the same way as new warnings.
Queries that are deemed no longer used can be deactivated in the same
way as warnings that are no longer used.

As long as none of the queries is enabled, they produce a minimal
overhead of querying a single global variable.  Computations that are
more expensive than a few machine instructions should be guarded by
any_query_enabled.

https://mail-index.netbsd.org/source-changes-d/2022/06/28/msg013716.html

ok christos@

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

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

No functional change.

Revision 1.63 / (download) - annotate - [select for diffs], Mon May 30 15:13:25 2022 UTC (8 months ago) by rillig
Branch: MAIN
Changes since 1.62: +8 -2 lines
Diff to previous 1.62 (colored)

lint: report proper file name in assertion failures

When given the (obviously malformed) translation unit 'f=({;};}', lint
runs into an assertion failure.  It reported this as occurring near
':1'.  This location was missing a filename since the input didn't
contain a GCC line number directive such as '# 2 "input.c"'.  In GCC mode,
the GCC builtins are loaded first, in which case the reported location
was ':9'.

Fix this by providing proper location information, even for input that
does not come from the GCC C preprocessor.

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

lint: use __RCSID in lint mode as well

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

No binary change.

Revision 1.61 / (download) - annotate - [select for diffs], Sat Apr 30 21:38:03 2022 UTC (9 months ago) by rillig
Branch: MAIN
Changes since 1.60: +3 -3 lines
Diff to previous 1.60 (colored)

lint: inline macro 'tflag'

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

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

No functional change.

Revision 1.60 / (download) - annotate - [select for diffs], Sat Apr 16 13:25:27 2022 UTC (9 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.59: +37 -25 lines
Diff to previous 1.59 (colored)

lint: model C language levels in a future-compatible way

The options -t, -s and -S are confusing because they are used
inconsistently.  The option -S enables C99 features, but when using it
instead of -s, it also doesn't enable all checks required by C90 and
later.  Prepare fixing of these inconsistencies by replacing the flag
variables with language levels that can be extended in a
straight-forward way as new C standards arrive.

| option | allow_trad | allow_c90 | allow_c99 | allow_c11 |
|--------|------------|-----------|-----------|-----------|
| -t     | x          | -         | -         | -         |
| (none) | x          | x         | -         | -         |
| -s     | -          | x         | -         | -         |
| -S     | -          | x         | x         | -         |
| -Ac11  | -          | x         | x         | x         |

Each usage of the old flag variables will be inspected and migrated
individually, to clean up the subtle variations in the conditions and to
provide a simpler model.

When lint was created in 1995, its focus was migrating traditional C
code to C90 code.  Lint does not help in migrating from C90 to C99 or
from C99 to C11 since there are only few silent changes, and simply
because nobody took the time to implement these migration aids.  If
necessary, such migration modes could be added separately.

There is a small functional change: when the option -s is combined with
either -S or -Ac11, lint now only keeps the last of these options.
Previously, these options could be combined, leading to a mixture of
language levels, halfway between C90, C99 and C11.  Especially combining
traditional C with C11 doesn't make sense, but xlint currently allows
it.

The 3 tests that accidentally specified multiple language levels have
been adjusted to a single language level.

Revision 1.59 / (download) - annotate - [select for diffs], Sun Feb 27 11:40:29 2022 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.58: +3 -3 lines
Diff to previous 1.58 (colored)

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

Revision 1.58 / (download) - annotate - [select for diffs], Fri Dec 17 00:05:24 2021 UTC (13 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.57: +12 -2 lines
Diff to previous 1.57 (colored)

lint: in GCC mode, declare alloca and variants

The prototype declarations define the correct parameter types of these
functions so that they are no longer subject to the default argument
promotions (C11 6.5.2.2p6).

The GCC builtins are only recognized in GCC mode (-g).

Revision 1.57 / (download) - annotate - [select for diffs], Sat Aug 28 13:29:26 2021 UTC (17 months ago) by rillig
Branch: MAIN
Changes since 1.56: +6 -6 lines
Diff to previous 1.56 (colored)

lint: explicitly ignore return value of some function calls

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

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

No functional change.

Revision 1.56 / (download) - annotate - [select for diffs], Tue Aug 17 22:29:11 2021 UTC (17 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.55: +22 -21 lines
Diff to previous 1.55 (colored)

lint: extract suppress_messages from main

No functional change.

Revision 1.55 / (download) - annotate - [select for diffs], Tue Aug 17 21:19:02 2021 UTC (17 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.54: +5 -5 lines
Diff to previous 1.54 (colored)

lint: sync usage message with reality

Revision 1.54 / (download) - annotate - [select for diffs], Tue Aug 17 21:05:34 2021 UTC (17 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.53: +10 -11 lines
Diff to previous 1.53 (colored)

lint: move GCC builtins into gcc_builtins

No functional change.

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

lint: merge duplicate debugging code

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

Migrate debug_node to use the existing debug logging functions.

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

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

lint: remove option -d, clean up debug logging

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

Move display_expression further up to avoid the forward declaration.

Revision 1.51 / (download) - annotate - [select for diffs], Sun Aug 1 06:40:37 2021 UTC (18 months ago) by rillig
Branch: MAIN
Changes since 1.50: +3 -4 lines
Diff to previous 1.50 (colored)

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

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

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

Revision 1.50 / (download) - annotate - [select for diffs], Sat Jul 31 19:07:52 2021 UTC (18 months ago) by rillig
Branch: MAIN
Changes since 1.49: +4 -5 lines
Diff to previous 1.49 (colored)

lint: clean up debug logging

The calls to debug_step, unlike printf, don't need a trailing newline.

Remove the debug_step0 macro and its relatives since lint already uses
enough other features from C99 that it essentially requires this
standard, which supports varargs macro arguments.  Among these features
are __func__ and printf("%zu").

In non-debug mode, do not evaluate the arguments of debug_step.
Evaluating the arguments had caused an internal error when running the
test op_shl_lp64.  This is indeed a bug since initdecl should have
initialized the type table for __uint128_t.  This had been forgotten
when support for __uint128_t was added in decl.c 1.69 from 2018-09-07.

No functional change.

Revision 1.49 / (download) - annotate - [select for diffs], Sun Jul 4 05:49:20 2021 UTC (18 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.48: +5 -2 lines
Diff to previous 1.48 (colored)

lint: sync stdout and stderr when compiled in debug mode

If lint is compiled with -DDEBUG, its debug output goes to stdout, no
matter whether the option -d is given or not.

Revision 1.48 / (download) - annotate - [select for diffs], Sat Jul 3 21:27:48 2021 UTC (18 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.47: +3 -3 lines
Diff to previous 1.47 (colored)

lint: do not define 'long double' GCC builtins for traditional C

Revision 1.47 / (download) - annotate - [select for diffs], Sat Jul 3 20:43:35 2021 UTC (18 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.46: +4 -2 lines
Diff to previous 1.46 (colored)

lint: make stdout unbuffered in debug mode

Some debug log messages are on stdout, others on stderr.  Make sure that
they occur in the correct order, even when the output is redirected.

Revision 1.46 / (download) - annotate - [select for diffs], Sun Jun 27 18:48:45 2021 UTC (19 months ago) by rillig
Branch: MAIN
Changes since 1.45: +3 -3 lines
Diff to previous 1.45 (colored)

lint: fix option -Ac11, add test for _Generic

Previously, selecting the option -Ac11 allowed features from C11 but at
the same time prohibited 'long long', which was added in C99.  This was
caused by the option -s, which is interpreted as "allow features from
C90, but no later".

The test for _Generic, which has been added in C11, demonstrates that
the current implementation is broken.  Lint currently thinks that the
return type of a _Generic selection is the type of the expression, but
it really is the type of the selected expression.  In the current tests,
this is always 'const char *', but C11 does not require that the types
of a generic selection are compatible.

Revision 1.45 / (download) - annotate - [select for diffs], Sun Apr 18 22:51:24 2021 UTC (21 months, 1 week ago) by rillig
Branch: MAIN
CVS Tags: cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Changes since 1.44: +4 -4 lines
Diff to previous 1.44 (colored)

lint: remove WARNS=3, falling back to the default WARNS=5

It's strange that GCC does not warn about the nonliteral format strings
in lint1/err.c, lint2/msg.c and lint2/read.c, despite -Wformat=2, but
Clang does.

Revision 1.44 / (download) - annotate - [select for diffs], Sun Apr 18 20:15:17 2021 UTC (21 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.43: +2 -4 lines
Diff to previous 1.43 (colored)

lint: clean up option parsing

Revision 1.43 / (download) - annotate - [select for diffs], Wed Apr 14 20:06:40 2021 UTC (21 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.42: +17 -4 lines
Diff to previous 1.42 (colored)

lint: add option to accept C11 features

The list of available letters for the command line options gets shorter
and shorter.  Most of the interesting letters are already used for some
warning categories.  Curiously, -A, -W and -E were all still available.

The option -A nicely matches the intention of the option, which is to
allow a certain set of language features.  To keep the option available
for further extensions, define -Ac11 as the currently only valid option
of that kind.  This allows straight-forward extension for C17 and future
language standards, as well as independent feature-sets.  The options -W
and -E may someday complement the -A option, using the allow/warn/error
categories.

Revision 1.42 / (download) - annotate - [select for diffs], Fri Apr 2 12:16:50 2021 UTC (21 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.41: +3 -3 lines
Diff to previous 1.41 (colored)

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

No functional change.

Revision 1.41 / (download) - annotate - [select for diffs], Sun Mar 28 15:36:37 2021 UTC (22 months ago) by rillig
Branch: MAIN
Changes since 1.40: +9 -7 lines
Diff to previous 1.40 (colored)

lint: only define GCC builtins if -g is given

This removes 7 wrong warnings when running lint in -t mode.

Surprisingly, this added a warning that had not been there before in
msg_189.c.  This is because check_variable_usage skips the checks when
an error occurred before.  All diagnostics that happened were warnings,
but the -w option treats them as errors, see vwarning.

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

lint: rename fnaddreplsrcdir to something less cryptic

No functional change.

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

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

No functional change.

Revision 1.38 / (download) - annotate - [select for diffs], Sat Mar 20 20:39:35 2021 UTC (22 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.37: +2 -3 lines
Diff to previous 1.37 (colored)

lint: remove redundant operator properties table

It's enough to have modtab, which describes the properties of the
various operators.  There is no need to have a second table imods that
holds the same content.  Rather make modtab constant as well.

The only possible functional change is that the names of the internal
operators 'no-op', '++', '--', 'real', 'imag' and 'case' may appear in
diagnostics, where previously lint invoked undefined behavior by passing
a null pointer for a '%s' conversion specifier.

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

lint: replace integer constant expressions with true and false

LINTFLAGS=-gST make lint, with manual review.

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

Revision 1.36 / (download) - annotate - [select for diffs], Sat Jan 16 02:40:02 2021 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.35: +42 -42 lines
Diff to previous 1.35 (colored)

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

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

Other than that, no functional change intended.

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

Revision 1.35 / (download) - annotate - [select for diffs], Tue Jan 12 21:48:10 2021 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.34: +3 -3 lines
Diff to previous 1.34 (colored)

lint: update usage for lint1 and lint2

(Forgotten in the previous commit.)

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

lint: add new check for strict bool mode

In strict bool mode, bool is considered incompatible with all other
scalar types, just as in Java, C#, Pascal.

The controlling expressions in if statements, while loops, for loops and
the '?:' operator must be of type bool.  The logical operators work on
bool instead of int, the bitwise operators accept both integer and bool.
The arithmetic operators don't accept bool.

Since <stdbool.h> implements bool using C preprocessor macros instead of
predefining the identifiers "true" and "false", the integer constants 0
and 1 may be used in all contexts that require a bool expression.
Except from these, no implicit conversion between bool and scalar types
is allowed.

See usr.bin/tests/xlint/lint1/d_c99_bool_strict.c for more details.

The command line option -T has been chosen because all obvious choices
(-b or -B for bool, -s or -S for strict) are already in use.  The -T may
stand for "types are checked strictly".

The default behavior of lint doesn't change.  The strict bool check is
purely optional.

An example program for strict bool mode is usr.bin/make, which has been
using explicit comparisons such as p != NULL, ch != '\0' or n > 0 in
most places for a long time now, even before the refactoring in 2020.

Revision 1.33 / (download) - annotate - [select for diffs], Sun Jan 10 14:12:48 2021 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.32: +3 -3 lines
Diff to previous 1.32 (colored)

lint: remove redundant parentheses around return value

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

lint: fix typos and other minor stylistic issues

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

lint: remove redundant parentheses around return value

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

lint: rename functions that had very short names

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

Revision 1.29 / (download) - annotate - [select for diffs], Mon Dec 28 19:07:43 2020 UTC (2 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.28: +6 -6 lines
Diff to previous 1.28 (colored)

lint: sort includes

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

lint1: remove trailing whitespace

Revision 1.26.14.1 / (download) - annotate - [select for diffs], Mon Jun 10 22:10:26 2019 UTC (3 years, 7 months ago) by christos
Branch: phil-wifi
Changes since 1.26: +4 -2 lines
Diff to previous 1.26 (colored) next main 1.27 (colored)

Sync with HEAD

Revision 1.26.12.1 / (download) - annotate - [select for diffs], Wed Dec 26 14:02:11 2018 UTC (4 years, 1 month ago) by pgoyette
Branch: pgoyette-compat
CVS Tags: pgoyette-compat-merge-20190127
Changes since 1.26: +4 -2 lines
Diff to previous 1.26 (colored) next main 1.27 (colored)

Sync with HEAD, resolve a few conflicts

Revision 1.27 / (download) - annotate - [select for diffs], Sun Dec 23 19:09:03 2018 UTC (4 years, 1 month ago) by christos
Branch: MAIN
CVS Tags: phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, phil-wifi-20191119, phil-wifi-20190609, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, netbsd-9-base, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9, is-mlppp-base, is-mlppp
Changes since 1.26: +4 -2 lines
Diff to previous 1.26 (colored)

yydebug is now available only if YYDEBUG is set.

Revision 1.25.6.1 / (download) - annotate - [select for diffs], Sat Jan 7 08:56:59 2017 UTC (6 years ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.25: +7 -3 lines
Diff to previous 1.25 (colored) next main 1.26 (colored)

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

Revision 1.26 / (download) - annotate - [select for diffs], Sat Dec 24 17:43:45 2016 UTC (6 years, 1 month ago) by christos
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, phil-wifi-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-compat-base, 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, perseant-stdc-iso10646-base, perseant-stdc-iso10646, netbsd-8-base, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, netbsd-8, matt-nb8-mediatek-base, matt-nb8-mediatek, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan
Branch point for: phil-wifi, pgoyette-compat
Changes since 1.25: +7 -3 lines
Diff to previous 1.25 (colored)

Add -R (source filename remapping) for MKREPRO

Revision 1.20.2.2 / (download) - annotate - [select for diffs], Wed Aug 20 00:05:06 2014 UTC (8 years, 5 months ago) by tls
Branch: tls-maxphys
Changes since 1.20.2.1: +40 -4 lines
Diff to previous 1.20.2.1 (colored) to branchpoint 1.20 (colored) next main 1.21 (colored)

Rebase to HEAD as of a few days ago.

Revision 1.21.4.1 / (download) - annotate - [select for diffs], Sun Aug 10 06:59:20 2014 UTC (8 years, 5 months ago) by tls
Branch: tls-earlyentropy
Changes since 1.21: +42 -6 lines
Diff to previous 1.21 (colored) next main 1.22 (colored)

Rebase.

Revision 1.19.2.2 / (download) - annotate - [select for diffs], Thu May 22 11:42:52 2014 UTC (8 years, 8 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.19.2.1: +44 -8 lines
Diff to previous 1.19.2.1 (colored) to branchpoint 1.19 (colored) next main 1.20 (colored)

sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs.  ("Protocol error: too many arguments")

Revision 1.25 / (download) - annotate - [select for diffs], Fri Apr 18 21:53:44 2014 UTC (8 years, 9 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pagecache-base9, tls-maxphys-base, tls-earlyentropy-base, pgoyette-localcount-base, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-base, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0, netbsd-7, localcount-20160914
Branch point for: pgoyette-localcount
Changes since 1.24: +31 -7 lines
Diff to previous 1.24 (colored)

provide a poor man's fmemopen()

Revision 1.24 / (download) - annotate - [select for diffs], Fri Apr 18 02:17:14 2014 UTC (8 years, 9 months ago) by christos
Branch: MAIN
Changes since 1.23: +4 -4 lines
Diff to previous 1.23 (colored)

don't include fmemopen in tools builds. Since tools does not define
_NETBSD_SOURCE, we don't get the fmemopen prototype

Revision 1.23 / (download) - annotate - [select for diffs], Fri Apr 18 01:18:54 2014 UTC (8 years, 9 months ago) by christos
Branch: MAIN
Changes since 1.22: +6 -2 lines
Diff to previous 1.22 (colored)

builtins only for NetBSD since fmemopen is not portable.

Revision 1.22 / (download) - annotate - [select for diffs], Fri Apr 18 01:15:07 2014 UTC (8 years, 9 months ago) by christos
Branch: MAIN
Changes since 1.21: +14 -6 lines
Diff to previous 1.21 (colored)

Add some builtins

Revision 1.20.2.1 / (download) - annotate - [select for diffs], Sun Jun 23 06:29:02 2013 UTC (9 years, 7 months ago) by tls
Branch: tls-maxphys
Changes since 1.20: +4 -4 lines
Diff to previous 1.20 (colored)

resync from head

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

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

Revision 1.19.2.1 / (download) - annotate - [select for diffs], Tue Apr 17 00:09:44 2012 UTC (10 years, 9 months ago) by yamt
Branch: yamt-pagecache
CVS Tags: yamt-pagecache-tag8
Changes since 1.19: +3 -3 lines
Diff to previous 1.19 (colored)

sync with head

Revision 1.20 / (download) - annotate - [select for diffs], Tue Mar 27 19:24:03 2012 UTC (10 years, 10 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, yamt-pagecache-base5, yamt-pagecache-base4, agc-symver-base, agc-symver
Branch point for: tls-maxphys
Changes since 1.19: +3 -3 lines
Diff to previous 1.19 (colored)

more cross lint friendlyness
XXX: needs more constants converted double/float

Revision 1.18.2.1 / (download) - annotate - [select for diffs], Thu Sep 18 04:29:28 2008 UTC (14 years, 4 months ago) by wrstuden
Branch: wrstuden-revivesa
Changes since 1.18: +8 -3 lines
Diff to previous 1.18 (colored) next main 1.19 (colored)

Sync with wrstuden-revivesa-base-2.

Revision 1.19 / (download) - annotate - [select for diffs], Thu Jul 31 15:21:34 2008 UTC (14 years, 6 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, 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, 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-premerge-20091211, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, 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-premerge-20101231, matt-mips64-base2, jym-xensuspend-nbase, jym-xensuspend-base, jym-xensuspend, cherry-xenmp-base, cherry-xenmp, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2
Branch point for: yamt-pagecache
Changes since 1.18: +8 -3 lines
Diff to previous 1.18 (colored)

Add Picky flag; this produces more warnings:
1. long a; int i; a = i * i;
   suggests casting i to long, so that we gain precision in the multiplication.
2. warns about magnitude comparisons in enums.
3. warns about possible sign extension issues when integer types become widened.

Revision 1.17.16.1 / (download) - annotate - [select for diffs], Sun May 18 12:36:11 2008 UTC (14 years, 8 months ago) by yamt
Branch: yamt-pf42
Changes since 1.17: +13 -2 lines
Diff to previous 1.17 (colored) next main 1.18 (colored)

sync with head.

Revision 1.18 / (download) - annotate - [select for diffs], Fri May 2 15:10:05 2008 UTC (14 years, 9 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pf42-base4, yamt-pf42-base3, yamt-pf42-base2, wrstuden-revivesa-base-1, wrstuden-revivesa-base, hpcarm-cleanup-nbase
Branch point for: wrstuden-revivesa
Changes since 1.17: +13 -2 lines
Diff to previous 1.17 (colored)

Since we cannot guarantee that all machines do ieee math, or that they have
the proper math setup deal with SIGFPE directly.

Revision 1.17 / (download) - annotate - [select for diffs], Wed Nov 8 18:31:15 2006 UTC (16 years, 2 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-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-base, hpcarm-cleanup, cube-autoconf-base, cube-autoconf
Branch point for: yamt-pf42
Changes since 1.16: +5 -2 lines
Diff to previous 1.16 (colored)

- add debugging to track nowarns
- make /*LINTED*/ take effect on unused functions

Revision 1.16 / (download) - annotate - [select for diffs], Sat Sep 24 15:30:35 2005 UTC (17 years, 4 months ago) by perry
Branch: MAIN
CVS Tags: chap-midi-nbase, chap-midi-base, chap-midi, abandoned-netbsd-4-base, abandoned-netbsd-4
Changes since 1.15: +3 -3 lines
Diff to previous 1.15 (colored)

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

Revision 1.14.2.1 / (download) - annotate - [select for diffs], Tue Jun 22 07:19:55 2004 UTC (18 years, 7 months ago) by tron
Branch: netbsd-2-0
CVS Tags: netbsd-2-base, netbsd-2-1-RELEASE, netbsd-2-1-RC6, netbsd-2-1-RC5, netbsd-2-1-RC4, netbsd-2-1-RC3, netbsd-2-1-RC2, netbsd-2-1-RC1, netbsd-2-1, netbsd-2-0-RELEASE, netbsd-2-0-RC5, netbsd-2-0-RC4, netbsd-2-0-RC3, netbsd-2-0-RC2, netbsd-2-0-RC1, netbsd-2-0-3-RELEASE, netbsd-2-0-2-RELEASE, netbsd-2-0-1-RELEASE, netbsd-2
Changes since 1.14: +6 -2 lines
Diff to previous 1.14 (colored) next main 1.15 (colored)

Pull up revision 1.15 (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.15 / (download) - annotate - [select for diffs], Sun Jun 20 22:20:17 2004 UTC (18 years, 7 months ago) by jmc
Branch: MAIN
CVS Tags: netbsd-3-base, netbsd-3-1-RELEASE, netbsd-3-1-RC4, netbsd-3-1-RC3, netbsd-3-1-RC2, netbsd-3-1-RC1, netbsd-3-1-1-RELEASE, netbsd-3-1, netbsd-3-0-RELEASE, netbsd-3-0-RC6, netbsd-3-0-RC5, netbsd-3-0-RC4, netbsd-3-0-RC3, netbsd-3-0-RC2, netbsd-3-0-RC1, netbsd-3-0-3-RELEASE, netbsd-3-0-2-RELEASE, netbsd-3-0-1-RELEASE, netbsd-3-0, netbsd-3
Changes since 1.14: +6 -2 lines
Diff to previous 1.14 (colored)

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

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

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

Fixes PR's: PR#17762 PR#25944

Revision 1.14 / (download) - annotate - [select for diffs], Fri Apr 18 03:21:02 2003 UTC (19 years, 9 months ago) by lukem
Branch: MAIN
CVS Tags: netbsd-2-0-base
Branch point for: netbsd-2-0
Changes since 1.13: +6 -3 lines
Diff to previous 1.13 (colored)

clear errno before strto(u)l() if we're going to test it for ERANGE afterwards

Revision 1.13 / (download) - annotate - [select for diffs], Mon Oct 21 21:14:53 2002 UTC (20 years, 3 months ago) by christos
Branch: MAIN
CVS Tags: fvdl_fs64_base
Changes since 1.12: +7 -4 lines
Diff to previous 1.12 (colored)

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

Revision 1.12 / (download) - annotate - [select for diffs], Thu Jan 31 19:33:50 2002 UTC (21 years ago) by tv
Branch: MAIN
CVS Tags: netbsd-1-6-base, netbsd-1-6-RELEASE, netbsd-1-6-RC3, netbsd-1-6-RC2, netbsd-1-6-RC1, netbsd-1-6-PATCH002-RELEASE, netbsd-1-6-PATCH002-RC4, netbsd-1-6-PATCH002-RC3, netbsd-1-6-PATCH002-RC2, netbsd-1-6-PATCH002-RC1, netbsd-1-6-PATCH002, netbsd-1-6-PATCH001-RELEASE, netbsd-1-6-PATCH001-RC3, netbsd-1-6-PATCH001-RC2, netbsd-1-6-PATCH001-RC1, netbsd-1-6-PATCH001, netbsd-1-6
Changes since 1.11: +5 -5 lines
Diff to previous 1.11 (colored)

Use setprogname() in main().

Revision 1.11 / (download) - annotate - [select for diffs], Tue Jan 29 02:43:38 2002 UTC (21 years ago) by tv
Branch: MAIN
Changes since 1.10: +2 -3 lines
Diff to previous 1.10 (colored)

Remove #include <err.h> (now in lint.h).

Revision 1.10 / (download) - annotate - [select for diffs], Thu Dec 13 23:56:00 2001 UTC (21 years, 1 month ago) by augustss
Branch: MAIN
Changes since 1.9: +6 -7 lines
Diff to previous 1.9 (colored)

Don't use fd_set to keep track of errors to ignore.  Doing so relies on
overriding FD_SETSIZE.  Not overriding it makes it stomp all over memory
(which caused the debug outputs we've seen lately).
It used to work, but toolification of lint broke it.

Revision 1.9 / (download) - annotate - [select for diffs], Tue Dec 4 17:56:34 2001 UTC (21 years, 2 months ago) by wiz
Branch: MAIN
Changes since 1.8: +3 -3 lines
Diff to previous 1.8 (colored)

Replace some misuses of "then" with "than".

Revision 1.8 / (download) - annotate - [select for diffs], Mon May 28 12:40:37 2001 UTC (21 years, 8 months ago) by lukem
Branch: MAIN
Changes since 1.7: +9 -10 lines
Diff to previous 1.7 (colored)

cleanup (prior to more adding more features):
- convert to ANSI KNF
- remove trailing whitespace
- translate some comments from german into english

code compiles and runs clean, and tested by running "make lint" against
xlint source using previous and this lint produces same results.

Revision 1.7 / (download) - annotate - [select for diffs], Sat Feb 24 00:43:51 2001 UTC (21 years, 11 months ago) by cgd
Branch: MAIN
Changes since 1.6: +2 -2 lines
Diff to previous 1.6 (colored)

fix broken NetBSD RCS id tags

Revision 1.6 / (download) - annotate - [select for diffs], Tue Feb 20 23:53:27 2001 UTC (21 years, 11 months ago) by cgd
Branch: MAIN
Changes since 1.5: +2 -3 lines
Diff to previous 1.5 (colored)

use getprogname()

Revision 1.5 / (download) - annotate - [select for diffs], Thu Jul 6 01:10:51 2000 UTC (22 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.4: +45 -4 lines
Diff to previous 1.4 (colored)

add 3 new flags:
-m print message list
-X <id>[,<id>]... suppress error messages with give ids.
-w treat warnings as errors.

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

WARNSify

Revision 1.3 / (download) - annotate - [select for diffs], Mon Oct 2 17:29:56 1995 UTC (27 years, 4 months ago) by jpo
Branch: MAIN
CVS Tags: netbsd-1-3-base, netbsd-1-3-RELEASE, netbsd-1-3-PATCH003-CANDIDATE2, netbsd-1-3-PATCH003-CANDIDATE1, netbsd-1-3-PATCH003-CANDIDATE0, netbsd-1-3-PATCH003, netbsd-1-3-PATCH002, netbsd-1-3-PATCH001, netbsd-1-3-BETA, netbsd-1-3, netbsd-1-2-base, netbsd-1-2-RELEASE, netbsd-1-2-PATCH001, netbsd-1-2-BETA, netbsd-1-2, netbsd-1-1-base, netbsd-1-1-RELEASE, netbsd-1-1-PATCH001, netbsd-1-1
Changes since 1.2: +3 -3 lines
Diff to previous 1.2 (colored)

LINTED and CONSTCOND are now valid up to the next end of a
global or local declaration/definition/statement. Originally they were
valid on the current and next line, which made it hard to suppress
warnings in constructs with more then one line.

LONGLONG can now be used to suppress errors or warnings in the next
declaration, definition or statement.

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

RCS id cleanup

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

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

Revision 1.1 / (download) - annotate - [select for diffs], Mon Jul 3 20:56:37 1995 UTC (27 years, 7 months ago) by cgd
Branch: MAIN

Initial revision

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




CVSweb <webmaster@jp.NetBSD.org>