The NetBSD Project

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

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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.123 / (download) - annotate - [select for diffs], Sat Mar 2 09:32:19 2024 UTC (6 weeks, 6 days ago) by rillig
Branch: MAIN
CVS Tags: HEAD
Changes since 1.122: +5 -5 lines
Diff to previous 1.122 (colored) to selected 1.27 (colored)

lint: remove custom wrappers around <ctype.h> functions

Revision 1.122 / (download) - annotate - [select for diffs], Sat Jan 20 12:02:10 2024 UTC (2 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.121: +40 -49 lines
Diff to previous 1.121 (colored) to selected 1.27 (colored)

lint: clean up

Revision 1.121 / (download) - annotate - [select for diffs], Sun Dec 10 14:59:47 2023 UTC (4 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.120: +3 -3 lines
Diff to previous 1.120 (colored) to selected 1.27 (colored)

lint: clean up comments

No functional change.

Revision 1.120 / (download) - annotate - [select for diffs], Sun Dec 3 18:17:41 2023 UTC (4 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.119: +3 -3 lines
Diff to previous 1.119 (colored) to selected 1.27 (colored)

lint: in declarations, replace tab with space

Previously, in some cases, the keywords 'const' or 'struct' were
followed by a tab, which doesn't make sense.

No functional change.

Revision 1.119 / (download) - annotate - [select for diffs], Sun Dec 3 13:12:40 2023 UTC (4 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.118: +4 -4 lines
Diff to previous 1.118 (colored) to selected 1.27 (colored)

lint: re-wrap comments

No functional change.

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

lint: indent statement continuations consistently

No binary change.

Revision 1.117 / (download) - annotate - [select for diffs], Thu Oct 26 20:21:13 2023 UTC (5 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.116: +8 -8 lines
Diff to previous 1.116 (colored) to selected 1.27 (colored)

lint: reduce number of negations, fix variable name

No functional change.

Revision 1.116 / (download) - annotate - [select for diffs], Thu Oct 26 19:56:31 2023 UTC (5 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.115: +13 -15 lines
Diff to previous 1.115 (colored) to selected 1.27 (colored)

lint: merge redundant variables

No functional change.

Revision 1.115 / (download) - annotate - [select for diffs], Wed Oct 25 23:05:14 2023 UTC (5 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.114: +45 -66 lines
Diff to previous 1.114 (colored) to selected 1.27 (colored)

lint: make variable names more expressive, remove redundant comments

No functional change.

Revision 1.114 / (download) - annotate - [select for diffs], Thu Jul 13 08:40:38 2023 UTC (9 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.113: +3 -3 lines
Diff to previous 1.113 (colored) to selected 1.27 (colored)

lint: indent copyright lines consistently

Revision 1.113 / (download) - annotate - [select for diffs], Mon Jul 3 11:16:32 2023 UTC (9 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.112: +12 -15 lines
Diff to previous 1.112 (colored) to selected 1.27 (colored)

lint: sync usage messages with reality

Revision 1.112 / (download) - annotate - [select for diffs], Wed Jun 28 13:50:47 2023 UTC (9 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.111: +6 -3 lines
Diff to previous 1.111 (colored) to selected 1.27 (colored)

lint: allow to keep the preprocessor output on success as well

Revision 1.111 / (download) - annotate - [select for diffs], Fri Jun 9 13:31:11 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.110: +265 -270 lines
Diff to previous 1.110 (colored) to selected 1.27 (colored)

lint: sort functions in calling order

No functional change.

Revision 1.110 / (download) - annotate - [select for diffs], Fri Jun 9 13:03:49 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.109: +11 -11 lines
Diff to previous 1.109 (colored) to selected 1.27 (colored)

lint: indent local variables consistently

No binary change.

Revision 1.109 / (download) - annotate - [select for diffs], Sun Feb 19 19:27:02 2023 UTC (13 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.108: +8 -9 lines
Diff to previous 1.108 (colored) to selected 1.27 (colored)

lint: make basename simpler

There is no need to handle trailing slashes since lint only handles
regular files in diagnostics, not directories. Furthermore, only the
last '/' was ignored, but multiple trailing slashes would not.

Revision 1.108 / (download) - annotate - [select for diffs], Sun Jan 22 15:20:01 2023 UTC (14 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.107: +3 -4 lines
Diff to previous 1.107 (colored) to selected 1.27 (colored)

lint: repurpose the '-d' option to specify DESTDIR

Previously, passing '-nostdinc -isystem $dir' only searched the given
directory but not any compiler-specific directories.

Discovered by fontconfig, which includes <stdatomic.h> from C11, which
lives in /usr/include/gcc-10 instead of /usr/include.

Change the preprocessor options to '--sysroot' instead, to align them
with how the compiler is invoked using build.sh.

Revision 1.107 / (download) - annotate - [select for diffs], Sat Jan 21 11:29:30 2023 UTC (14 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.106: +3 -3 lines
Diff to previous 1.106 (colored) to selected 1.27 (colored)

lint: catch more write errors when copying files

Revision 1.106 / (download) - annotate - [select for diffs], Sat Jan 21 11:22:21 2023 UTC (14 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.105: +42 -70 lines
Diff to previous 1.105 (colored) to selected 1.27 (colored)

lint: remove unnecessary abstraction layer for passing arguments

The abstraction layer of the pass_to functions wasn't worth its weight.
After inlining the functions, the code is even clearer than before.

No functional change.

Revision 1.105 / (download) - annotate - [select for diffs], Fri Jan 20 23:06:26 2023 UTC (14 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.104: +3 -3 lines
Diff to previous 1.104 (colored) to selected 1.27 (colored)

lint: keep output from cpp if cpp fails

Previously, lint only kept the cpp output if lint1 failed.  Due to
subtle differences in the preprocessing, there can be cases where the
preprocessor already fails, for example when it takes a different
'#ifdef' branch and therefore tries to include nonexistent files.  In
such a case, preserving the output of the preprocessor is helpful to
compare it with the regular output of cpp, so keep it.

Revision 1.104 / (download) - annotate - [select for diffs], Sun Jan 15 23:32:10 2023 UTC (15 months ago) by rillig
Branch: MAIN
Changes since 1.103: +3 -3 lines
Diff to previous 1.103 (colored) to selected 1.27 (colored)

xlint: fix null pointer dereference for lint -V (since today)

Building the argument lists further away from the vfork call in xlint.c
1.100 had the side effect that the trailing null pointer was added
outside run_child.

Revision 1.103 / (download) - annotate - [select for diffs], Sun Jan 15 22:26:49 2023 UTC (15 months ago) by rillig
Branch: MAIN
Changes since 1.102: +28 -29 lines
Diff to previous 1.102 (colored) to selected 1.27 (colored)

lint: clean up main function

No functional change.

Revision 1.102 / (download) - annotate - [select for diffs], Sun Jan 15 22:06:37 2023 UTC (15 months ago) by rillig
Branch: MAIN
Changes since 1.101: +80 -83 lines
Diff to previous 1.101 (colored) to selected 1.27 (colored)

lint: extract run_cpp and run_lint1 to separate functions

Move run_lint2 further to the top, to save a forward declaration.

No functional change.

Revision 1.101 / (download) - annotate - [select for diffs], Sun Jan 15 21:46:15 2023 UTC (15 months ago) by rillig
Branch: MAIN
Changes since 1.100: +8 -13 lines
Diff to previous 1.100 (colored) to selected 1.27 (colored)

lint: reduce number of local variables in lbasename

No functional change.

Revision 1.100 / (download) - annotate - [select for diffs], Sun Jan 15 21:27:36 2023 UTC (15 months ago) by rillig
Branch: MAIN
Changes since 1.99: +8 -10 lines
Diff to previous 1.99 (colored) to selected 1.27 (colored)

lint: move argument list modification further away from vfork

Just to be on the safe side.

While here, don't allocate argument strings needlessly.

No functional change.

Revision 1.99 / (download) - annotate - [select for diffs], Sun Jan 15 15:20:18 2023 UTC (15 months ago) by rillig
Branch: MAIN
Changes since 1.98: +84 -127 lines
Diff to previous 1.98 (colored) to selected 1.27 (colored)

lint: turn O(n^2) to O(n) for list of arguments to lint child processes

Previously, adding an argument to the lint child processes (cpp, lint1,
lint2) each time searched the list of arguments for the terminating
null pointer and then reallocated the memory for storing the strings.

Replace the above with a standard resizable array implementation and
give it a proper name, to avoid 'char ***' in the code.

The terminating null pointer in the lists is only required when passing
the list to execvp.  In all other cases it's not needed, so drop it.

No functional change.

Revision 1.98 / (download) - annotate - [select for diffs], Sun Jan 15 14:43:39 2023 UTC (15 months ago) by rillig
Branch: MAIN
Changes since 1.97: +29 -36 lines
Diff to previous 1.97 (colored) to selected 1.27 (colored)

lint: rename local functions to be more readable

No functional change.

Revision 1.97 / (download) - annotate - [select for diffs], Sat Jan 14 10:38:36 2023 UTC (15 months ago) by rillig
Branch: MAIN
Changes since 1.96: +6 -6 lines
Diff to previous 1.96 (colored) to selected 1.27 (colored)

lint: explicitly ignore errors when printing status messages

No binary change.

Revision 1.96 / (download) - annotate - [select for diffs], Sat Jan 14 09:21:58 2023 UTC (15 months ago) by rillig
Branch: MAIN
Changes since 1.95: +6 -11 lines
Diff to previous 1.95 (colored) to selected 1.27 (colored)

lint: remove unnecessary MBLKSIZ, use stack buffer in xlint

No functional change.

Revision 1.95 / (download) - annotate - [select for diffs], Sat Oct 1 09:48:02 2022 UTC (18 months, 2 weeks ago) by rillig
Branch: 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
Changes since 1.94: +4 -4 lines
Diff to previous 1.94 (colored) to selected 1.27 (colored)

lint: remove redundant cast

Since C90 prototypes, integer arguments are converted to the correct
parameter type.

No functional change.

Revision 1.94 / (download) - annotate - [select for diffs], Tue Jul 5 22:50:41 2022 UTC (21 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.93: +4 -3 lines
Diff to previous 1.93 (colored) to selected 1.27 (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.93 / (download) - annotate - [select for diffs], Mon May 30 23:02:02 2022 UTC (22 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.92: +7 -6 lines
Diff to previous 1.92 (colored) to selected 1.27 (colored)

lint: clean up usage messages

The two synopsis forms differed in the spelling of 'file ...'.

The options string for getopt does not start with ':', which led to a
duplicate message 'unknown option -- ?' followed by 'Unknown flag ?'.

Be more specific when calling 'lint file.c -u'; the message 'Unknown
argument' was not helpful as it didn't pinpoint that there are two
different phases for parsing options.  In the second phase, only the
options '-L' and '-l' are recognized.

In the manual page, mention the difference between the two synopsis
forms as early as possible.  The two synopsis forms are very similar and
both have far to many options to see the difference at a glance.

Revision 1.92 / (download) - annotate - [select for diffs], Fri May 20 21:18:55 2022 UTC (23 months ago) by rillig
Branch: MAIN
Changes since 1.91: +3 -3 lines
Diff to previous 1.91 (colored) to selected 1.27 (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.91 / (download) - annotate - [select for diffs], Sat Apr 16 00:15:47 2022 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.90: +16 -6 lines
Diff to previous 1.90 (colored) to selected 1.27 (colored)

lint: skip duplicate -llib and -Llibdir options

This removes many of the currently 26.000 'multiply defined' lines from
a typical NetBSD build.  Duplicate libraries happen a lot due to
overlapping transitive dependencies.  An example is usr.bin/telnet,
which links to -lcrypto and several other libraries twice.

Revision 1.90 / (download) - annotate - [select for diffs], Fri Apr 15 16:08:39 2022 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.89: +40 -4 lines
Diff to previous 1.89 (colored) to selected 1.27 (colored)

lint: in verbose mode, quote shell commands in output

Revision 1.89 / (download) - annotate - [select for diffs], Tue Mar 8 23:24:20 2022 UTC (2 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.88: +3 -3 lines
Diff to previous 1.88 (colored) to selected 1.27 (colored)

lint: fix typo in comment

No binary change.

Revision 1.88 / (download) - annotate - [select for diffs], Tue Dec 28 22:59:56 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.87: +2 -3 lines
Diff to previous 1.87 (colored) to selected 1.27 (colored)

lint: do not output "Lint pass2:"

A colon at the end of a line requires at least 1 follow-up line, but
xlint cannot know whether lint2 will find anything to complain about.
Having a colon followed by nothing creates unnecessary confusion.

Revision 1.87 / (download) - annotate - [select for diffs], Tue Dec 14 16:22:30 2021 UTC (2 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.86: +4 -3 lines
Diff to previous 1.86 (colored) to selected 1.27 (colored)

Also accept -W to pass to cpp

Revision 1.86 / (download) - annotate - [select for diffs], Sun Nov 28 02:54:26 2021 UTC (2 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.85: +2 -4 lines
Diff to previous 1.85 (colored) to selected 1.27 (colored)

remove extra line

Revision 1.85 / (download) - annotate - [select for diffs], Sun Nov 28 02:07:02 2021 UTC (2 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.84: +37 -17 lines
Diff to previous 1.84 (colored) to selected 1.27 (colored)

Explain the usage errors.

Revision 1.84 / (download) - annotate - [select for diffs], Sun Nov 21 10:39:47 2021 UTC (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.83: +35 -34 lines
Diff to previous 1.83 (colored) to selected 1.27 (colored)

lint: rename list_add to list_add_ref and list_add_copy to list_add

The function for copying the string is used more often, so use the
simpler name for it.

No functional change.

Revision 1.83 / (download) - annotate - [select for diffs], Sun Nov 21 10:08:10 2021 UTC (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.82: +3 -7 lines
Diff to previous 1.82 (colored) to selected 1.27 (colored)

lint: remove redundant function prototypes

Revision 1.82 / (download) - annotate - [select for diffs], Sun Sep 5 18:17:15 2021 UTC (2 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.81: +2 -4 lines
Diff to previous 1.81 (colored) to selected 1.27 (colored)

lint: hide irrelevant type information from lint2

No functional change.

Revision 1.81 / (download) - annotate - [select for diffs], Sun Sep 5 16:15:05 2021 UTC (2 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.80: +3 -3 lines
Diff to previous 1.80 (colored) to selected 1.27 (colored)

lint: fix some more lint warnings

The only remaining warnings are in scan.c, which is a generated Flex
scanner.

No functional change.

Revision 1.80 / (download) - annotate - [select for diffs], Sat Aug 28 14:42:29 2021 UTC (2 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.79: +4 -4 lines
Diff to previous 1.79 (colored) to selected 1.27 (colored)

lint: explicitly ignore the return value of close

Revision 1.79 / (download) - annotate - [select for diffs], Fri Aug 20 05:45:19 2021 UTC (2 years, 8 months ago) by rillig
Branch: MAIN
Changes since 1.78: +4 -5 lines
Diff to previous 1.78 (colored) to selected 1.27 (colored)

mkdep: make argument of findcc const

Previously, findcc modified its argument string, even though it had been
declared as 'const char *'.  This triggered a lint warning that "strchr
effectively discards 'const char *' from argument", in fact, this code
caused the lint check to be implemented in the first place.

The first attempt at fixing it by removing the 'const' from the
parameter type was a bad idea since it made the API of that function
more complicated.

Revert back to making the parameter a 'const char *' and duplicate that
string internally as necessary.  Add a few more tests for absolute
pathnames since these had been missing before.  There are no tests yet
for snprintf with too long strings, but the current change does not
modify that part of the code.

Revision 1.78 / (download) - annotate - [select for diffs], Thu Aug 19 21:21:04 2021 UTC (2 years, 8 months ago) by rillig
Branch: MAIN
Changes since 1.77: +5 -4 lines
Diff to previous 1.77 (colored) to selected 1.27 (colored)

mkdep: fix prototype of findcc

A function that modifies a string argument must not declare that
argument as 'const char *', even if all callers (mkdep and lint) always
pass it a modifiable string.

No functional change.

Revision 1.77 / (download) - annotate - [select for diffs], Thu Aug 19 16:29:41 2021 UTC (2 years, 8 months ago) by rillig
Branch: MAIN
Changes since 1.76: +9 -10 lines
Diff to previous 1.76 (colored) to selected 1.27 (colored)

lint: remove redundant variable Bflag

No functional change.

Revision 1.76 / (download) - annotate - [select for diffs], Thu Aug 19 16:18:43 2021 UTC (2 years, 8 months ago) by rillig
Branch: MAIN
Changes since 1.75: +3 -4 lines
Diff to previous 1.75 (colored) to selected 1.27 (colored)

lint: remove unused static variable

Revision 1.75 / (download) - annotate - [select for diffs], Thu Aug 19 16:15:31 2021 UTC (2 years, 8 months ago) by rillig
Branch: MAIN
Changes since 1.74: +6 -12 lines
Diff to previous 1.74 (colored) to selected 1.27 (colored)

lint: simplify code for adding '-l' and '-L' to libraries

No functional change.

Revision 1.74 / (download) - annotate - [select for diffs], Thu Aug 19 16:05:56 2021 UTC (2 years, 8 months ago) by rillig
Branch: MAIN
Changes since 1.73: +10 -24 lines
Diff to previous 1.73 (colored) to selected 1.27 (colored)

lint: merge duplicate code for passing flags to subprocesses

No functional change.

Revision 1.73 / (download) - annotate - [select for diffs], Thu Aug 19 15:55:23 2021 UTC (2 years, 8 months ago) by rillig
Branch: MAIN
Changes since 1.72: +46 -26 lines
Diff to previous 1.72 (colored) to selected 1.27 (colored)

lint: uniformly pass command line flags to subprocesses

No functional change.

Revision 1.72 / (download) - annotate - [select for diffs], Mon Aug 9 21:27:20 2021 UTC (2 years, 8 months ago) by rillig
Branch: MAIN
Changes since 1.71: +2 -10 lines
Diff to previous 1.71 (colored) to selected 1.27 (colored)

lint: remove commented-out preprocessor options

These have been commented out since 2002.

Revision 1.71 / (download) - annotate - [select for diffs], Sun Aug 8 16:19:18 2021 UTC (2 years, 8 months ago) by rillig
Branch: MAIN
Changes since 1.70: +82 -90 lines
Diff to previous 1.70 (colored) to selected 1.27 (colored)

lint: group global variables by the subprocess

No functional change.

Revision 1.70 / (download) - annotate - [select for diffs], Sun Aug 8 16:11:08 2021 UTC (2 years, 8 months ago) by rillig
Branch: MAIN
Changes since 1.69: +11 -11 lines
Diff to previous 1.69 (colored) to selected 1.27 (colored)

lint: rename list_free to list_clear

The previous name suggested that the function would free the list
itself, which it doesn't.

Revision 1.69 / (download) - annotate - [select for diffs], Sun Aug 8 15:29:24 2021 UTC (2 years, 8 months ago) by rillig
Branch: MAIN
Changes since 1.68: +4 -11 lines
Diff to previous 1.68 (colored) to selected 1.27 (colored)

lint: remove dead code for reading from stdin

Since xlint.c 1.27 from 2002-01-31, it has not been possible to read
from stdin anymore.  Apparently nobody missed this feature in the last
19 years.

Revision 1.68 / (download) - annotate - [select for diffs], Sun Aug 8 15:06:44 2021 UTC (2 years, 8 months ago) by rillig
Branch: MAIN
Changes since 1.67: +4 -26 lines
Diff to previous 1.67 (colored) to selected 1.27 (colored)

lint: inline list_add_defines

No functional change.

Revision 1.67 / (download) - annotate - [select for diffs], Sun Aug 8 15:03:47 2021 UTC (2 years, 8 months ago) by rillig
Branch: MAIN
Changes since 1.66: +81 -81 lines
Diff to previous 1.66 (colored) to selected 1.27 (colored)

lint: rename functions for handling string lists

No functional change.

Revision 1.66 / (download) - annotate - [select for diffs], Sun Aug 8 14:05:33 2021 UTC (2 years, 8 months ago) by rillig
Branch: MAIN
Changes since 1.65: +28 -25 lines
Diff to previous 1.65 (colored) to selected 1.27 (colored)

lint: make data flow in findlibs simpler

No functional change.

Revision 1.65 / (download) - annotate - [select for diffs], Sun Aug 8 13:34:57 2021 UTC (2 years, 8 months ago) by rillig
Branch: MAIN
Changes since 1.64: +11 -23 lines
Diff to previous 1.64 (colored) to selected 1.27 (colored)

lint: make memory management in xlint simpler

No functional change.

Revision 1.64 / (download) - annotate - [select for diffs], Sun Aug 1 18:13:53 2021 UTC (2 years, 8 months ago) by rillig
Branch: MAIN
Changes since 1.63: +4 -4 lines
Diff to previous 1.63 (colored) to selected 1.27 (colored)

lint: make xasprintf simpler

No functional change.

Revision 1.63 / (download) - annotate - [select for diffs], Sun May 2 21:05:42 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
CVS Tags: cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Changes since 1.62: +9 -4 lines
Diff to previous 1.62 (colored) to selected 1.27 (colored)

lint: on request, keep the preprocessor output

Previously, the simplest way of getting the preprocessed translation
unit was to run lint with the additional flag -V, which outputs the
command line of the C preprocessor, among other things.  That command
line does not include the proper quoting though, so it cannot be used
verbatim as a shell command if the command line contains spaces such as
in -Du64="unsigned long long".

In the common situation where lint is run via a Makefile, the option -V
had to be added in the Makefile itself since there is no make variable
for additional user-settable lint flags.  This is not straight-forward
enough.

Adding another command line option for this purpose would reduce the
remaining namespace for options.  Most of the 52 letters are already
used up.

To make this situation as simple as possible, preserve the output of the
C preprocessor depending on an environment variable.

Revision 1.62 / (download) - annotate - [select for diffs], Sun Apr 18 22:51:25 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.61: +3 -3 lines
Diff to previous 1.61 (colored) to selected 1.27 (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.61 / (download) - annotate - [select for diffs], Wed Apr 14 20:35:31 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.60: +62 -41 lines
Diff to previous 1.60 (colored) to selected 1.27 (colored)

lint: un-abbreviate code for passing options to cpp, lint1 and lint2

No functional change.

Revision 1.60 / (download) - annotate - [select for diffs], Wed Apr 14 20:06:40 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.59: +9 -4 lines
Diff to previous 1.59 (colored) to selected 1.27 (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.59 / (download) - annotate - [select for diffs], Wed Apr 14 19:25:48 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.58: +15 -11 lines
Diff to previous 1.58 (colored) to selected 1.27 (colored)

lint: arrange options in the usage messages

* lowercase the word 'usage'
* group the preprocessor flags on a line of their own
* add missing closing ']' for '-X'
* properly indent the lines

Revision 1.58 / (download) - annotate - [select for diffs], Fri Apr 2 12:16:50 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.57: +24 -24 lines
Diff to previous 1.57 (colored) to selected 1.27 (colored)

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

No functional change.

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

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

No functional change.

Revision 1.56 / (download) - annotate - [select for diffs], Sat Jan 16 16:53:24 2021 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.55: +13 -13 lines
Diff to previous 1.55 (colored) to selected 1.27 (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.55 / (download) - annotate - [select for diffs], Sat Jan 16 16:03:46 2021 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.54: +9 -3 lines
Diff to previous 1.54 (colored) to selected 1.27 (colored)

lint: in strict bool mode, integer constants do not have type bool

Previously, lint1 allowed integer constants such as 0 and 1 to be used
as bool constants.  This was only half-baked since after fixing all
error messages from that strict mode, there may still be integer
literals in the code that should be replaced with true or false.  This
would stop a migration from int to bool in the middle, leaving
inconsistent code around.

To find the remaining type inconsistencies, treat integers and bool as
completely incompatible, even for compile time constants.

Revision 1.54 / (download) - annotate - [select for diffs], Sat Jan 16 02:40:03 2021 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.53: +16 -16 lines
Diff to previous 1.53 (colored) to selected 1.27 (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.53 / (download) - annotate - [select for diffs], Tue Jan 12 20:42:01 2021 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.52: +7 -5 lines
Diff to previous 1.52 (colored) to selected 1.27 (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.52 / (download) - annotate - [select for diffs], Mon Jan 4 22:26:51 2021 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.51: +3 -3 lines
Diff to previous 1.51 (colored) to selected 1.27 (colored)

lint: fix typos and other minor stylistic issues

Revision 1.51 / (download) - annotate - [select for diffs], Tue Dec 29 11:35:11 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.50: +9 -9 lines
Diff to previous 1.50 (colored) to selected 1.27 (colored)

lint: remove redundant parentheses around return value

Revision 1.50 / (download) - annotate - [select for diffs], Sat May 23 17:28:27 2020 UTC (3 years, 10 months ago) by christos
Branch: MAIN
Changes since 1.49: +9 -5 lines
Diff to previous 1.49 (colored) to selected 1.27 (colored)

Use -Z to pass arguments to ccp(1) directly. Can be used as:
    -Z-include -Zfile.h

Revision 1.46.14.2 / (download) - annotate - [select for diffs], Wed Apr 8 14:09:19 2020 UTC (4 years ago) by martin
Branch: phil-wifi
Changes since 1.46.14.1: +4 -7 lines
Diff to previous 1.46.14.1 (colored) to branchpoint 1.46 (colored) next main 1.47 (colored) to selected 1.27 (colored)

Merge changes from current as of 20200406

Revision 1.49 / (download) - annotate - [select for diffs], Mon Feb 10 04:54:01 2020 UTC (4 years, 2 months ago) by christos
Branch: MAIN
CVS Tags: phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, is-mlppp-base, is-mlppp
Changes since 1.48: +5 -8 lines
Diff to previous 1.48 (colored) to selected 1.27 (colored)

use asprintf().

Revision 1.48 / (download) - annotate - [select for diffs], Sun Feb 9 08:10:25 2020 UTC (4 years, 2 months ago) by fox
Branch: MAIN
Changes since 1.47: +6 -6 lines
Diff to previous 1.47 (colored) to selected 1.27 (colored)

usr.bin/xlint: Fix -Werror=format-overflow= error.

Replace sprintf(3) with snprintf(3).

Error was reported when build.sh was run with MKLIBCSANITIZER=yes flag.

Reviewed by: kamil@

Revision 1.46.14.1 / (download) - annotate - [select for diffs], Mon Jun 10 22:10:27 2019 UTC (4 years, 10 months ago) by christos
Branch: phil-wifi
Changes since 1.46: +4 -2 lines
Diff to previous 1.46 (colored) to selected 1.27 (colored)

Sync with HEAD

Revision 1.47 / (download) - annotate - [select for diffs], Sat Apr 13 15:08:49 2019 UTC (5 years ago) by christos
Branch: MAIN
CVS Tags: phil-wifi-20191119, phil-wifi-20190609, 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
Changes since 1.46: +4 -2 lines
Diff to previous 1.46 (colored) to selected 1.27 (colored)

Undefine SSE stuff; we don't want portable code to depend on it and we
don't provide the necessary headers.

Revision 1.44.24.1 / (download) - annotate - [select for diffs], Sat Jan 7 08:56:59 2017 UTC (7 years, 3 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.44: +9 -5 lines
Diff to previous 1.44 (colored) next main 1.45 (colored) to selected 1.27 (colored)

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

Revision 1.46 / (download) - annotate - [select for diffs], Sat Dec 24 17:43:45 2016 UTC (7 years, 3 months ago) by christos
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, phil-wifi-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, 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-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
Changes since 1.45: +9 -5 lines
Diff to previous 1.45 (colored) to selected 1.27 (colored)

Add -R (source filename remapping) for MKREPRO

Revision 1.45 / (download) - annotate - [select for diffs], Mon Sep 5 00:40:30 2016 UTC (7 years, 7 months ago) by sevan
Branch: MAIN
CVS Tags: pgoyette-localcount-20161104, localcount-20160914
Changes since 1.44: +2 -4 lines
Diff to previous 1.44 (colored) to selected 1.27 (colored)

Drop main() prototype.

Revision 1.44 / (download) - annotate - [select for diffs], Sun Sep 18 09:07:35 2011 UTC (12 years, 7 months ago) by njoly
Branch: MAIN
CVS Tags: yamt-pagecache-tag8, yamt-pagecache-base9, yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, yamt-pagecache-base5, yamt-pagecache-base4, yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, yamt-pagecache, tls-maxphys-base, tls-maxphys, 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, 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, netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, netbsd-6, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, agc-symver-base, agc-symver
Branch point for: pgoyette-localcount
Changes since 1.43: +3 -3 lines
Diff to previous 1.43 (colored) to selected 1.27 (colored)

Fix lseek(2) swapped arguments.

Revision 1.43 / (download) - annotate - [select for diffs], Mon Mar 22 01:29:30 2010 UTC (14 years, 1 month ago) by mrg
Branch: MAIN
CVS Tags: matt-mips64-premerge-20101231, cherry-xenmp-base, cherry-xenmp, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2
Changes since 1.42: +3 -3 lines
Diff to previous 1.42 (colored) to selected 1.27 (colored)

convert -idirafter to -isystem, as recommended by cgd in PR 11843.
most of the list in that PR were already done.

Revision 1.40.6.1 / (download) - annotate - [select for diffs], Wed May 13 19:20:13 2009 UTC (14 years, 11 months ago) by jym
Branch: jym-xensuspend
Changes since 1.40: +13 -11 lines
Diff to previous 1.40 (colored) next main 1.41 (colored) to selected 1.27 (colored)

Sync with HEAD.

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

Revision 1.42 / (download) - annotate - [select for diffs], Wed Apr 15 01:20:57 2009 UTC (15 years ago) by christos
Branch: MAIN
CVS Tags: matt-premerge-20091211, jym-xensuspend-nbase, jym-xensuspend-base
Changes since 1.41: +7 -7 lines
Diff to previous 1.41 (colored) to selected 1.27 (colored)

Lukemify (WARNS=4)

Revision 1.41 / (download) - annotate - [select for diffs], Tue Apr 14 09:08:39 2009 UTC (15 years ago) by lukem
Branch: MAIN
Changes since 1.40: +8 -6 lines
Diff to previous 1.40 (colored) to selected 1.27 (colored)

fix -Wcast-qual issues

Revision 1.38.6.1 / (download) - annotate - [select for diffs], Thu Sep 18 04:29:28 2008 UTC (15 years, 7 months ago) by wrstuden
Branch: wrstuden-revivesa
Changes since 1.38: +8 -3 lines
Diff to previous 1.38 (colored) next main 1.39 (colored) to selected 1.27 (colored)

Sync with wrstuden-revivesa-base-2.

Revision 1.40 / (download) - annotate - [select for diffs], Fri Aug 29 00:44:48 2008 UTC (15 years, 7 months ago) by gmcgarry
Branch: MAIN
CVS Tags: wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, netbsd-5-base, netbsd-5-2-RELEASE, netbsd-5-2-RC1, netbsd-5-2-3-RELEASE, netbsd-5-2-2-RELEASE, netbsd-5-2-1-RELEASE, netbsd-5-2, netbsd-5-1-RELEASE, netbsd-5-1-RC4, netbsd-5-1-RC3, netbsd-5-1-RC2, netbsd-5-1-RC1, netbsd-5-1-5-RELEASE, netbsd-5-1-4-RELEASE, netbsd-5-1-3-RELEASE, netbsd-5-1-2-RELEASE, netbsd-5-1-1-RELEASE, netbsd-5-1, netbsd-5-0-RELEASE, netbsd-5-0-RC4, netbsd-5-0-RC3, netbsd-5-0-RC2, netbsd-5-0-RC1, netbsd-5-0-2-RELEASE, netbsd-5-0-1-RELEASE, netbsd-5-0, netbsd-5, matt-nb5-pq3-base, matt-nb5-pq3, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-premerge-20091211, matt-nb5-mips64-k15, matt-nb5-mips64, matt-nb4-mips64-k7-u2a-k9b, matt-mips64-base2
Branch point for: jym-xensuspend
Changes since 1.39: +3 -2 lines
Diff to previous 1.39 (colored) to selected 1.27 (colored)

Undefine __PCC__ the same as __GNUC__ inside lint.

Revision 1.39 / (download) - annotate - [select for diffs], Thu Jul 31 15:25:18 2008 UTC (15 years, 8 months ago) by christos
Branch: MAIN
Changes since 1.38: +7 -3 lines
Diff to previous 1.38 (colored) to selected 1.27 (colored)

enable -P

Revision 1.37.12.1 / (download) - annotate - [select for diffs], Sun Mar 23 00:49:04 2008 UTC (16 years, 1 month ago) by matt
Branch: matt-armv6
Changes since 1.37: +5 -2 lines
Diff to previous 1.37 (colored) next main 1.38 (colored) to selected 1.27 (colored)

sync with HEAD

Revision 1.38 / (download) - annotate - [select for diffs], Thu Jan 10 05:15:07 2008 UTC (16 years, 3 months ago) by lukem
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base4, yamt-pf42-base3, yamt-pf42-base2, yamt-pf42-base, yamt-pf42, wrstuden-revivesa-base-1, wrstuden-revivesa-base, matt-armv6-nbase, keiichi-mipv6-nbase, keiichi-mipv6-base, keiichi-mipv6, hpcarm-cleanup-nbase, hpcarm-cleanup-base
Branch point for: wrstuden-revivesa
Changes since 1.37: +5 -2 lines
Diff to previous 1.37 (colored) to selected 1.27 (colored)

Convert to using raise_default_signal(3).

Revision 1.37 / (download) - annotate - [select for diffs], Thu Jun 2 04:38:46 2005 UTC (18 years, 10 months ago) by lukem
Branch: MAIN
CVS Tags: 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-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: matt-armv6
Changes since 1.36: +4 -2 lines
Diff to previous 1.36 (colored) to selected 1.27 (colored)

appease gcc -Wuninitialized

Revision 1.36 / (download) - annotate - [select for diffs], Wed Feb 9 21:24:48 2005 UTC (19 years, 2 months ago) by dsl
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.35: +3 -4 lines
Diff to previous 1.35 (colored) to selected 1.27 (colored)

Only pass -Wtraditional to cpp for lint -t ...
Stops warnings about pre-processor constructs like #elif - which there is
no point detecting now that we've changed much of the code to require an
ANSI C compiler.

Revision 1.27.2.1 / (download) - annotate - [select for diffs], Fri Jul 23 15:03:58 2004 UTC (19 years, 9 months ago) by tron
Branch: netbsd-1-6
Changes since 1.27: +4 -2 lines
Diff to previous 1.27 (colored) next main 1.28 (colored)

Apply patch (requested by dbj in ticket 1724):
Fix problems when building the netbsd-1-6 branch with GCC 3.3.3.

Revision 1.34.2.1 / (download) - annotate - [select for diffs], Tue Jun 22 07:23:26 2004 UTC (19 years, 10 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.34: +6 -2 lines
Diff to previous 1.34 (colored) next main 1.35 (colored) to selected 1.27 (colored)

Pull up revision 1.35 (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.35 / (download) - annotate - [select for diffs], Sun Jun 20 22:20:17 2004 UTC (19 years, 10 months ago) by jmc
Branch: MAIN
Changes since 1.34: +6 -2 lines
Diff to previous 1.34 (colored) to selected 1.27 (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.34 / (download) - annotate - [select for diffs], Mon Jan 26 21:51:11 2004 UTC (20 years, 2 months ago) by dsl
Branch: MAIN
CVS Tags: netbsd-2-0-base
Branch point for: netbsd-2-0
Changes since 1.33: +4 -3 lines
Diff to previous 1.33 (colored) to selected 1.27 (colored)

Pass -MD through to cpp so that it can generate a depend file.
(Actually pass any -M <arg> through, but -MD is most useful.)

Revision 1.33 / (download) - annotate - [select for diffs], Mon Oct 27 00:12:44 2003 UTC (20 years, 5 months ago) by lukem
Branch: MAIN
Changes since 1.32: +3 -3 lines
Diff to previous 1.32 (colored) to selected 1.27 (colored)

Overhaul how `build.sh tools' are used:

    *	Rename "config.h" to "nbtool_config.h" and
	HAVE_CONFIG_H to HAVE_NBTOOL_CONFIG_H.
	This makes in more obvious in the source when we're using
	tools/compat/config.h versus "standard autoconf" config.h

    *	Consistently move the inclusion of nbtool_config.h to before
    	<sys/cdefs.h> so that the former can provide __RCSID() (et al),
    	and there's no need to protect those macros any more.

These changes should make it easier to "tool-ify" a program by adding:
	#if HAVE_NBTOOL_CONFIG_H
	#include "nbtool_config.h"
	#endif
to the top of the source files (for the general case).

Revision 1.32 / (download) - annotate - [select for diffs], Mon Jan 6 13:10:31 2003 UTC (21 years, 3 months ago) by wiz
Branch: MAIN
Changes since 1.31: +3 -3 lines
Diff to previous 1.31 (colored) to selected 1.27 (colored)

synchronous, not syncronous.

Revision 1.31 / (download) - annotate - [select for diffs], Sun Nov 24 20:24:54 2002 UTC (21 years, 4 months ago) by thorpej
Branch: MAIN
CVS Tags: fvdl_fs64_base
Changes since 1.30: +4 -2 lines
Diff to previous 1.30 (colored) to selected 1.27 (colored)

Skip passing -$ to the preprocessor, for now.

Revision 1.30 / (download) - annotate - [select for diffs], Mon Oct 21 21:16:13 2002 UTC (21 years, 6 months ago) by christos
Branch: MAIN
Changes since 1.29: +13 -7 lines
Diff to previous 1.29 (colored) to selected 1.27 (colored)

add -S flag for c99 support.

Revision 1.29 / (download) - annotate - [select for diffs], Sat Jul 20 08:40:17 2002 UTC (21 years, 9 months ago) by grant
Branch: MAIN
Changes since 1.28: +3 -3 lines
Diff to previous 1.28 (colored) to selected 1.27 (colored)

sweep of errx/warnx, remove unnecessary trailing \n

Revision 1.28 / (download) - annotate - [select for diffs], Fri Jun 14 23:20:42 2002 UTC (21 years, 10 months ago) by simonb
Branch: MAIN
Changes since 1.27: +24 -19 lines
Diff to previous 1.27 (colored)

Use findcc() from ../mkdep so ${CC} can contain multiple tokens instead
of trying to exec the whole contents of ${CC}.

Revision 1.27 / (download) - annotate - [selected], Thu Jan 31 19:09:33 2002 UTC (22 years, 2 months ago) by tv
Branch: MAIN
CVS Tags: netbsd-1-6-base, netbsd-1-6-RELEASE, netbsd-1-6-RC3, netbsd-1-6-RC2, netbsd-1-6-RC1, netbsd-1-6-PATCH002-RELEASE, netbsd-1-6-PATCH002-RC4, netbsd-1-6-PATCH002-RC3, netbsd-1-6-PATCH002-RC2, netbsd-1-6-PATCH002-RC1, netbsd-1-6-PATCH002, netbsd-1-6-PATCH001-RELEASE, netbsd-1-6-PATCH001-RC3, netbsd-1-6-PATCH001-RC2, netbsd-1-6-PATCH001-RC1, netbsd-1-6-PATCH001
Branch point for: netbsd-1-6
Changes since 1.26: +52 -19 lines
Diff to previous 1.26 (colored)

* Use setprogname() in main().
* Don't grossly abuse getopt(); allow only -l and -L after filenames are
  encountered, and do the parsing of these options manually.

Revision 1.26 / (download) - annotate - [select for diffs], Tue Jan 22 01:14:03 2002 UTC (22 years, 3 months ago) by thorpej
Branch: MAIN
Changes since 1.25: +3 -2 lines
Diff to previous 1.25 (colored) to selected 1.27 (colored)

Add a missing "break;" statement so that this actually works again.

Revision 1.25 / (download) - annotate - [select for diffs], Mon Jan 21 19:49:52 2002 UTC (22 years, 3 months ago) by tv
Branch: MAIN
Changes since 1.24: +20 -15 lines
Diff to previous 1.24 (colored) to selected 1.27 (colored)

Add hooks for compiling on non-NetBSD hosts.

Revision 1.24 / (download) - annotate - [select for diffs], Wed Oct 24 02:31:10 2001 UTC (22 years, 6 months ago) by thorpej
Branch: MAIN
Changes since 1.23: +22 -6 lines
Diff to previous 1.23 (colored) to selected 1.27 (colored)

Add support for putting prefixes on the name of lint(1)'s front
and back ends.  This means that it can be built as a cross tool.
Part of the fix for bin/14280.

Revision 1.23 / (download) - annotate - [select for diffs], Mon May 28 12:40:38 2001 UTC (22 years, 10 months ago) by lukem
Branch: MAIN
Changes since 1.22: +52 -71 lines
Diff to previous 1.22 (colored) to selected 1.27 (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.22 / (download) - annotate - [select for diffs], Mon Feb 19 23:03:53 2001 UTC (23 years, 2 months ago) by cgd
Branch: MAIN
Changes since 1.21: +5 -5 lines
Diff to previous 1.21 (colored) to selected 1.27 (colored)

convert to use getprogname()

Revision 1.21 / (download) - annotate - [select for diffs], Mon Nov 27 00:54:25 2000 UTC (23 years, 4 months ago) by wiz
Branch: MAIN
Changes since 1.20: +6 -7 lines
Diff to previous 1.20 (colored) to selected 1.27 (colored)

Handle arguments in a slightly more standard way (avoid resetting optind).

Revision 1.20 / (download) - annotate - [select for diffs], Thu Jul 6 01:12:24 2000 UTC (23 years, 9 months ago) by christos
Branch: MAIN
Changes since 1.19: +18 -8 lines
Diff to previous 1.19 (colored) to selected 1.27 (colored)

pass -X <id>[,<id>]... and -w to lint1

Revision 1.18.2.1 / (download) - annotate - [select for diffs], Thu Jun 29 23:56:58 2000 UTC (23 years, 9 months ago) by thorpej
Branch: netbsd-1-5
CVS Tags: netbsd-1-5-RELEASE, netbsd-1-5-PATCH003, netbsd-1-5-PATCH002, netbsd-1-5-PATCH001, netbsd-1-5-BETA2, netbsd-1-5-BETA, netbsd-1-5-ALPHA2
Changes since 1.18: +3 -3 lines
Diff to previous 1.18 (colored) next main 1.19 (colored) to selected 1.27 (colored)

Pull up rev. 1.19:
Use execvp() instead of execv(). Deals with the case where CC, the compiler,
is not a full path. For instance, "cc".

Revision 1.19 / (download) - annotate - [select for diffs], Thu Jun 29 02:56:47 2000 UTC (23 years, 9 months ago) by wrstuden
Branch: MAIN
Changes since 1.18: +3 -3 lines
Diff to previous 1.18 (colored) to selected 1.27 (colored)

Use execvp() instead of execv(). Deals with the case where CC, the compiler,
is not a full path. For instance, "cc".

Revision 1.17.2.1 / (download) - annotate - [select for diffs], Fri Jun 23 16:40:22 2000 UTC (23 years, 10 months ago) by minoura
Branch: minoura-xpg4dl
Changes since 1.17: +2 -2 lines
Diff to previous 1.17 (colored) next main 1.18 (colored) to selected 1.27 (colored)

Sync w/ netbsd-1-5-base.

Revision 1.18 / (download) - annotate - [select for diffs], Wed Jun 14 06:49:24 2000 UTC (23 years, 10 months ago) by cgd
Branch: MAIN
CVS Tags: netbsd-1-5-base
Branch point for: netbsd-1-5
Changes since 1.17: +2 -2 lines
Diff to previous 1.17 (colored) to selected 1.27 (colored)

fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well.  No functional changes.

Revision 1.17 / (download) - annotate - [select for diffs], Wed Mar 22 01:09:34 2000 UTC (24 years, 1 month ago) by garbled
Branch: MAIN
CVS Tags: minoura-xpg4dl-base
Branch point for: minoura-xpg4dl
Changes since 1.16: +32 -11 lines
Diff to previous 1.16 (colored) to selected 1.27 (colored)

Add parsing of the CC env variable, and a -Bpath flag (for /usr/libexec)
so cross-building of lint libraries can be made possible.  Tested
building a powerpc libc via make build on an alpha.

Revision 1.16 / (download) - annotate - [select for diffs], Thu Sep 9 09:34:25 1999 UTC (24 years, 7 months ago) by kleink
Branch: MAIN
CVS Tags: wrstuden-devbsize-base, wrstuden-devbsize-19991221, wrstuden-devbsize, comdex-fall-1999-base, comdex-fall-1999
Changes since 1.15: +3 -2 lines
Diff to previous 1.15 (colored) to selected 1.27 (colored)

Define __LINT__, per XCU5.

Revision 1.15 / (download) - annotate - [select for diffs], Tue Sep 7 02:36:57 1999 UTC (24 years, 7 months ago) by jwise
Branch: MAIN
Changes since 1.14: +14 -13 lines
Diff to previous 1.14 (colored) to selected 1.27 (colored)

Slight improvement to last fix:  don't need to reset the cpp tempfile for
files which don't need to be run through cpp.  Also, use vfork() instead of
fork().

Both from Anders Hjalmarsson (Anders.Hjalmarsson@economics.gu.se)

Revision 1.14 / (download) - annotate - [select for diffs], Mon Sep 6 06:45:20 1999 UTC (24 years, 7 months ago) by jwise
Branch: MAIN
Changes since 1.13: +11 -4 lines
Diff to previous 1.13 (colored) to selected 1.27 (colored)

Apply fix from PR bin/8328 by Anders Hjalmarsson (Anders.Hjalmarsson@economics.gu.se):

work properly again when passwd multiple files on the command line.

Revision 1.13 / (download) - annotate - [select for diffs], Mon May 3 15:45:01 1999 UTC (24 years, 11 months ago) by christos
Branch: MAIN
Changes since 1.12: +4 -4 lines
Diff to previous 1.12 (colored) to selected 1.27 (colored)

More cosmetics in the usage message...

Revision 1.12 / (download) - annotate - [select for diffs], Mon May 3 15:23:27 1999 UTC (24 years, 11 months ago) by christos
Branch: MAIN
Changes since 1.11: +15 -7 lines
Diff to previous 1.11 (colored) to selected 1.27 (colored)

Now that we use cc -E, -U__GNUC__ to avoid gnu extensions. Nuke the
__attribute__ and __extension__ workarounds.
Our invariant is: No gcc extensions if __GNUC__ is not defined, so lint
should not be playing around trying to pretend it is gcc.

Revision 1.11 / (download) - annotate - [select for diffs], Thu Apr 29 12:40:39 1999 UTC (24 years, 11 months ago) by christos
Branch: MAIN
Changes since 1.10: +3 -2 lines
Diff to previous 1.10 (colored) to selected 1.27 (colored)

Deal with gcc __extension__({ }). We assume that it returns a value 0, and
we prepend a /*NOSTRICT*/ comment to avoid constant in conditional context
warning.

Revision 1.10 / (download) - annotate - [select for diffs], Thu Apr 22 04:40:58 1999 UTC (25 years ago) by mrg
Branch: MAIN
Changes since 1.9: +64 -60 lines
Diff to previous 1.9 (colored) to selected 1.27 (colored)

use "cc -E" not cpp directly.  this allows lint(1) to be unaware of any
machine-dependant defines that cc(1) may normally define, and also
means that the mips ports work again.

Revision 1.9.2.1 / (download) - annotate - [select for diffs], Wed Apr 7 23:27:22 1999 UTC (25 years ago) by simonb
Branch: netbsd-1-4
CVS Tags: netbsd-1-4-RELEASE, netbsd-1-4-PATCH003, netbsd-1-4-PATCH002, netbsd-1-4-PATCH001
Changes since 1.9: +11 -4 lines
Diff to previous 1.9 (colored) next main 1.10 (colored) to selected 1.27 (colored)

Use the C preprocessor define "__mips__" instead of "__mipse{b,l}__"
if we are running on a mipseb or mipsel platform..  This is the same
behaviour as the C compiler.

NOTE: This is only applied to the 1.4 branch.  A proper long-term fix
      using the equivalent of "${CC} -E" instead of lint(1) trying to
      guess what to define will be coming.

Revision 1.9 / (download) - annotate - [select for diffs], Wed Dec 9 12:28:36 1998 UTC (25 years, 4 months ago) by christos
Branch: MAIN
CVS Tags: netbsd-1-4-base
Branch point for: netbsd-1-4
Changes since 1.8: +3 -3 lines
Diff to previous 1.8 (colored) to selected 1.27 (colored)

pass -CC instead of -C to cpp so that we preserve macro comments in place.

Revision 1.8 / (download) - annotate - [select for diffs], Thu Oct 8 08:20:37 1998 UTC (25 years, 6 months ago) by itohy
Branch: MAIN
Changes since 1.7: +5 -8 lines
Diff to previous 1.7 (colored) to selected 1.27 (colored)

Eliminate memory leaks.
Use  xrealloc()  rather than  xmalloc/memcpy/free  trio.

Revision 1.7 / (download) - annotate - [select for diffs], Tue Mar 24 23:25:31 1998 UTC (26 years, 1 month ago) by sommerfe
Branch: MAIN
Changes since 1.6: +14 -4 lines
Diff to previous 1.6 (colored) to selected 1.27 (colored)

Add -d option, so lint can be used safely when we're not building "in
place" (e.g., when DESTDIR is set).  This causes the lint driver to
pass -nostdinc -idirafter <dir> to cpp, causing it to ignore
/usr/include and look somewhere else instead..

Revision 1.6 / (download) - annotate - [select for diffs], Sun Feb 22 15:40:41 1998 UTC (26 years, 2 months ago) by christos
Branch: MAIN
Changes since 1.5: +7 -3 lines
Diff to previous 1.5 (colored) to selected 1.27 (colored)

WARNSify

Revision 1.5 / (download) - annotate - [select for diffs], Sun Oct 19 19:34:56 1997 UTC (26 years, 6 months ago) by mycroft
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
Changes since 1.4: +3 -3 lines
Diff to previous 1.4 (colored) to selected 1.27 (colored)

Use S_IS*(), not S_IF*.

Revision 1.4 / (download) - annotate - [select for diffs], Sun Dec 22 11:31:47 1996 UTC (27 years, 4 months ago) by cgd
Branch: MAIN
Changes since 1.3: +10 -2 lines
Diff to previous 1.3 (colored) to selected 1.27 (colored)

* accept the file name '-' to indicate that standard input is to be
  used as lint1 input.  That involves having lint pass the '-' through
  to the cpp which preprocesses the lint1 input, and having lint1's
  scanner recognize a cpp filename "" as "{standard input}".

Revision 1.3 / (download) - annotate - [select for diffs], Mon Oct 23 14:29:30 1995 UTC (28 years, 6 months ago) by jpo
Branch: MAIN
CVS Tags: netbsd-1-2-base, netbsd-1-2-RELEASE, netbsd-1-2-PATCH001, netbsd-1-2-BETA, netbsd-1-2
Changes since 1.2: +115 -70 lines
Diff to previous 1.2 (colored) to selected 1.27 (colored)

don't rely on macros predefined by cpp

Revision 1.2 / (download) - annotate - [select for diffs], Mon Jul 3 21:25:23 1995 UTC (28 years, 9 months ago) by cgd
Branch: MAIN
CVS Tags: netbsd-1-1-base, netbsd-1-1-RELEASE, netbsd-1-1-PATCH001, netbsd-1-1
Changes since 1.1: +3 -3 lines
Diff to previous 1.1 (colored) to selected 1.27 (colored)

RCS id cleanup

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

Initial revision

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




CVSweb <webmaster@jp.NetBSD.org>