The NetBSD Project

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

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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.71 / (download) - annotate - [select for diffs], Mon Feb 5 23:11:22 2024 UTC (3 weeks, 6 days ago) by rillig
Branch: MAIN
CVS Tags: HEAD
Changes since 1.70: +17 -3 lines
Diff to previous 1.70 (colored)

lint: make function call arguments directly accessible

Previously, the arguments of a function call expression were arranged in
a linear tree structure, from right to left.  To allow easier access to
the arguments, store them in an array instead.

Revision 1.70 / (download) - annotate - [select for diffs], Sat Feb 3 19:25:16 2024 UTC (4 weeks, 1 day ago) by rillig
Branch: MAIN
Changes since 1.69: +5 -6 lines
Diff to previous 1.69 (colored)

lint: keep strings in their source representation

This allows further analysis depending on whether individual characters are
escaped as octal, hexadecimal or not at all.

Revision 1.69 / (download) - annotate - [select for diffs], Fri Feb 2 16:25:58 2024 UTC (4 weeks, 2 days ago) by rillig
Branch: MAIN
Changes since 1.68: +5 -4 lines
Diff to previous 1.68 (colored)

lint: fix debug output for strings, reduce code size

The debug output contained too many newlines.

The buffer functions were built into lint2 even though they weren't
used.

Enable the query for invisible characters in string literals, to make
sure that a newline in a string literal does not trigger that query.

Revision 1.68 / (download) - annotate - [select for diffs], Thu Feb 1 18:37:06 2024 UTC (4 weeks, 3 days ago) by rillig
Branch: MAIN
Changes since 1.67: +6 -8 lines
Diff to previous 1.67 (colored)

lint: use standard buffer for storing string values

No functional change.

Revision 1.67 / (download) - annotate - [select for diffs], Mon Jan 29 21:30:24 2024 UTC (4 weeks, 6 days ago) by rillig
Branch: MAIN
Changes since 1.66: +5 -11 lines
Diff to previous 1.66 (colored)

lint: do not remember content of wide string literals

The plain char literals are needed for checking printf/scanf format
strings; lint has no similar check for wide strings. These format
strings are checked by modern compilers, making this check less
relevant.

Revision 1.66 / (download) - annotate - [select for diffs], Tue Jan 23 19:44:28 2024 UTC (5 weeks, 5 days ago) by rillig
Branch: MAIN
Changes since 1.65: +4 -4 lines
Diff to previous 1.65 (colored)

lint: rename symt_t to symbol_kind

It was confusing to have two kinds of "symbol type" (s_type and s_symt),
so rename all related identifiers to be more distinctive.

No functional change.

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

lint: indent statement continuations consistently

No binary change.

Revision 1.64 / (download) - annotate - [select for diffs], Sat Dec 2 21:47:05 2023 UTC (3 months ago) by rillig
Branch: MAIN
Changes since 1.63: +4 -4 lines
Diff to previous 1.63 (colored)

lint: rename NOSCL to NO_SCL

For symmetry with NO_TSPEC.  No functional change.

Revision 1.63 / (download) - annotate - [select for diffs], Tue Oct 17 19:29:09 2023 UTC (4 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.62: +4 -5 lines
Diff to previous 1.62 (colored)

lint: fix debug output of convert/cast operators

The default name of the 'CVT' operator is 'convert', therefore the
override is only needed for 'cast'.

Revision 1.62 / (download) - annotate - [select for diffs], Wed Sep 13 20:31:58 2023 UTC (5 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.61: +3 -2 lines
Diff to previous 1.61 (colored)

lint: prevent invalid memory access when checking an expression

In check_expr_misc, the left and right operands of an expression were
accessed even in the case of CON (constant), STRING (string literal) and
NAME (identifier), which led to invalid values in pointer variables.
These invalid values were not used though, but technically they invoked
undefined behavior.

Precede each access to the operands with a check that the expression
indeed has operands, except in those cases where the operand is known to
have operands by only looking at the code of the current function.

Revision 1.61 / (download) - annotate - [select for diffs], Wed Aug 2 21:58:11 2023 UTC (7 months ago) by rillig
Branch: MAIN
Changes since 1.60: +3 -3 lines
Diff to previous 1.60 (colored)

lint: remove unused string literals

Revision 1.60 / (download) - annotate - [select for diffs], Wed Aug 2 18:51:25 2023 UTC (7 months ago) by rillig
Branch: MAIN
Changes since 1.59: +11 -12 lines
Diff to previous 1.59 (colored)

lint: distinguish between arguments and parameters

Revision 1.59 / (download) - annotate - [select for diffs], Tue Aug 1 16:08:58 2023 UTC (7 months ago) by rillig
Branch: MAIN
Changes since 1.58: +27 -9 lines
Diff to previous 1.58 (colored)

lint: improve debug logging for declarators

Revision 1.58 / (download) - annotate - [select for diffs], Sun Jul 30 22:27:21 2023 UTC (7 months ago) by rillig
Branch: MAIN
Changes since 1.57: +28 -13 lines
Diff to previous 1.57 (colored)

lint: in debug mode, default to indenting the debug log

Only the 'parsing' lines are not indented, as line breaks are
independent from the structure of the code.

Revision 1.57 / (download) - annotate - [select for diffs], Sun Jul 30 08:58:54 2023 UTC (7 months ago) by rillig
Branch: MAIN
Changes since 1.56: +3 -2 lines
Diff to previous 1.56 (colored)

lint: in memory debug mode, log the type of the nodes

First log all objects to be freed, then free them all at once.  This
allows cross references from the objects of a block independent of their
allocation order.

Revision 1.56 / (download) - annotate - [select for diffs], Fri Jul 28 21:50:03 2023 UTC (7 months ago) by rillig
Branch: MAIN
Changes since 1.55: +2 -4 lines
Diff to previous 1.55 (colored)

lint: extract 'vararg' and 'prototype' flags from global 'dcs'

These flags are only relevant for parameter lists, so add a separate
type for it.

No functional change.

Revision 1.55 / (download) - annotate - [select for diffs], Thu Jul 13 23:27:20 2023 UTC (7 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.54: +6 -4 lines
Diff to previous 1.54 (colored)

lint: merge duplicate code for checking duplicate type qualifiers

Revision 1.54 / (download) - annotate - [select for diffs], Thu Jul 13 23:11:11 2023 UTC (7 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.53: +12 -12 lines
Diff to previous 1.53 (colored)

lint: use separate types for parsing pointer types and type qualifiers

The documentation of the previous 'qual_ptr_t' was misleading, as that
type was used for other type qualifier lists as well, even if these were
not related to pointer types.

Revision 1.53 / (download) - annotate - [select for diffs], Thu Jul 13 19:59:08 2023 UTC (7 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.52: +3 -3 lines
Diff to previous 1.52 (colored)

lint: _Thread_local is a storage class, not a type qualifier

Revision 1.52 / (download) - annotate - [select for diffs], Wed Jul 12 19:34:01 2023 UTC (7 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.51: +3 -3 lines
Diff to previous 1.51 (colored)

lint: clean up handling of __real__ and __imag__

These two operatos are not binary, therefore they don't need a right
operand.  The questionable operands were a copy-and-paste mistake, as
the code was taken from the ++ and -- operands (tree.c 1.46 from
2008-04-25).  The ++ and -- operands aren't binary either, but since
lint represents address calculations in their premultiplied form, the
expression ptr++ contains a hidden right operand specifying the number
of bytes by which to increment the pointer.

Creating an integer-constant-expression node with type 'long double'
didn't make sense either.  Luckily, these expressions are only built but
not analyzed any further.

Revision 1.51 / (download) - annotate - [select for diffs], Wed Jul 12 18:26:04 2023 UTC (7 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.50: +3 -2 lines
Diff to previous 1.50 (colored)

lint: reject _Noreturn if it occurs in invalid places

C11 introduced _Noreturn as a function-specifier, not as a type
attribute.  The latter may occur in more places.

Revision 1.50 / (download) - annotate - [select for diffs], Wed Jul 12 16:07:35 2023 UTC (7 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.49: +18 -6 lines
Diff to previous 1.49 (colored)

lint: don't treat 'inline' as a storage class

The additional conflict in the grammar is in the same place as the other
conflicts, as T_SCLASS and T_FUNCTION_SPECIFIER are now separate tokens.

No functional change.

Revision 1.49 / (download) - annotate - [select for diffs], Mon Jul 10 19:47:12 2023 UTC (7 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.48: +3 -3 lines
Diff to previous 1.48 (colored)

lint: merge duplicate code for getting the name of an operator

Revision 1.48 / (download) - annotate - [select for diffs], Mon Jul 10 16:20:52 2023 UTC (7 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.47: +14 -15 lines
Diff to previous 1.47 (colored)

lint: improve debug output when debugging the grammar parser

Revision 1.47 / (download) - annotate - [select for diffs], Sat Jul 8 12:07:21 2023 UTC (7 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.46: +4 -3 lines
Diff to previous 1.46 (colored)

lint: clean up

PUSH nodes are not marked as binary, yet they have a left and a right
operand.

If none of the queries is enabled, omit the query from the debug log.

Revision 1.46 / (download) - annotate - [select for diffs], Sun Jul 2 18:28:15 2023 UTC (8 months ago) by rillig
Branch: MAIN
Changes since 1.45: +4 -4 lines
Diff to previous 1.45 (colored)

lint: clean up variable names relating to structure padding

Revision 1.45 / (download) - annotate - [select for diffs], Sun Jul 2 18:14:44 2023 UTC (8 months ago) by rillig
Branch: MAIN
Changes since 1.44: +6 -6 lines
Diff to previous 1.44 (colored)

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

No functional change.

Revision 1.44 / (download) - annotate - [select for diffs], Sun Jul 2 17:41:30 2023 UTC (8 months ago) by rillig
Branch: MAIN
Changes since 1.43: +4 -5 lines
Diff to previous 1.43 (colored)

lint: use unsigned int for struct alignment

This gets rid of 'unsigned short', which saved a few bytes of memory but
was inconvenient to deal with.

No functional change.

Revision 1.43 / (download) - annotate - [select for diffs], Sun Jul 2 10:20:45 2023 UTC (8 months ago) by rillig
Branch: MAIN
Changes since 1.42: +15 -8 lines
Diff to previous 1.42 (colored)

lint: extend debug logging for declaration levels

Indent the debug logging according to the declaration level.

Since there are a few cases where the enclosing declaration levels are
modified, log the whole declaration level stack whenever a level begins
or ends.

Revision 1.42 / (download) - annotate - [select for diffs], Sun Jul 2 08:16:19 2023 UTC (8 months ago) by rillig
Branch: MAIN
Changes since 1.41: +7 -8 lines
Diff to previous 1.41 (colored)

lint: clean up variable names

Revision 1.41 / (download) - annotate - [select for diffs], Sat Jul 1 09:21:31 2023 UTC (8 months ago) by rillig
Branch: MAIN
Changes since 1.40: +3 -3 lines
Diff to previous 1.40 (colored)

lint: clean up typos

Revision 1.40 / (download) - annotate - [select for diffs], Fri Jun 30 21:39:54 2023 UTC (8 months ago) by rillig
Branch: MAIN
Changes since 1.39: +54 -54 lines
Diff to previous 1.39 (colored)

lint: clean up names related to declaration levels

The previous prefix 'DK_' (declaration level kind) had a conflict with
the 'DK_' (designator kind) in init.c, so change the prefix to 'DLK_'.
The new name for dinfo_t is decl_level, which is more expressive.

No functional change.

Revision 1.39 / (download) - annotate - [select for diffs], Fri Jun 30 21:06:18 2023 UTC (8 months ago) by rillig
Branch: MAIN
Changes since 1.38: +4 -3 lines
Diff to previous 1.38 (colored)

lint: fix handling of unnamed struct/union members

The support for unnamed struct/union members that was added in decl.c
1.60 from 2015-10-13 was simple but wrong. It didn't cover initializers
of these structures and computed wrong sizes for structures containing
anonymous unions. At that time, the handling of initializers was broken
as well, it was fixed 6 years later in init.c 1.229 from 2021-12-22.

Real-life examples for code that lint couldn't handle are:

	* external/bsd/jemalloc/dist/src/jemalloc.c
	* external/mit/xorg/lib/dri.old/Makefile

Revision 1.38 / (download) - annotate - [select for diffs], Fri Jun 30 14:39:23 2023 UTC (8 months ago) by rillig
Branch: MAIN
Changes since 1.37: +7 -2 lines
Diff to previous 1.37 (colored)

lint: clean up packing of structs and unions

No functional change outside debug mode.

Revision 1.37 / (download) - annotate - [select for diffs], Thu Jun 29 22:52:44 2023 UTC (8 months ago) by rillig
Branch: MAIN
Changes since 1.36: +6 -6 lines
Diff to previous 1.36 (colored)

lint: clean up member names of declaration levels

No functional change outside debug mode.

Revision 1.36 / (download) - annotate - [select for diffs], Sat Jun 24 20:50:54 2023 UTC (8 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.35: +8 -8 lines
Diff to previous 1.35 (colored)

lint: reduce memory allocations

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

No functional change.

Revision 1.35 / (download) - annotate - [select for diffs], Sat Jun 24 08:11:12 2023 UTC (8 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.34: +4 -2 lines
Diff to previous 1.34 (colored)

lint: add query for comparing 'char' with plain integers

Revision 1.34 / (download) - annotate - [select for diffs], Fri Jun 23 20:37:02 2023 UTC (8 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.33: +4 -4 lines
Diff to previous 1.33 (colored)

lint: remove redundant printflike declarations from debugging code

Revision 1.33 / (download) - annotate - [select for diffs], Sat Jun 3 20:58:00 2023 UTC (9 months ago) by rillig
Branch: MAIN
Changes since 1.32: +5 -3 lines
Diff to previous 1.32 (colored)

lint: loosen assertion that unary operators have only a single operand

Revision 1.32 / (download) - annotate - [select for diffs], Sat Jun 3 20:40:28 2023 UTC (9 months ago) by rillig
Branch: MAIN
Changes since 1.31: +20 -7 lines
Diff to previous 1.31 (colored)

lint: use consistent and configurable stream for debug output

Revision 1.31 / (download) - annotate - [select for diffs], Mon May 22 12:55:04 2023 UTC (9 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.30: +6 -6 lines
Diff to previous 1.30 (colored)

lint: rename constant NOTSPEC to NO_TSPEC

It was too easy to misread the old name as NOT_SPEC instead of the
intended NO_TSPEC.

Revision 1.30 / (download) - annotate - [select for diffs], Sat Apr 22 20:17:19 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.29: +5 -3 lines
Diff to previous 1.29 (colored)

lint: fix missing initialization for cast to union

The left operand of a unary AST node must not be NULL.

The previous code crashed lint when run with some query enabled, as
is_cast_redundant assumes that a non-null AST node has valid operands.

$ cat <<EOF > crash.c
double
demo(void) {
	union u {
		double *num;
	} u;
	u = (union u)&((double) { 0.0 });
	return *u.num;
}
EOF
$ /usr/libexec/lint1 -w -S -g -q8 crash.c /dev/null

Revision 1.29 / (download) - annotate - [select for diffs], Sat Apr 22 17:49:15 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.28: +3 -3 lines
Diff to previous 1.28 (colored)

lint: rename type_t.t_str to t_sou

The name 't_str' could have meant 'string' or 'struct'.  Since both
struct and union types have members, rename it to 't_sou'.

No functional change.

Revision 1.28 / (download) - annotate - [select for diffs], Tue Apr 11 17:52:11 2023 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.27: +4 -4 lines
Diff to previous 1.27 (colored)

lint: in debug mode, use different names for macro and function

No functional change.

Revision 1.27 / (download) - annotate - [select for diffs], Mon Apr 10 23:56:30 2023 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.26: +12 -9 lines
Diff to previous 1.26 (colored)

lint: add debug logging for values that differ between trad and C90

Revision 1.26 / (download) - annotate - [select for diffs], Tue Mar 28 15:52:50 2023 UTC (11 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.25: +14 -26 lines
Diff to previous 1.25 (colored)

lint: condense debugging code

No functional change.

Revision 1.25 / (download) - annotate - [select for diffs], Sat Jan 21 13:07:22 2023 UTC (13 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.24: +3 -2 lines
Diff to previous 1.24 (colored)

lint: add support for the C11 type qualifier '_Atomic'

That keyword can be used as a type specifier as well, support for that
will be added later.

Revision 1.24 / (download) - annotate - [select for diffs], Sun Jan 8 14:05:02 2023 UTC (13 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.23: +35 -29 lines
Diff to previous 1.23 (colored)

lint: unclutter debug logging for nodes

No functional change.

Revision 1.23 / (download) - annotate - [select for diffs], Sat Jul 16 22:23:38 2022 UTC (19 months, 2 weeks ago) by rillig
Branch: MAIN
CVS Tags: netbsd-10-base, 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.22: +3 -3 lines
Diff to previous 1.22 (colored)

lint: add missing space before func_proto_sym in debug mode

Revision 1.22 / (download) - annotate - [select for diffs], Sun Jul 3 14:15:38 2022 UTC (20 months ago) by rillig
Branch: MAIN
Changes since 1.21: +33 -2 lines
Diff to previous 1.21 (colored)

lint: add debug logging for struct and enum details

Revision 1.21 / (download) - annotate - [select for diffs], Thu May 26 16:45:25 2022 UTC (21 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.20: +4 -3 lines
Diff to previous 1.20 (colored)

lint: fix spacing and line breaks in debug logging

The spacing between function arguments in a declaration info was too
big, it was the indentation level instead of a single space.

The function debug_sym is used for two purposes: own-line and in-line,
which coincidentally are distinguished by whether the suffix string is
"\n".

Revision 1.20 / (download) - annotate - [select for diffs], Thu May 26 12:04:56 2022 UTC (21 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.19: +18 -9 lines
Diff to previous 1.19 (colored)

lint: improve debug logging for NAME expressions

In a NAME expression, the name is an essential part, so put it to the
front, in natural reading order.

Revision 1.19 / (download) - annotate - [select for diffs], Thu May 26 11:54:33 2022 UTC (21 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.18: +4 -4 lines
Diff to previous 1.18 (colored)

lint: add missing newlines in debug_node

Revision 1.18 / (download) - annotate - [select for diffs], Fri May 20 21:18:55 2022 UTC (21 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.17: +3 -3 lines
Diff to previous 1.17 (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.17 / (download) - annotate - [select for diffs], Sat Apr 9 23:41:22 2022 UTC (22 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.16: +20 -5 lines
Diff to previous 1.16 (colored)

lint: distinguish between storage class and declaration kind

These types overlap but are not the same.

No functional change.

Revision 1.16 / (download) - annotate - [select for diffs], Sat Apr 9 21:19:52 2022 UTC (22 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.15: +4 -4 lines
Diff to previous 1.15 (colored)

lint: rename dinfo_t.d_offset to d_offset_in_bits

Most often, offsets are measured in bytes, so better embed the unit in
the variable name.

No functional change.

Revision 1.15 / (download) - annotate - [select for diffs], Sat Apr 9 16:02:14 2022 UTC (22 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.14: +3 -4 lines
Diff to previous 1.14 (colored)

lint: extract is_member into separate function

No functional change.

Revision 1.14 / (download) - annotate - [select for diffs], Sat Apr 9 15:43:41 2022 UTC (22 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.13: +16 -11 lines
Diff to previous 1.13 (colored)

lint: disambiguate sym_t.s_value

Having a single variable for 4 different purposes with different types
makes the code unnecessarily hard to follow.

No functional change.

Revision 1.13 / (download) - annotate - [select for diffs], Sat Apr 9 14:50:18 2022 UTC (22 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.12: +4 -3 lines
Diff to previous 1.12 (colored)

lint: split CTCONST into BOOL_CONST and ENUM_CONST

Having a unified compile-time constant "storage class" made the code
more difficult to understand.

No functional change.

Revision 1.12 / (download) - annotate - [select for diffs], Sat Apr 9 13:38:17 2022 UTC (22 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.11: +9 -8 lines
Diff to previous 1.11 (colored)

lint: inline member access macros for sym_t

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

No functional change.

Revision 1.11 / (download) - annotate - [select for diffs], Sat Apr 2 14:28:30 2022 UTC (23 months ago) by rillig
Branch: MAIN
Changes since 1.10: +4 -4 lines
Diff to previous 1.10 (colored)

lint: rename dinfo_t.d_next to d_enclosing

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

No functional change.

Revision 1.10 / (download) - annotate - [select for diffs], Sat Apr 2 12:24:54 2022 UTC (23 months ago) by rillig
Branch: MAIN
Changes since 1.9: +80 -8 lines
Diff to previous 1.9 (colored)

lint: add debug logging for the declaration stack

To track down the wrong edge cases in decl_direct_abstract.c.

Revision 1.9 / (download) - annotate - [select for diffs], Tue Mar 1 00:17:12 2022 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.8: +141 -4 lines
Diff to previous 1.8 (colored)

lint: add debug logging for symbols and the symbol table

This logging is not active by default, the functions debug_sym and
debug_symtab can be called as needed during a debug session.

Revision 1.8 / (download) - annotate - [select for diffs], Sun Feb 27 18:29:14 2022 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.7: +9 -10 lines
Diff to previous 1.7 (colored)

lint: merge duplicate code for handling plain and wide strings

No functional change.  As before, the string literals "1" "2" "3" are
not concatenated from left to right, instead concatenation starts with
"23" and then proceeds to "123".

Revision 1.7 / (download) - annotate - [select for diffs], Tue Dec 21 21:04:08 2021 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.6: +5 -5 lines
Diff to previous 1.6 (colored)

lint: rename debug_indent to debug_print_indent

The previous name could be mistaken to mean "increase the indentation of
the debug output".  Instead, the function prints the current indentation.

In externs1.h, the macro definition was a duplicate, the macros were
sorted differently than the functions a few lines above.

No binary change.

Revision 1.6 / (download) - annotate - [select for diffs], Mon Dec 20 00:10:07 2021 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.5: +5 -2 lines
Diff to previous 1.5 (colored)

lint: in debug mode, output value of boolean expressions

Revision 1.5 / (download) - annotate - [select for diffs], Tue Nov 16 21:01:05 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.4: +3 -3 lines
Diff to previous 1.4 (colored)

lint: fix check for function calls in strict bool mode

Previously, if a function call occurred in the controlling expression,
its return type could be any scalar, not just bool.  This was against
the goal of strict bool mode, which makes bool a separate and
incompabile type to all other types.  For example, it would allow
controlling expressions like 'strcmp(a, b)' without the usual '!= 0',
but only if at least one of 'a' and 'b' came from a macro definition
from a system header.

The fix is that the decision of whether the type of the controlling
expression may be scalar is no longer based on the operand types but on
the main operator of the controlling expression.

Revision 1.4 / (download) - annotate - [select for diffs], Tue Nov 16 06:55:03 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.3: +5 -4 lines
Diff to previous 1.3 (colored)

tests/lint: explain the missing error message in strict bool mode

There are 2 separate bugs that lead to the missing error message.

The first bug is that when parsing a name, the information about whether
that name comes from a system header is not properly recorded for the
last token before switching from or to a system header.

The second bug is that for determining whether the type of a function
call expression is relaxed, the types of the function call arguments are
taken into account, even though the type only depends on the function
itself.  The same idea applies to the operators '<<' and '>>', as their
result type only depends on the left operand, at least since C90.

Revision 1.3 / (download) - annotate - [select for diffs], Sun Aug 22 21:27:15 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.2: +3 -3 lines
Diff to previous 1.2 (colored)

lint: merge duplicate code for binary operator

No functional change.

Revision 1.2 / (download) - annotate - [select for diffs], Sun Aug 1 19:11:54 2021 UTC (2 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.1: +33 -17 lines
Diff to previous 1.1 (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.1 / (download) - annotate - [select for diffs], Sat Jul 31 18:16:42 2021 UTC (2 years, 7 months ago) by rillig
Branch: MAIN

lint: extract debug logging to separate file

Lint currently has several different kinds of debug log:

* The -DDEBUG log is controlled at compile time.
* The -d command line options enables some other debug logging.
* The -DYYDEBUG log for parsing is controlled at compile time.
* The -y command line option only has an effect in -DYYDEBUG mode.

Extracting the logging into a separate file is a first step towards
unifying these logs and making the code for debug logging stand out less
than the current #ifdef DEBUG.

No functional change.

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>