The NetBSD Project

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

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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.266 / (download) - annotate - [select for diffs], Fri Mar 29 08:35:32 2024 UTC (107 minutes, 9 seconds ago) by rillig
Branch: MAIN
CVS Tags: HEAD
Changes since 1.265: +6 -39 lines
Diff to previous 1.265 (colored) to selected 1.187 (colored)

lint: clean up

Revision 1.265 / (download) - annotate - [select for diffs], Fri Mar 29 07:35:45 2024 UTC (2 hours, 46 minutes ago) by rillig
Branch: MAIN
Changes since 1.264: +4 -5 lines
Diff to previous 1.264 (colored) to selected 1.187 (colored)

lint: fix wording of warning about bit-field initializer

Revision 1.264 / (download) - annotate - [select for diffs], Wed Mar 27 19:28:20 2024 UTC (38 hours, 54 minutes ago) by rillig
Branch: MAIN
Changes since 1.263: +6 -7 lines
Diff to previous 1.263 (colored) to selected 1.187 (colored)

lint: don't use 'long' in diagnostics

The size of 'long' differs between 64-bit and 32-bit platforms.
Eliminate this possible platform-dependency.

Revision 1.263 / (download) - annotate - [select for diffs], Sat Mar 9 13:54:47 2024 UTC (2 weeks, 5 days ago) by rillig
Branch: MAIN
Changes since 1.262: +6 -6 lines
Diff to previous 1.262 (colored) to selected 1.187 (colored)

lint: inline accessor macros for tnode_t

Revision 1.262 / (download) - annotate - [select for diffs], Sat Mar 9 13:20:55 2024 UTC (2 weeks, 5 days ago) by rillig
Branch: MAIN
Changes since 1.261: +15 -13 lines
Diff to previous 1.261 (colored) to selected 1.187 (colored)

lint: inline accessor macros for type_t

Revision 1.261 / (download) - annotate - [select for diffs], Sun Mar 3 16:09:01 2024 UTC (3 weeks, 4 days ago) by rillig
Branch: MAIN
Changes since 1.260: +3 -3 lines
Diff to previous 1.260 (colored) to selected 1.187 (colored)

lint: clean up string parsing and snprintb check

Revision 1.260 / (download) - annotate - [select for diffs], Fri Mar 1 21:52:48 2024 UTC (3 weeks, 6 days ago) by rillig
Branch: MAIN
Changes since 1.259: +3 -3 lines
Diff to previous 1.259 (colored) to selected 1.187 (colored)

lint: fix misleading initializer for string iterator

The field 'start' marks the start of the previous matching character,
not the current iterator position.

No binary change.

Revision 1.259 / (download) - annotate - [select for diffs], Thu Feb 8 20:45:20 2024 UTC (7 weeks ago) by rillig
Branch: MAIN
Changes since 1.258: +8 -12 lines
Diff to previous 1.258 (colored) to selected 1.187 (colored)

lint: clean up redundant braces

No functional change.

Revision 1.258 / (download) - annotate - [select for diffs], Sat Feb 3 19:25:16 2024 UTC (7 weeks, 5 days ago) by rillig
Branch: MAIN
Changes since 1.257: +8 -2 lines
Diff to previous 1.257 (colored) to selected 1.187 (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.257 / (download) - annotate - [select for diffs], Thu Feb 1 18:37:06 2024 UTC (8 weeks ago) by rillig
Branch: MAIN
Changes since 1.256: +3 -3 lines
Diff to previous 1.256 (colored) to selected 1.187 (colored)

lint: use standard buffer for storing string values

No functional change.

Revision 1.256 / (download) - annotate - [select for diffs], Sat Jan 13 11:24:57 2024 UTC (2 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.255: +5 -6 lines
Diff to previous 1.255 (colored) to selected 1.187 (colored)

lint: clean up grammar for initializers

Revision 1.255 / (download) - annotate - [select for diffs], Thu Jan 11 23:26:39 2024 UTC (2 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.254: +12 -14 lines
Diff to previous 1.254 (colored) to selected 1.187 (colored)

lint: clean up enum constants for designators

In intializers and offsetof, both struct and union members are handled
in the same way, thus there is no need to distinguish them.

Revision 1.254 / (download) - annotate - [select for diffs], Tue Jan 9 23:46:54 2024 UTC (2 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.253: +3 -38 lines
Diff to previous 1.253 (colored) to selected 1.187 (colored)

lint: allow complex offsetof(type, member-designator)

Both GCC 11 and Clang 8 accept member-designators that are not
identifiers but designator sequences, such as in 'offsetof(struct stat,
st_atim.tv_sec)', so make lint accept them as well.

Revision 1.253 / (download) - annotate - [select for diffs], Sun Dec 10 14:59:47 2023 UTC (3 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.252: +4 -4 lines
Diff to previous 1.252 (colored) to selected 1.187 (colored)

lint: clean up comments

No functional change.

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

lint: re-wrap comments

No functional change.

Revision 1.251 / (download) - annotate - [select for diffs], Sat Dec 2 21:50:20 2023 UTC (3 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.250: +2 -3 lines
Diff to previous 1.250 (colored) to selected 1.187 (colored)

lint: remove redundant empty lines

No functional change.

Revision 1.250 / (download) - annotate - [select for diffs], Sun Jul 30 22:27:21 2023 UTC (7 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.249: +2 -4 lines
Diff to previous 1.249 (colored) to selected 1.187 (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.249 / (download) - annotate - [select for diffs], Fri Jul 21 06:02:07 2023 UTC (8 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.248: +4 -4 lines
Diff to previous 1.248 (colored) to selected 1.187 (colored)

lint: reword message about non-constant initializer

Revision 1.248 / (download) - annotate - [select for diffs], Sat Jul 15 15:51:22 2023 UTC (8 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.247: +7 -10 lines
Diff to previous 1.247 (colored) to selected 1.187 (colored)

lint: clean up duplicate code for finding struct/union members

Revision 1.247 / (download) - annotate - [select for diffs], Sat Jul 15 13:35:24 2023 UTC (8 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.246: +3 -3 lines
Diff to previous 1.246 (colored) to selected 1.187 (colored)

lint: add detailed logging for finding memory allocation bugs

Revision 1.246 / (download) - annotate - [select for diffs], Thu Jul 13 08:40:38 2023 UTC (8 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.245: +3 -3 lines
Diff to previous 1.245 (colored) to selected 1.187 (colored)

lint: indent copyright lines consistently

Revision 1.245 / (download) - annotate - [select for diffs], Mon Jul 10 09:51:30 2023 UTC (8 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.244: +3 -3 lines
Diff to previous 1.244 (colored) to selected 1.187 (colored)

lint: clean up wchar_t and hash tables

Revision 1.244 / (download) - annotate - [select for diffs], Sat Jul 1 06:09:24 2023 UTC (8 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.243: +3 -15 lines
Diff to previous 1.243 (colored) to selected 1.187 (colored)

lint: fix initialization of unnamed union member

Revision 1.243 / (download) - annotate - [select for diffs], Fri Jun 30 21:06:18 2023 UTC (8 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.242: +11 -4 lines
Diff to previous 1.242 (colored) to selected 1.187 (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.242 / (download) - annotate - [select for diffs], Mon May 22 17:53:27 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.241: +3 -2 lines
Diff to previous 1.241 (colored) to selected 1.187 (colored)

lint: fix emitted type for arrays of unknown size

Revision 1.241 / (download) - annotate - [select for diffs], Sat Apr 22 17:49:15 2023 UTC (11 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.240: +5 -5 lines
Diff to previous 1.240 (colored) to selected 1.187 (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.240 / (download) - annotate - [select for diffs], Mon Feb 6 21:01:55 2023 UTC (13 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.239: +4 -4 lines
Diff to previous 1.239 (colored) to selected 1.187 (colored)

lint: eliminate unnecessary indirection

No functional change.

Revision 1.239 / (download) - annotate - [select for diffs], Mon Feb 6 20:50:34 2023 UTC (13 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.238: +53 -94 lines
Diff to previous 1.238 (colored) to selected 1.187 (colored)

lint: condense code for handling initializations

Remove the assertion for a non-null initialization, as each code path
immediately dereferences it.

No functional change.

Revision 1.238 / (download) - annotate - [select for diffs], Fri Jan 13 19:41:50 2023 UTC (14 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.237: +4 -5 lines
Diff to previous 1.237 (colored) to selected 1.187 (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.237 / (download) - annotate - [select for diffs], Sun Aug 28 12:04:47 2022 UTC (19 months 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.236: +3 -3 lines
Diff to previous 1.236 (colored) to selected 1.187 (colored)

lint: clean up visual clutter

No functional change.

Revision 1.236 / (download) - annotate - [select for diffs], Wed Jun 22 19:23:17 2022 UTC (21 months ago) by rillig
Branch: MAIN
Changes since 1.235: +3 -3 lines
Diff to previous 1.235 (colored) to selected 1.187 (colored)

lint: add quotes around placeholders for the remaining messages

Reword some of the messages slightly, exchanging brevity for clarity.

Message 138 is kept as-is, as it is not yet covered by any tests.

Message 240 is kep as-is, as it is unreachable.

Revision 1.235 / (download) - annotate - [select for diffs], Fri May 20 21:18:55 2022 UTC (22 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.234: +3 -3 lines
Diff to previous 1.234 (colored) to selected 1.187 (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.234 / (download) - annotate - [select for diffs], Sat Apr 30 21:38:03 2022 UTC (22 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.233: +5 -5 lines
Diff to previous 1.233 (colored) to selected 1.187 (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.233 / (download) - annotate - [select for diffs], Sat Apr 2 22:38:45 2022 UTC (23 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.232: +5 -5 lines
Diff to previous 1.232 (colored) to selected 1.187 (colored)

lint: clean up style

Remove outdated ARGSUSED (the one in tree.c had been wrong since 1995),
remove unused argument.

No functional change.

Revision 1.232 / (download) - annotate - [select for diffs], Sun Feb 27 10:31:58 2022 UTC (2 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.231: +3 -3 lines
Diff to previous 1.231 (colored) to selected 1.187 (colored)

lint: encode lifetime of allocated memory in function names

No functional change.

Revision 1.231 / (download) - annotate - [select for diffs], Sun Feb 27 08:31:26 2022 UTC (2 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.230: +3 -3 lines
Diff to previous 1.230 (colored) to selected 1.187 (colored)

lint: encode lifetime of allocated memory in the function names

No functional change.

Revision 1.230 / (download) - annotate - [select for diffs], Wed Dec 22 14:35:23 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.229: +4 -5 lines
Diff to previous 1.229 (colored) to selected 1.187 (colored)

lint: clean up initialization

No functional change.

Revision 1.229 / (download) - annotate - [select for diffs], Wed Dec 22 00:45:53 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.228: +400 -314 lines
Diff to previous 1.228 (colored) to selected 1.187 (colored)

lint: fix handling of initializations

The implementation from March 2021 added proper support for designators
but didn't model the brace levels correctly.  In particular, it could
not handle additional braces or omitted braces.  In such a case, lint
skipped the remaining initializers from the initialization.  Due to
this, type errors in the remaining initializers went unnoticed.  Another
effect was that arrays of unknown size were wrongly reported as having
size 0.

Both GCC and Clang recommend placing braces around each sub-type that is
initialized, such as a struct, union or array.  Postfix does not follow
these recommendations, therefore lint had to be disabled in
external/ibm-public/postfix/Makefile.inc.  This commit fixes the bugs
mentioned there.

Revision 1.228 / (download) - annotate - [select for diffs], Tue Dec 21 22:21:11 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.227: +5 -4 lines
Diff to previous 1.227 (colored) to selected 1.187 (colored)

lint: reword message 187 about too long string literal for initializer

The previous message was imprecise in that it didn't distinguish between
non-terminating and terminating null bytes.

Revision 1.227 / (download) - annotate - [select for diffs], Tue Dec 21 21:42:21 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.226: +9 -4 lines
Diff to previous 1.226 (colored) to selected 1.187 (colored)

lint: treat incomplete union in the same way as incomplete struct

The newly added tests triggered the assertion in begin_designation since
for incomplete types the initialization is stopped before handling the
first brace.

Revision 1.226 / (download) - annotate - [select for diffs], Tue Dec 21 21:04:08 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.225: +4 -4 lines
Diff to previous 1.225 (colored) to selected 1.187 (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.225 / (download) - annotate - [select for diffs], Tue Dec 21 16:50:11 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.224: +12 -12 lines
Diff to previous 1.224 (colored) to selected 1.187 (colored)

lint: make function names a bit more concise

No binary change.

Revision 1.224 / (download) - annotate - [select for diffs], Tue Dec 21 15:15:45 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.223: +15 -15 lines
Diff to previous 1.223 (colored) to selected 1.187 (colored)

lint: rename parameters in check_init_expr

An initialization has a left-hand and a right-hand side, reflect this in
the parameter names to avoid confusion.

No binary change.

Revision 1.223 / (download) - annotate - [select for diffs], Mon Dec 20 19:34:01 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.222: +12 -2 lines
Diff to previous 1.222 (colored) to selected 1.187 (colored)

lint: add grammar rule for the beginning of a designation

This will be necessary to properly implement handling of initializers
and braced initializer-lists.

No functional change for now since the designation is already reset
after each expression and '}'.  To handle initializations properly, the
designation must not be reset after each expression, it must advance to
the next member instead.

Revision 1.222 / (download) - annotate - [select for diffs], Sun Dec 19 23:50:27 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.221: +12 -12 lines
Diff to previous 1.221 (colored) to selected 1.187 (colored)

lint: split local variable in initialization_end_brace_level

No functional change.

Revision 1.221 / (download) - annotate - [select for diffs], Sun Dec 19 10:17:00 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.220: +50 -50 lines
Diff to previous 1.220 (colored) to selected 1.187 (colored)

lint: add typedef for types in initializations

No binary change except for line numbers in assertions.

Revision 1.220 / (download) - annotate - [select for diffs], Sat Dec 18 13:23:09 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.219: +42 -20 lines
Diff to previous 1.219 (colored) to selected 1.187 (colored)

lint: document wrong data structures for modelling initializations

No functional change.

Revision 1.219 / (download) - annotate - [select for diffs], Sat Dec 18 13:06:33 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.218: +14 -13 lines
Diff to previous 1.218 (colored) to selected 1.187 (colored)

lint: move maximum seen subscript from brace level to initialization

There is no need to store this information at every brace level since in
any translation unit that survives a conforming C99 compiler, an array
of unknown size is only possible once per initialization, not once per
brace level.

Revision 1.218 / (download) - annotate - [select for diffs], Sat Dec 18 11:25:15 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.217: +32 -50 lines
Diff to previous 1.217 (colored) to selected 1.187 (colored)

lint: use vector instead of list for designation in initialization

This change is a prerequisite for fixing the current bugs in handling
initializations.  Part of the fix will be designation_pop, which is
costly for a singly linked list.

As a side benefit, memory management becomes simpler and needs fewer
malloc calls.

No functional change.

Revision 1.217 / (download) - annotate - [select for diffs], Fri Dec 17 17:27:19 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.216: +5 -7 lines
Diff to previous 1.216 (colored) to selected 1.187 (colored)

lint: reduce code for beginning an initialization

No functional change.

Revision 1.216 / (download) - annotate - [select for diffs], Fri Dec 17 17:21:48 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.215: +28 -48 lines
Diff to previous 1.215 (colored) to selected 1.187 (colored)

lint: inline sub-cases of brace_level_sub_type

Having the code in separate functions did not add to the clarity of the
code.  The additional information from the function names can be grasped
as easily from the case labels.

No functional change.

Revision 1.215 / (download) - annotate - [select for diffs], Fri Dec 17 11:06:15 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.214: +4 -3 lines
Diff to previous 1.214 (colored) to selected 1.187 (colored)

lint: fix initialization with few braces from function

Seen in Postfix, smtp_proto.c.

Revision 1.214 / (download) - annotate - [select for diffs], Fri Dec 17 10:33:23 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.213: +4 -4 lines
Diff to previous 1.213 (colored) to selected 1.187 (colored)

lint: fix initialization of array with fewer braces

Seen in Postfix, cleanup_strerror.c.

Revision 1.213 / (download) - annotate - [select for diffs], Fri Dec 17 09:12:45 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.212: +25 -10 lines
Diff to previous 1.212 (colored) to selected 1.187 (colored)

lint: work around lint bug in initialization with few braces

Needs a proper fix later, but for now, this workaround allows to run
lint on Postfix again.

Revision 1.212 / (download) - annotate - [select for diffs], Fri Dec 17 01:24:00 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.211: +4 -4 lines
Diff to previous 1.211 (colored) to selected 1.187 (colored)

lint: rename is_string_array to is_character_array

The old name was too confusing.

No functional change.

Revision 1.211 / (download) - annotate - [select for diffs], Thu Dec 16 23:46:21 2021 UTC (2 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.210: +3 -3 lines
Diff to previous 1.210 (colored) to selected 1.187 (colored)

lint: narrow down parameter of build_name

Passing an arbitrary tokenizer symbol left too much freedom and
uncertainty to the caller, and 0 was a magic number in this context.

No functional change.

Revision 1.210 / (download) - annotate - [select for diffs], Tue Nov 16 21:01:05 2021 UTC (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.209: +3 -3 lines
Diff to previous 1.209 (colored) to selected 1.187 (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.209 / (download) - annotate - [select for diffs], Sat Sep 4 12:30:46 2021 UTC (2 years, 6 months ago) by rillig
Branch: MAIN
Changes since 1.208: +3 -3 lines
Diff to previous 1.208 (colored) to selected 1.187 (colored)

lint: spell out abbreviations in comments

No functional change.

Revision 1.208 / (download) - annotate - [select for diffs], Sat Aug 14 12:46:23 2021 UTC (2 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.207: +8 -10 lines
Diff to previous 1.207 (colored) to selected 1.187 (colored)

lint: allow initialization of struct with constant member

The operator INIT, just like RETURN and FARG, initializes an object with
an expression.  The target object of such an initialization may be a
struct with constant members.

The operator ASSIGN, on the other hand, is entirely different.  It
overwrites the existing value of the object, and this is not allowed for
structs that have a constant member.  Therefore it was wrong to use the
operator ASSIGN for initialization.

Revision 1.207 / (download) - annotate - [select for diffs], Tue Aug 10 20:43:12 2021 UTC (2 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.206: +3 -2 lines
Diff to previous 1.206 (colored) to selected 1.187 (colored)

lint: fix 3 of the 4 wrong messages about lvalue in initial assignment

Revision 1.206 / (download) - annotate - [select for diffs], Sat Jul 31 19:07:52 2021 UTC (2 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.205: +7 -7 lines
Diff to previous 1.205 (colored) to selected 1.187 (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.205 / (download) - annotate - [select for diffs], Sat Jul 31 18:16:42 2021 UTC (2 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.204: +4 -76 lines
Diff to previous 1.204 (colored) to selected 1.187 (colored)

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.

Revision 1.204 / (download) - annotate - [select for diffs], Sat Jul 31 11:03:04 2021 UTC (2 years, 7 months ago) by rillig
Branch: MAIN
Changes since 1.203: +4 -6 lines
Diff to previous 1.203 (colored) to selected 1.187 (colored)

lint: merge duplicate code for generating unqualified type

This is a preparation for fixing the wrong warnings in msg_115.c.

No functional change.

Revision 1.203 / (download) - annotate - [select for diffs], Tue Jul 20 19:44:36 2021 UTC (2 years, 8 months ago) by rillig
Branch: MAIN
Changes since 1.202: +3 -3 lines
Diff to previous 1.202 (colored) to selected 1.187 (colored)

lint: use consistent naming scheme for functions that build nodes

No functional change.

Revision 1.202 / (download) - annotate - [select for diffs], Tue Jul 20 19:35:53 2021 UTC (2 years, 8 months ago) by rillig
Branch: MAIN
Changes since 1.201: +3 -3 lines
Diff to previous 1.201 (colored) to selected 1.187 (colored)

lint: split 'build' into build_binary and build_unary

No functional change.

Revision 1.201 / (download) - annotate - [select for diffs], Fri Jul 2 22:46:43 2021 UTC (2 years, 8 months ago) by rillig
Branch: MAIN
Changes since 1.200: +25 -13 lines
Diff to previous 1.200 (colored) to selected 1.187 (colored)

lint: fix initialization of array of unknown size

The size of the resulting array was computed wrong.

Revision 1.200 / (download) - annotate - [select for diffs], Tue Jun 29 21:05:32 2021 UTC (2 years, 8 months ago) by rillig
Branch: MAIN
Changes since 1.199: +7 -4 lines
Diff to previous 1.199 (colored) to selected 1.187 (colored)

lint: do not modify tnode_t->tn_type in check_init_expr

This is a very small step towards having all shared type_t objects only
referenced via const pointers.  Since the types may be shared, it is a
bad idea to try to modify them, so better let the compiler check this.
It's a long way to reach this goal, but this small step is already
possible.

No functional change.

Revision 1.199 / (download) - annotate - [select for diffs], Sat Jun 19 15:23:57 2021 UTC (2 years, 9 months ago) by rillig
Branch: MAIN
Changes since 1.198: +2 -10 lines
Diff to previous 1.198 (colored) to selected 1.187 (colored)

lint: replace undefined behavior with assertion failure

Triggered by this malformed code:

	struct{int;

Revision 1.198 / (download) - annotate - [select for diffs], Sun Apr 18 09:53:03 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.197: +23 -5 lines
Diff to previous 1.197 (colored) to selected 1.187 (colored)

lint: extend documentation about handling initializations

Revision 1.197 / (download) - annotate - [select for diffs], Sun Apr 18 09:50:00 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.196: +5 -6 lines
Diff to previous 1.196 (colored) to selected 1.187 (colored)

lint: remove redundant test for tflag in initialization handling

Revision 1.196 / (download) - annotate - [select for diffs], Sun Apr 18 08:00:13 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.195: +2 -16 lines
Diff to previous 1.195 (colored) to selected 1.187 (colored)

lint: fix storage class of compound literal in initializer

A compound literal that occurs at block_level 0 does not have storage
class AUTO.  Instead, its storage class is either EXTERN or STATIC.

While removing the temporary objects from the symbol table had prevented
the assertion, it did not properly fix the underlying problem, which was
that since C99 the initializers can contain references to unnamed
objects that are created on-the-fly.  For C90 it was correct to always
use AUTO as the storage class of a temporary symbol.

Revision 1.195 / (download) - annotate - [select for diffs], Sat Apr 17 21:20:08 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.194: +16 -2 lines
Diff to previous 1.194 (colored) to selected 1.187 (colored)

lint: fix assertion failure for temporary objects in initialization

Revision 1.194 / (download) - annotate - [select for diffs], Fri Apr 9 23:03:26 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.193: +17 -12 lines
Diff to previous 1.193 (colored) to selected 1.187 (colored)

lint: fix initialization with brace-enclosed string literal

C99 allows this form in 6.7.8p14 and p15.

The previous lint tests did not cover the case of an array at the top
level of the object to be initialized, they only covered the error cases
(d_c99_init.c, variables 'prefixed_message' and 'message_with_suffix').

Lint is now more generous than strictly required by C99, but since GCC
and Clang already cover the case of 'message_with_suffix', this is ok.

The test d_init_array_using_string.c was wrong before in rejecting the
initializer for 'extra_braces'.  I had tested that Clang generated a
warning for this, but I had not inspected its warning carefully enough.
Clang had not warned about the extra braces but only about a type
mismatch since I tested on a platform where wchar_t was 16 bit.

Revision 1.193 / (download) - annotate - [select for diffs], Fri Apr 2 14:50:47 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.192: +13 -14 lines
Diff to previous 1.192 (colored) to selected 1.187 (colored)

lint: reorder struct members to be in comprehension order

No functional change.

Revision 1.192 / (download) - annotate - [select for diffs], Fri Apr 2 14:32:27 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.191: +25 -27 lines
Diff to previous 1.191 (colored) to selected 1.187 (colored)

lint: rename members of brace_level

The terms 'member' and 'subscript' are distinctive enough.

No functional change.

Revision 1.191 / (download) - annotate - [select for diffs], Fri Apr 2 14:19:33 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.190: +2 -8 lines
Diff to previous 1.190 (colored) to selected 1.187 (colored)

lint: remove unused brace_level.bl_array_of_unknown_size

Since init.c 1.177 from 2021-03-29, the type of the object to be
initialized is no longer modified in the middle of the initialization,
as required by C99 6.7.8p22.  Therefore it is no longer necessary to
keep this redundant information around.

No functional change.

Revision 1.190 / (download) - annotate - [select for diffs], Fri Apr 2 12:16:50 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.189: +5 -5 lines
Diff to previous 1.189 (colored) to selected 1.187 (colored)

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

No functional change.

Revision 1.189 / (download) - annotate - [select for diffs], Fri Apr 2 11:53:25 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.188: +5 -5 lines
Diff to previous 1.188 (colored) to selected 1.187 (colored)

lint: rename functions for duplicating types

No functional change.

Revision 1.188 / (download) - annotate - [select for diffs], Fri Apr 2 10:13:03 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.187: +5 -5 lines
Diff to previous 1.187 (colored)

lint: name memory allocation functions consistently

No functional change.

Revision 1.187 / (download) - annotate - [selected], Fri Apr 2 09:39:25 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.186: +3 -3 lines
Diff to previous 1.186 (colored)

lint: rename mbl to memory_block

No functional change.

Revision 1.186 / (download) - annotate - [select for diffs], Fri Apr 2 08:38:44 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.185: +13 -10 lines
Diff to previous 1.185 (colored) to selected 1.187 (colored)

lint: make debug logging compatible with C90

The previous code used the GCC-style varargs macros, which did not even
conform to C99.

No functional change.

Revision 1.185 / (download) - annotate - [select for diffs], Thu Apr 1 14:20:30 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.184: +9 -9 lines
Diff to previous 1.184 (colored) to selected 1.187 (colored)

lint: do not error out of a struct is initialized without braces

This allows to process lib/libc/gen/sysctl.c 1.38 from 2021-03-30, as
well as its precedessor 1.37, which had a workaround just for lint.

While unusual, C99 allows these.

Revision 1.184 / (download) - annotate - [select for diffs], Tue Mar 30 20:23:30 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.183: +23 -39 lines
Diff to previous 1.183 (colored) to selected 1.187 (colored)

lint: clean up duplicate code in handling of initialization

No functional change.

Revision 1.183 / (download) - annotate - [select for diffs], Tue Mar 30 16:07:07 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.182: +7 -2 lines
Diff to previous 1.182 (colored) to selected 1.187 (colored)

lint: add error about out-of-bounds array subscripts

This check is not strictly necessary since any C99 compiler must
diagnose them as well, it is rather meant for demonstrating how to do
the check in lint, and for symmetry with the 'unknown member' error
message.  These provide insight into how the data structures in init.c
are meant to be accessed.

Revision 1.182 / (download) - annotate - [select for diffs], Tue Mar 30 15:18:19 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.181: +4 -5 lines
Diff to previous 1.181 (colored) to selected 1.187 (colored)

lint: add type information for message about unknown member name

Revision 1.181 / (download) - annotate - [select for diffs], Tue Mar 30 15:10:46 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.180: +3 -4 lines
Diff to previous 1.180 (colored) to selected 1.187 (colored)

lint: reword message for very unlikely .member in array initialization

Revision 1.180 / (download) - annotate - [select for diffs], Tue Mar 30 15:07:53 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.179: +4 -5 lines
Diff to previous 1.179 (colored) to selected 1.187 (colored)

lint: add type information to message 175

Revision 1.179 / (download) - annotate - [select for diffs], Tue Mar 30 14:25:28 2021 UTC (2 years, 11 months ago) by rillig
Branch: MAIN
Changes since 1.178: +440 -844 lines
Diff to previous 1.178 (colored) to selected 1.187 (colored)

lint: rewrite handling of initializations, fixing several bugs

The previous implementation had a wrong model of how initialization
happens in C99, its assertions failed in all kind of edge cases and it
was not possible to fix the remaining bugs one at a time without running
into even more obscure assertion failures.

The debug logging was detailed but did not help to clarify the
situation.  After about 20 failed attempts at fixing the small details I
decided to start all over and rewrite the initialization code from
scratch.  I left the low-level parts of handling designators, the code
that is independent of brace_level and the high-level parts of how the
parser calls into this module.  Everything else is completely new.

The concept of a brace level stays since that is how C99 describes
initialization.  The previous code could not handle multi-level
designations (see d_init_pop_member.c).  There are no more assertion
failures in the initialization code.

Some TODO comments have been left in the tests to keep the line numbers
the same in this commit.  These will be cleaned up in a follow-up
commit.

The new implementation does not handle initialization with "missing"
braces.  This is an edge case that both GCC and Clang warn about, so it
is not widely used.  If necessary, it may be added later.

The new implementation does not use any global variables in the vast
majority of the functions, to make all dependencies and possible
modifications obvious.

Revision 1.178 / (download) - annotate - [select for diffs], Mon Mar 29 21:34:17 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.177: +159 -159 lines
Diff to previous 1.177 (colored) to selected 1.187 (colored)

lint: rename variable 'level' to 'bl'

For consistency with its type prefix and the other variables.  This
variable is used so often that it makes sense to abbreviate it.

No functional change.

Revision 1.177 / (download) - annotate - [select for diffs], Mon Mar 29 21:09:21 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.176: +54 -41 lines
Diff to previous 1.176 (colored) to selected 1.187 (colored)

lint: add helper functions

No functional change.

Revision 1.176 / (download) - annotate - [select for diffs], Mon Mar 29 20:52:00 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.175: +114 -112 lines
Diff to previous 1.175 (colored) to selected 1.187 (colored)

lint: rename struct members in init.c

No functional change.

Revision 1.175 / (download) - annotate - [select for diffs], Mon Mar 29 20:39:18 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.174: +34 -9 lines
Diff to previous 1.174 (colored) to selected 1.187 (colored)

lint: remove outdated comments, clean up style

No functional change.

Revision 1.174 / (download) - annotate - [select for diffs], Sun Mar 28 20:35:58 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.173: +22 -3 lines
Diff to previous 1.173 (colored) to selected 1.187 (colored)

lint: add assertions for aggregate initialization

No functional change.

Revision 1.173 / (download) - annotate - [select for diffs], Sun Mar 28 19:53:58 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.172: +7 -7 lines
Diff to previous 1.172 (colored) to selected 1.187 (colored)

lint: add test for assertion failure in initialization

The 'cnt = level->bl_type->t_tspec == STRUCT ? 2 : 1;' in
initialization_push_struct_or_union is obviously wrong since not every
struct has exactly 1 remaining member after the first member that has an
initializer with designation.

This bug started its life in init.c 1.12 from 2002-10-21, a little over
18 years ago.

Revision 1.172 / (download) - annotate - [select for diffs], Sun Mar 28 19:30:08 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.171: +27 -28 lines
Diff to previous 1.171 (colored) to selected 1.187 (colored)

lint: split complicated function for looking up struct members

No functional change.

Revision 1.171 / (download) - annotate - [select for diffs], Sun Mar 28 18:33:27 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.170: +4 -8 lines
Diff to previous 1.170 (colored) to selected 1.187 (colored)

lint: inline variable in initialization_init_array_using_string

No functional change.

Revision 1.170 / (download) - annotate - [select for diffs], Sun Mar 28 18:28:22 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.169: +12 -28 lines
Diff to previous 1.169 (colored) to selected 1.187 (colored)

lint: clean up initialization_init_array_using_string

No functional change.

Revision 1.169 / (download) - annotate - [select for diffs], Sun Mar 28 18:21:28 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.168: +8 -9 lines
Diff to previous 1.168 (colored) to selected 1.187 (colored)

lint: clean up initialization_expr

No functional change.

Revision 1.168 / (download) - annotate - [select for diffs], Sun Mar 28 18:18:22 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.167: +19 -15 lines
Diff to previous 1.167 (colored) to selected 1.187 (colored)

lint: extract duplicate code to is_string_array

No functional change.

Revision 1.167 / (download) - annotate - [select for diffs], Sun Mar 28 18:01:57 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.166: +12 -6 lines
Diff to previous 1.166 (colored) to selected 1.187 (colored)

lint: add is_struct_or_union

No functional change.

Revision 1.166 / (download) - annotate - [select for diffs], Sun Mar 28 16:28:15 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.165: +18 -8 lines
Diff to previous 1.165 (colored) to selected 1.187 (colored)

lint: extract brace_level_subtype

No functional change.

Revision 1.165 / (download) - annotate - [select for diffs], Sun Mar 28 16:19:21 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.164: +12 -7 lines
Diff to previous 1.164 (colored) to selected 1.187 (colored)

lint: extract initialization_end_brace_level

No functional change.

Revision 1.164 / (download) - annotate - [select for diffs], Sun Mar 28 15:39:25 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.163: +19 -9 lines
Diff to previous 1.163 (colored) to selected 1.187 (colored)

lint: extract check_no_auto_aggregate

No functional change.

Revision 1.163 / (download) - annotate - [select for diffs], Sun Mar 28 14:13:18 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.162: +5 -6 lines
Diff to previous 1.162 (colored) to selected 1.187 (colored)

lint: clean up type handling in initialization

No functional change.

Revision 1.162 / (download) - annotate - [select for diffs], Sun Mar 28 14:01:49 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.161: +8 -15 lines
Diff to previous 1.161 (colored) to selected 1.187 (colored)

lint: remove wrong warning about wrong initializer type

The following code is valid:

	int valid = {{{ 3 }}};

C90 3.5.7 and C99 6.7.8 both say that the "initializer for a scalar
shall be a single expression, optionally enclosed in braces".  They
don't put any upper bound on the amount of braces, not even in the
"Translation limits" section.

Revision 1.161 / (download) - annotate - [select for diffs], Sun Mar 28 13:09:43 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.160: +3 -3 lines
Diff to previous 1.160 (colored) to selected 1.187 (colored)

lint: sprinkle const on function declarations

No functional change.

Revision 1.160 / (download) - annotate - [select for diffs], Sun Mar 28 11:08:01 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.159: +31 -33 lines
Diff to previous 1.159 (colored) to selected 1.187 (colored)

lint: move code for extending an array of unknown size further up

No functional change.

Revision 1.159 / (download) - annotate - [select for diffs], Sun Mar 28 10:58:18 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.158: +75 -75 lines
Diff to previous 1.158 (colored) to selected 1.187 (colored)

lint: move code for checking init expressions further up

It did not make sense to have this code between the code for the
designation and the brace level.  Since it is independent of all these
types, move it to the top.

No functional change.

Revision 1.158 / (download) - annotate - [select for diffs], Sun Mar 28 10:52:41 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.157: +508 -501 lines
Diff to previous 1.157 (colored) to selected 1.187 (colored)

lint: group functions according to their main object

No functional change.

Revision 1.157 / (download) - annotate - [select for diffs], Sun Mar 28 10:09:34 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.156: +6 -8 lines
Diff to previous 1.156 (colored) to selected 1.187 (colored)

lint: rename public designator functions

Their previous names were too similar to the actual implementation
functions, which was confusing.

No functional change.

Revision 1.156 / (download) - annotate - [select for diffs], Sun Mar 28 10:05:19 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.155: +10 -12 lines
Diff to previous 1.155 (colored) to selected 1.187 (colored)

lint: inline initsym

No functional change.

Revision 1.155 / (download) - annotate - [select for diffs], Sun Mar 28 10:03:02 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.154: +29 -31 lines
Diff to previous 1.154 (colored) to selected 1.187 (colored)

lint: replace initstack_push_array with brace_level_push_array

The designator is no longer logged at this point because it is
irrelevant.

No functional change.

Revision 1.154 / (download) - annotate - [select for diffs], Sun Mar 28 09:57:31 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.153: +10 -14 lines
Diff to previous 1.153 (colored) to selected 1.187 (colored)

lint: clean up debug logging, use consistent variable names

No functional change.

Revision 1.153 / (download) - annotate - [select for diffs], Sun Mar 28 09:51:16 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.152: +22 -25 lines
Diff to previous 1.152 (colored) to selected 1.187 (colored)

lint: omit unnecessary calls to current_init

No functional change.

Revision 1.152 / (download) - annotate - [select for diffs], Sun Mar 28 09:46:55 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.151: +47 -41 lines
Diff to previous 1.151 (colored) to selected 1.187 (colored)

lint: move brace level functions further up

No functional change.

Revision 1.151 / (download) - annotate - [select for diffs], Sun Mar 28 09:43:28 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.150: +7 -18 lines
Diff to previous 1.150 (colored) to selected 1.187 (colored)

lint: clean up debug logging for initialization

No functional change.

Revision 1.150 / (download) - annotate - [select for diffs], Sun Mar 28 09:39:04 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.149: +32 -27 lines
Diff to previous 1.149 (colored) to selected 1.187 (colored)

lint: inline initerr in code for handling initializations

No functional change.

Revision 1.149 / (download) - annotate - [select for diffs], Sun Mar 28 09:34:45 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.148: +51 -63 lines
Diff to previous 1.148 (colored) to selected 1.187 (colored)

lint: inline brace level in initialization

No functional change.

Revision 1.148 / (download) - annotate - [select for diffs], Sun Mar 28 09:20:51 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.147: +60 -69 lines
Diff to previous 1.147 (colored) to selected 1.187 (colored)

lint: replace global variables with function parameters

No functional change.

Revision 1.147 / (download) - annotate - [select for diffs], Sun Mar 28 09:08:13 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.146: +63 -58 lines
Diff to previous 1.146 (colored) to selected 1.187 (colored)

lint: move more functions to the global-variables-free section

No functional change.

Revision 1.146 / (download) - annotate - [select for diffs], Sun Mar 28 08:30:22 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.145: +183 -151 lines
Diff to previous 1.145 (colored) to selected 1.187 (colored)

lint: reorder code for handling initializations

First the primitives for debug logging, then the functions that do not
access any global variables, finally everything else.

No functional change.

Revision 1.145 / (download) - annotate - [select for diffs], Sun Mar 28 07:59:09 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.144: +60 -49 lines
Diff to previous 1.144 (colored) to selected 1.187 (colored)

lint: move debug primitives to the top of the code

No functional change.

Revision 1.144 / (download) - annotate - [select for diffs], Sat Mar 27 23:18:37 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.143: +19 -12 lines
Diff to previous 1.143 (colored) to selected 1.187 (colored)

lint: extract brace_level_next_member from initstack_pop_item_unnamed

No functional change.

Revision 1.143 / (download) - annotate - [select for diffs], Sat Mar 27 22:53:10 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.142: +47 -26 lines
Diff to previous 1.142 (colored) to selected 1.187 (colored)

lint: extract brace level code into separate functions

No functional change.

Revision 1.142 / (download) - annotate - [select for diffs], Sat Mar 27 22:35:10 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.141: +50 -23 lines
Diff to previous 1.141 (colored) to selected 1.187 (colored)

lint: prepare support for adding array designators

No functional change.

Revision 1.141 / (download) - annotate - [select for diffs], Sat Mar 27 21:56:51 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.140: +14 -8 lines
Diff to previous 1.140 (colored) to selected 1.187 (colored)

lint: add function for setting the initialization error

No functional change.

Revision 1.140 / (download) - annotate - [select for diffs], Sat Mar 27 19:59:22 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.139: +16 -16 lines
Diff to previous 1.139 (colored) to selected 1.187 (colored)

lint: remove unnecessary typedefs

No functional change.

Revision 1.139 / (download) - annotate - [select for diffs], Sat Mar 27 19:48:00 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.138: +211 -209 lines
Diff to previous 1.138 (colored) to selected 1.187 (colored)

lint: rename initstack_element to brace_level

No functional change.

Revision 1.138 / (download) - annotate - [select for diffs], Sat Mar 27 16:37:12 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.137: +37 -27 lines
Diff to previous 1.137 (colored) to selected 1.187 (colored)

lint: extract look_up_member from initstack_push_struct_or_union

No functional change.

Revision 1.137 / (download) - annotate - [select for diffs], Sat Mar 27 16:24:21 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.136: +11 -9 lines
Diff to previous 1.136 (colored) to selected 1.187 (colored)

lint: clean up initstack_pop_item_named_member

Previously, the code accessed the global variable for the designator
several times, even though the designator cannot change during this part
of the code.  Make this obvious by passing this designator as a
parameter instead.

No functional change.

Revision 1.136 / (download) - annotate - [select for diffs], Sat Mar 27 13:17:42 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.135: +3 -5 lines
Diff to previous 1.135 (colored) to selected 1.187 (colored)

lint: fix and update comments about initialization

Revision 1.135 / (download) - annotate - [select for diffs], Sat Mar 27 13:08:20 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.134: +20 -15 lines
Diff to previous 1.134 (colored) to selected 1.187 (colored)

lint: merge duplicate code in initialization

No functional change.

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

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

No functional change.

Revision 1.133 / (download) - annotate - [select for diffs], Thu Mar 25 22:53:05 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.132: +14 -8 lines
Diff to previous 1.132 (colored) to selected 1.187 (colored)

lint: fix initialization for arrays with designators

From the previous commit, there was an off-by-one error left, which was
due to the interaction between designation_add_subscript and
extend_if_array_of_unknown_size.

The other crucial point was to call initstack_pop_nobrace before
accessing the "current initialization stack element".  Without this
call, in msg_168.c the "current element" would point to the initializer
level for 'const char *' instead of the one for 'array of const char *'.

One more step towards supporting C99.

Revision 1.132 / (download) - annotate - [select for diffs], Thu Mar 25 22:15:38 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.131: +19 -2 lines
Diff to previous 1.131 (colored) to selected 1.187 (colored)

lint: improve initialization of arrays with designators

Initialization is still buggy but better than before.  The remaining bug
is that only the first designator determines the array size, and after
that, the array is no longer considered of unknown size.  This
contradicts C99.  More improvements to come.

Revision 1.131 / (download) - annotate - [select for diffs], Thu Mar 25 21:51:55 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.130: +11 -11 lines
Diff to previous 1.130 (colored) to selected 1.187 (colored)

lint: fix names of functions dealing with designations

These functions modify the whole designation, not only a single
designator.

No functional change.

Revision 1.130 / (download) - annotate - [select for diffs], Thu Mar 25 21:45:10 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.129: +6 -6 lines
Diff to previous 1.129 (colored) to selected 1.187 (colored)

lint: free the designator as soon as it is no longer needed

One of the latest "refactorings" introduced a small and practically
unimportant memory leak.  If the last initializer in an initialization
had a designator, that designator was not freed.

When the "current initialization" was still a global variable with
unlimited lifetime, it was freed at the beginning of the next
initialization.  After the refactorings, this "next initialization"
could no longer see anything from the previous initialization since all
references have been cleaned up at that point.  Freeing the memory so
late and in an almost totally unrelated place was a bad idea anyway.

Revision 1.129 / (download) - annotate - [select for diffs], Thu Mar 25 21:36:41 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.128: +33 -25 lines
Diff to previous 1.128 (colored) to selected 1.187 (colored)

lint: distinguish between read and write access to initstk

There are far too many places that modify the top element of the
initializer stack.  Each of these places should get its own logging, as
long as the code is still complicated.  These places are now clearly
marked with initstk_lvalue.

No functional change.

Revision 1.128 / (download) - annotate - [select for diffs], Thu Mar 25 21:07:52 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.127: +54 -55 lines
Diff to previous 1.127 (colored) to selected 1.187 (colored)

lint: replace namlist with designation and designator

This makes it possible to accurately model C99 initializers, including
their optional designators.  Previously, array subscripts had not been
modeled at all.

In the previous commit, debug_designation crashed immediately since I
had not run the code in debug mode even once.  The condition 'name !=
head' was a left-over from the old times where the designator was still
a circular list.

No functional change outside debug mode.

Revision 1.127 / (download) - annotate - [select for diffs], Thu Mar 25 20:38:16 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.126: +19 -24 lines
Diff to previous 1.126 (colored) to selected 1.187 (colored)

lint: remove over-engineered doubly-linked circular list

The designation only needs to be navigated from head to tail, not the
other way round.

No functional change.

Revision 1.126 / (download) - annotate - [select for diffs], Thu Mar 25 20:11:18 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.125: +19 -20 lines
Diff to previous 1.125 (colored) to selected 1.187 (colored)

lint: rename debug_named_member to debug_designation

No functional change outside debug mode.

Revision 1.125 / (download) - annotate - [select for diffs], Thu Mar 25 19:48:25 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.124: +17 -19 lines
Diff to previous 1.124 (colored) to selected 1.187 (colored)

lint: rename i_current_object to i_next_member

No functional change outside debug mode.

Revision 1.124 / (download) - annotate - [select for diffs], Thu Mar 25 19:33:44 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.123: +15 -9 lines
Diff to previous 1.123 (colored) to selected 1.187 (colored)

lint: rename the few remaining instances of 'namedmem'

No functional change.

Revision 1.123 / (download) - annotate - [select for diffs], Thu Mar 25 19:20:15 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.122: +28 -22 lines
Diff to previous 1.122 (colored) to selected 1.187 (colored)

lint: split current_namedmem into lvalue and rvalue form, rename them

This is a small step towards using the terminology from C99.

No functional change.

Revision 1.122 / (download) - annotate - [select for diffs], Thu Mar 25 19:11:18 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.121: +35 -31 lines
Diff to previous 1.121 (colored) to selected 1.187 (colored)

lint: inline macro 'namedmem' for C99 designators

No functional change.

Revision 1.121 / (download) - annotate - [select for diffs], Thu Mar 25 16:43:51 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.120: +16 -10 lines
Diff to previous 1.120 (colored) to selected 1.187 (colored)

lint: free memory at the end of an initialization

No functional change, just more clarity in the code.

Revision 1.120 / (download) - annotate - [select for diffs], Thu Mar 25 16:30:23 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.119: +15 -13 lines
Diff to previous 1.119 (colored) to selected 1.187 (colored)

lint: condense debug output for initializations

This way it does not look more impressive than it really is.

No functional change outside debug mode.

Revision 1.119 / (download) - annotate - [select for diffs], Thu Mar 25 13:10:19 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.118: +157 -29 lines
Diff to previous 1.118 (colored) to selected 1.187 (colored)

lint: add comments about things left to do, from code review

No functional change.

Revision 1.118 / (download) - annotate - [select for diffs], Thu Mar 25 01:42:53 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.117: +17 -17 lines
Diff to previous 1.117 (colored) to selected 1.187 (colored)

lint: fix C99 initialization with expression of type 'struct'

This has been a long-standing limitation of lint.  Now it is almost
ready for C99, see the list of "major changes" in the foreword of C99.

One known remaining bug in the area of initialization is designators
with several levels, such as '.member[2].member.member'.  Oh, and
designators for arrays are only supported in the parser but not in the
type checker.  There's still some work to do.

Revision 1.117 / (download) - annotate - [select for diffs], Thu Mar 25 00:48:58 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.116: +2 -10 lines
Diff to previous 1.116 (colored) to selected 1.187 (colored)

lint: remove outdated comment from init_using_expr

Since C99, an aggregate type can be initialized without braces.

No functional change.

Revision 1.116 / (download) - annotate - [select for diffs], Thu Mar 25 00:35:16 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.115: +49 -42 lines
Diff to previous 1.115 (colored) to selected 1.187 (colored)

lint: extract check_init_expr from init_using_expr

No functional change.

Revision 1.115 / (download) - annotate - [select for diffs], Tue Mar 23 22:58:08 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.114: +4 -3 lines
Diff to previous 1.114 (colored) to selected 1.187 (colored)

lint: fix wrong warning about initialization using string literal

Missing braces after 'if', since init.c 1.68 from 2021-02-20.

GCC 10 doesn't complain about this even with -Wmisleading-indentation
since at least one of the involved lines is a macro invocation (in this
case both lines).  GCC 11 will warn about this.

Clang warns about this, but the regular Clang build currently fails for
other reasons, so this problem didn't show up there either.

Revision 1.114 / (download) - annotate - [select for diffs], Tue Mar 23 20:21:07 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.113: +27 -16 lines
Diff to previous 1.113 (colored) to selected 1.187 (colored)

lint: extract init_using_assign from init_using_expr

No functional change.

Revision 1.113 / (download) - annotate - [select for diffs], Tue Mar 23 20:14:55 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.112: +12 -21 lines
Diff to previous 1.112 (colored) to selected 1.187 (colored)

lint: merge duplicate code in init_using_expr

No functional change.

Revision 1.112 / (download) - annotate - [select for diffs], Tue Mar 23 18:51:43 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.111: +6 -6 lines
Diff to previous 1.111 (colored) to selected 1.187 (colored)

lint: fix documentation about optional braces in initializers

Revision 1.111 / (download) - annotate - [select for diffs], Tue Mar 23 18:40:50 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.110: +39 -10 lines
Diff to previous 1.110 (colored) to selected 1.187 (colored)

lint: fix wrong error message about type mismatch in compound literal

Now that the code contains explicit markers for starting and ending an
initialization, and having the guarantee that an assertion fails
whenever some code accesses the state of the "current initialization"
even though there is no ongoing initialization gives me much more
confidence in the correctness of the code.  The calls to
begin_initialization and end_initialization always appear in pairs,
enclosing the minimal amount of code necessary for initialization.

In a nutshell, global modifiable state is error-prone and hard to
understand.

A nice side effect is that the grammar no longer needs a special rule
for the outermost initializer since the functions for the debug logging
are now called explicitly.

The code that misuses the initialization state just because it needs to
temporarily store a sym_t somewhere is now clearly marked as such.  A
GCC statement expression can appear anywhere and is therefore
independent of the initialization.  Most probably the code can simply
refer to the local variable in the grammar rule itself, or this variable
needs to be encoded in the grammar %union.  For sure there is a better
way to handle this.

There is no longer a need that the function 'declare' initializes the
initialization state, it was just the wrong place to do this.

Revision 1.110 / (download) - annotate - [select for diffs], Tue Mar 23 17:36:56 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.109: +48 -14 lines
Diff to previous 1.109 (colored) to selected 1.187 (colored)

lint: add indirection for accessing the current initialization

This indirection will be needed to handle nested initializations, which
are a new feature of C99.  These are currently not handled correctly,
see msg_171.c.

No functional change.

Revision 1.109 / (download) - annotate - [select for diffs], Mon Mar 22 19:29:43 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.108: +4 -4 lines
Diff to previous 1.108 (colored) to selected 1.187 (colored)

lint: reduce visibility of variables for initializations

No functional change.

Revision 1.108 / (download) - annotate - [select for diffs], Sat Mar 20 08:54:27 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.107: +4 -2 lines
Diff to previous 1.107 (colored) to selected 1.187 (colored)

lint: fix assertion failure after error in designation

In d_c99_init.c, the initialization of array_with_designator failed.
The designator '.member' from that initialization was not cleaned up
before starting the next initialization.

Revision 1.107 / (download) - annotate - [select for diffs], Sat Mar 20 08:16:30 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.106: +3 -2 lines
Diff to previous 1.106 (colored) to selected 1.187 (colored)

lint: replace segmentation fault with assertion failure

Revision 1.106 / (download) - annotate - [select for diffs], Fri Mar 19 18:17:46 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.105: +8 -7 lines
Diff to previous 1.105 (colored) to selected 1.187 (colored)

lint: improve debug loggin for initialization

Revision 1.105 / (download) - annotate - [select for diffs], Fri Mar 19 17:37:57 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.104: +6 -6 lines
Diff to previous 1.104 (colored) to selected 1.187 (colored)

lint: rename designator_pop_name to designator_shift_name

The entries are removed from the beginning, not from the end.

No functional change.

Revision 1.104 / (download) - annotate - [select for diffs], Fri Mar 19 01:02:52 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.103: +10 -4 lines
Diff to previous 1.103 (colored) to selected 1.187 (colored)

lint: replace assertion in initialization with proper error message

Revision 1.103 / (download) - annotate - [select for diffs], Fri Mar 19 00:55:02 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.102: +7 -7 lines
Diff to previous 1.102 (colored) to selected 1.187 (colored)

lint: rename push_member and pop_member

These two functions are supposed to model the designator that is used
for initializing structs and arrays.  The implementation is still buggy
and does not work at all for C99 designators with multiple names, see
d_init_pop_member.c.

For now, just rename the functions to head in the right direction.

No functional change.

Revision 1.102 / (download) - annotate - [select for diffs], Fri Mar 19 00:39:17 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.101: +27 -8 lines
Diff to previous 1.101 (colored) to selected 1.187 (colored)

lint: extend documentation about initialization

No functional change.

Revision 1.101 / (download) - annotate - [select for diffs], Fri Mar 19 00:19:32 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.100: +59 -47 lines
Diff to previous 1.100 (colored) to selected 1.187 (colored)

lint: split initstack_pop_item into separate functions

No functional change.

Revision 1.100 / (download) - annotate - [select for diffs], Fri Mar 19 00:08:13 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.99: +9 -6 lines
Diff to previous 1.99 (colored) to selected 1.187 (colored)

lint: improve debug logging in initstack_push

No functional change outside debug mode.

Revision 1.99 / (download) - annotate - [select for diffs], Thu Mar 18 23:45:20 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.98: +95 -77 lines
Diff to previous 1.98 (colored) to selected 1.187 (colored)

lint: split initstack_push into smaller functions

No functional change.

Revision 1.98 / (download) - annotate - [select for diffs], Thu Mar 18 23:37:31 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.97: +8 -12 lines
Diff to previous 1.97 (colored) to selected 1.187 (colored)

lint: clean up control flow in initstack_push

No functional change.

Revision 1.97 / (download) - annotate - [select for diffs], Thu Mar 18 23:23:40 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.96: +29 -21 lines
Diff to previous 1.96 (colored) to selected 1.187 (colored)

lint: extract extend_if_array_of_unknown_size from initstack_push

No functional change.

Revision 1.96 / (download) - annotate - [select for diffs], Thu Mar 18 22:51:32 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.95: +5 -6 lines
Diff to previous 1.95 (colored) to selected 1.187 (colored)

lint: replace undefined behavior during initialization with assertion

This only affects code that is already rejected by the compiler.

Revision 1.95 / (download) - annotate - [select for diffs], Thu Mar 18 22:08:05 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.94: +7 -6 lines
Diff to previous 1.94 (colored) to selected 1.187 (colored)

lint: improve debug logging during initialization

No functional change outside debug mode.

Revision 1.94 / (download) - annotate - [select for diffs], Thu Mar 18 20:55:58 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.93: +13 -17 lines
Diff to previous 1.93 (colored) to selected 1.187 (colored)

lint: reduce debug logging for initialization, update documentation

No functional change outside debug mode.

Revision 1.93 / (download) - annotate - [select for diffs], Thu Mar 18 20:22:50 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.92: +58 -8 lines
Diff to previous 1.92 (colored) to selected 1.187 (colored)

lint: document how initialization works, improve debug logging

No functional change outside debug mode.

Revision 1.92 / (download) - annotate - [select for diffs], Thu Mar 18 14:58:44 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.91: +36 -14 lines
Diff to previous 1.91 (colored) to selected 1.187 (colored)

lint: document the initialization of an object in more detail

This will help fixing the bugs that are currently demonstrated in
msg_168.c and d_struct_init_nested.c.

Revision 1.91 / (download) - annotate - [select for diffs], Wed Mar 17 15:45:30 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.90: +18 -2 lines
Diff to previous 1.90 (colored) to selected 1.187 (colored)

lint: add debug logging for C99-style initialization of arrays

No functional change outside debug mode.

Revision 1.90 / (download) - annotate - [select for diffs], Wed Mar 17 15:37:42 2021 UTC (3 years ago) by rillig
Branch: MAIN
Changes since 1.89: +52 -55 lines
Diff to previous 1.89 (colored) to selected 1.187 (colored)

lint: move debug logging for the designator to the top of the code

The debugging code is needed by the soon-to-be-added proper handling of
array subscript initializers such as '.member[123].member = 12345'.

No functional change.

Revision 1.89 / (download) - annotate - [select for diffs], Mon Feb 22 15:09:50 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.88: +16 -16 lines
Diff to previous 1.88 (colored) to selected 1.187 (colored)

lint: change spelling of initialisation to initialization

That's the wording from the ISO C99 standard.

Revision 1.88 / (download) - annotate - [select for diffs], Mon Feb 22 15:01:03 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.87: +3 -3 lines
Diff to previous 1.87 (colored) to selected 1.187 (colored)

lint: improve debug message and comment

Revision 1.87 / (download) - annotate - [select for diffs], Sun Feb 21 15:02:16 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.86: +23 -15 lines
Diff to previous 1.86 (colored) to selected 1.187 (colored)

lint: extract check_non_constant_initializer from init_using_expr

No functional change.

Revision 1.86 / (download) - annotate - [select for diffs], Sun Feb 21 14:57:25 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.85: +16 -11 lines
Diff to previous 1.85 (colored) to selected 1.187 (colored)

lint: extract check_bit_field_init from init_using_expr

No functional change.

Revision 1.85 / (download) - annotate - [select for diffs], Sun Feb 21 14:19:27 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.84: +6 -4 lines
Diff to previous 1.84 (colored) to selected 1.187 (colored)

lint: add debug logging for initializing an array of unknown size

It is possible that the type name 'array[unknown_size]' may spill into
the user-visible diagnostics.  The current test suite does not cover
such a case.  Anyway, saying 'array[unknown_size]' is still better than
saying 'array[0]', which would be misleading.

Revision 1.84 / (download) - annotate - [select for diffs], Sun Feb 21 14:02:36 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.83: +23 -30 lines
Diff to previous 1.83 (colored) to selected 1.187 (colored)

lint: rename and condense initstack_check_too_many

No functional change.

Revision 1.83 / (download) - annotate - [select for diffs], Sun Feb 21 13:52:21 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.82: +4 -5 lines
Diff to previous 1.82 (colored) to selected 1.187 (colored)

lint: remove redundant debug logging

In initstack_pop_nobrace, if anything happens to the initstack, it will
be logged by initstack_pop_item.

In init_using_expr, the address of the node is irrelevant, the node's
contents has already been logged above.

Revision 1.82 / (download) - annotate - [select for diffs], Sun Feb 21 13:13:14 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.81: +23 -12 lines
Diff to previous 1.81 (colored) to selected 1.187 (colored)

lint: document i_brace, add comments, rename initstack_string

No functional change outside debug mode.

Revision 1.81 / (download) - annotate - [select for diffs], Sun Feb 21 11:23:33 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.80: +8 -10 lines
Diff to previous 1.80 (colored) to selected 1.187 (colored)

lint: always initialize return values of constant_addr

Before, the caller was responsible for initializing the return values
from the function.  This was an unexpected burden.

Ensure that in each branch that returns true, both return values are
properly set.

Strangely, the only caller of that function, init_using_expr, uses
neither of the return values.  It just tests whether the expression is
constant or not.

No functional change.

Revision 1.80 / (download) - annotate - [select for diffs], Sun Feb 21 10:03:35 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.79: +20 -19 lines
Diff to previous 1.79 (colored) to selected 1.187 (colored)

lint: clean up debug logging in initstack_pop_item

The debug logging contained much redundant information and was
misleading in a few places.  For example, "pop" did not actually pop an
item, plus there are several things that could be popped, so that didn't
help either.

Sprinkle some comments in places where the code needs to become clearer.

No functional change outside debug mode.  The condition
'istk->i_remaining >= 0' was redundant due to the assertion directly
above it.

Revision 1.79 / (download) - annotate - [select for diffs], Sun Feb 21 09:24:32 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.78: +15 -15 lines
Diff to previous 1.78 (colored) to selected 1.187 (colored)

lint: rename istk to initstack_element

The longer name is more expressive and more correct.  The previous name
called each stack element a stack itself, which was unnecessarily
confusing.

No functional change.

Revision 1.78 / (download) - annotate - [select for diffs], Sun Feb 21 08:27:41 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.77: +26 -23 lines
Diff to previous 1.77 (colored) to selected 1.187 (colored)

lint: reduce amount of debug output during initialization

Revision 1.77 / (download) - annotate - [select for diffs], Sun Feb 21 08:01:14 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.76: +78 -43 lines
Diff to previous 1.76 (colored) to selected 1.187 (colored)

lint: rename members of struct istk to be more expressive

No functional change outside debug mode.

Revision 1.76 / (download) - annotate - [select for diffs], Sun Feb 21 07:21:57 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.75: +3 -3 lines
Diff to previous 1.75 (colored) to selected 1.187 (colored)

lint: indent node details in debug mode

Revision 1.75 / (download) - annotate - [select for diffs], Sat Feb 20 19:56:44 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.74: +9 -9 lines
Diff to previous 1.74 (colored) to selected 1.187 (colored)

lint: fix lint warning 'expression has null effect'

Revision 1.74 / (download) - annotate - [select for diffs], Sat Feb 20 19:10:38 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.73: +21 -14 lines
Diff to previous 1.73 (colored) to selected 1.187 (colored)

lint: fix lint warnings

No functional change.

Revision 1.73 / (download) - annotate - [select for diffs], Sat Feb 20 17:44:39 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.72: +60 -2 lines
Diff to previous 1.72 (colored) to selected 1.187 (colored)

lint: in debug mode, print the initialization stack

This is the central data structure of the initializations, it keeps
track of the objects that still need to be initialized.  Seeing its
contents in debug mode helps in finding and understanding the still
incomplete C99 support.

Revision 1.72 / (download) - annotate - [select for diffs], Sat Feb 20 17:24:37 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.71: +6 -2 lines
Diff to previous 1.71 (colored) to selected 1.187 (colored)

lint: define debug_named_member only in debug mode

In non-debug mode it was an expensive no-op.

Revision 1.71 / (download) - annotate - [select for diffs], Sat Feb 20 17:12:00 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.70: +11 -4 lines
Diff to previous 1.70 (colored) to selected 1.187 (colored)

lint: document an assumption that has turned wrong with C99

Revision 1.70 / (download) - annotate - [select for diffs], Sat Feb 20 16:34:57 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.69: +8 -10 lines
Diff to previous 1.69 (colored) to selected 1.187 (colored)

lint: extend debugging for initializing objects

No functional change outside debug mode.

Revision 1.69 / (download) - annotate - [select for diffs], Sat Feb 20 16:03:56 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.68: +3 -3 lines
Diff to previous 1.68 (colored) to selected 1.187 (colored)

lint: rename mkinit to init_using_expr

No functional change outside debug mode.

Revision 1.68 / (download) - annotate - [select for diffs], Sat Feb 20 15:23:07 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.67: +154 -66 lines
Diff to previous 1.67 (colored) to selected 1.187 (colored)

lint: add hierarchical debug logging for initializations

No functional change for default mode.

Revision 1.67 / (download) - annotate - [select for diffs], Fri Feb 19 22:16:12 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.66: +6 -4 lines
Diff to previous 1.66 (colored) to selected 1.187 (colored)

lint: rename str_t and its members to be more expressive

No functional change.

Revision 1.66 / (download) - annotate - [select for diffs], Sun Jan 31 12:44:34 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.65: +4 -4 lines
Diff to previous 1.65 (colored) to selected 1.187 (colored)

lint: don't warn about constant condition in 'do { } while (0)'

Revision 1.65 / (download) - annotate - [select for diffs], Sat Jan 30 18:16:45 2021 UTC (3 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.64: +7 -6 lines
Diff to previous 1.64 (colored) to selected 1.187 (colored)

lint: rename incompl to is_incomplete

No functional change.

Revision 1.64 / (download) - annotate - [select for diffs], Sun Jan 17 15:40:27 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.63: +3 -3 lines
Diff to previous 1.63 (colored) to selected 1.187 (colored)

lint: fix return type of conaddr

Revision 1.63 / (download) - annotate - [select for diffs], Sat Jan 16 16:53:23 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.62: +12 -12 lines
Diff to previous 1.62 (colored) to selected 1.187 (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.62 / (download) - annotate - [select for diffs], Sat Jan 16 02:40:02 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.61: +22 -22 lines
Diff to previous 1.61 (colored) to selected 1.187 (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.61 / (download) - annotate - [select for diffs], Sun Jan 10 00:05:46 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.60: +9 -12 lines
Diff to previous 1.60 (colored) to selected 1.187 (colored)

lint: rename type classification macros

The previous names tspec_is_int and tspec_is_uint were confusing because
there are actually tspec_t constants called INT and UINT, these
classification macros return true for other integer types as well,
though.

While here, remove the prefix "tspec_" from these macros.  It wasn't as
helpful as intended, in many cases it was obviously redundant, when it
was called as tspec_is_integer(tn->tn_type->t_tspec).

No functional change.

Revision 1.60 / (download) - annotate - [select for diffs], Sun Jan 3 20:31:08 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.59: +3 -3 lines
Diff to previous 1.59 (colored) to selected 1.187 (colored)

lint: rename functions that create nodes

Revision 1.59 / (download) - annotate - [select for diffs], Sun Jan 3 19:10:47 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.58: +4 -4 lines
Diff to previous 1.58 (colored) to selected 1.187 (colored)

lint: rename type.t_isfield to t_bitfield

Revision 1.58 / (download) - annotate - [select for diffs], Sun Jan 3 17:42:45 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.57: +3 -3 lines
Diff to previous 1.57 (colored) to selected 1.187 (colored)

lint: let gnuism and c99ism return void instead of int

The return value was only used in a single case.  Duplicating the
condition for printing a message is ok in that case, since it makes all
other places in the code simpler.

The occasional "(void)" or "msg = " before the function call had hidden
the calls from check-msgs.lua, which didn't check the message texts in
such cases.

Revision 1.57 / (download) - annotate - [select for diffs], Sat Jan 2 03:49:25 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.56: +14 -25 lines
Diff to previous 1.56 (colored) to selected 1.187 (colored)

lint: fix buffer truncation for type names

Previously, most type names had been cut off after 63 significant
characters.  In some cases, 127 characters survived, or 255.  And for
the debugging messages, sometimes even 1023.  This inconsistency was
useless.

It was wrong in the first place to make the caller of the function
tyname responsible for handling the buffer.  That's not something a
caller of such a simple function should do.  These callers have better
things to do.

The API of the new function type_name is as simple as possible.

In the implementation, the name of the type is generated anew each time.
I just didn't know whether the type details could change, once the type
is initialized, and I didn't want to find out.  To be on the safe side,
the resulting type name is cached, independently of the type it was
generated for.  Using a trivial, unbalanced binary tree should be good
enough for now.

All this work is necessary to support adding new debug logging, without
being distracted by irrelevant implementation details such as these
buffer sizes.  Adding new debug messages should be fun and easy; up to
now, it was overly bureaucratic.

Revision 1.56 / (download) - annotate - [select for diffs], Sat Jan 2 01:06:15 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.55: +5 -5 lines
Diff to previous 1.55 (colored) to selected 1.187 (colored)

lint: use bool instead of u_int:1 in structures

Better late than never.

Revision 1.55 / (download) - annotate - [select for diffs], Fri Jan 1 20:02:56 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.54: +32 -3 lines
Diff to previous 1.54 (colored) to selected 1.187 (colored)

lint: add debug logging for initialization using named members

Revision 1.54 / (download) - annotate - [select for diffs], Fri Jan 1 19:28:51 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.53: +15 -2 lines
Diff to previous 1.53 (colored) to selected 1.187 (colored)

lint: document that C99-style initialization is necessarily buggy

Revision 1.53 / (download) - annotate - [select for diffs], Fri Jan 1 19:15:58 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.52: +24 -8 lines
Diff to previous 1.52 (colored) to selected 1.187 (colored)

lint: un-export struct istk

Revision 1.52 / (download) - annotate - [select for diffs], Fri Jan 1 19:11:19 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.51: +4 -4 lines
Diff to previous 1.51 (colored) to selected 1.187 (colored)

lint: fix wrong warning about bitfield in C99 structure initialization

The variable namemem is supposed to be a circular list, which is
"documented" implicitly in push_member.

The implementation was buggy though.  In pop_member, the circular list
was destroyed though.  Given the list (capital, major, favorite_color,
green), removing capital made major point to itself in the forward
direction, even though it should not have been modified at all.

In the test, I had been too optimistic to quickly understand the code
around variable initialization.  I was wrong though, so I had to adjust
the comments there to reality.

Revision 1.51 / (download) - annotate - [select for diffs], Fri Jan 1 16:50:47 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.50: +9 -5 lines
Diff to previous 1.50 (colored) to selected 1.187 (colored)

lint: demonstrate bug in handling of nested C9X struct initializers

Revision 1.50 / (download) - annotate - [select for diffs], Fri Jan 1 11:41:01 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.49: +4 -3 lines
Diff to previous 1.49 (colored) to selected 1.187 (colored)

lint: add missing redundant messages in source code

Revision 1.49 / (download) - annotate - [select for diffs], Fri Jan 1 00:00:24 2021 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.48: +4 -4 lines
Diff to previous 1.48 (colored) to selected 1.187 (colored)

lint: align comments in code with actual messages

Redundancy is bad.  Especially in this case, separating the format
strings from the actual arguments prevents the compiler from
cross-checking them.

Revision 1.48 / (download) - annotate - [select for diffs], Wed Dec 30 11:04:48 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.47: +5 -5 lines
Diff to previous 1.47 (colored) to selected 1.187 (colored)

lint: un-abbreviate s_field, s_keyw and s_xsym

Revision 1.47 / (download) - annotate - [select for diffs], Wed Dec 30 10:56:51 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.46: +3 -3 lines
Diff to previous 1.46 (colored) to selected 1.187 (colored)

lint: un-abbreviate parenthesized and _strg

Revision 1.46 / (download) - annotate - [select for diffs], Wed Dec 30 10:46:11 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.45: +12 -12 lines
Diff to previous 1.45 (colored) to selected 1.187 (colored)

lint: rename more _nxt members to _next

Revision 1.45 / (download) - annotate - [select for diffs], Wed Dec 30 10:26:12 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.44: +5 -5 lines
Diff to previous 1.44 (colored) to selected 1.187 (colored)

lint: rename s_nxt to s_next

Revision 1.44 / (download) - annotate - [select for diffs], Wed Dec 30 01:33:30 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.43: +12 -20 lines
Diff to previous 1.43 (colored) to selected 1.187 (colored)

lint: reduce verbosity of assertions

Having 2 lines of source code per assertion is too much, especially
since most of this code is redundant anyway.  Extract the common code
and the additional negation into a simple function instead.

Revision 1.43 / (download) - annotate - [select for diffs], Tue Dec 29 23:12:48 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.42: +27 -25 lines
Diff to previous 1.42 (colored) to selected 1.187 (colored)

lint: rename istk_t.i_cnt to i_remaining

Revision 1.42 / (download) - annotate - [select for diffs], Tue Dec 29 20:56:28 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.41: +7 -6 lines
Diff to previous 1.41 (colored) to selected 1.187 (colored)

lint: untangle conditions in initstack_next_nobrace

Revision 1.41 / (download) - annotate - [select for diffs], Tue Dec 29 20:07:04 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.40: +8 -9 lines
Diff to previous 1.40 (colored) to selected 1.187 (colored)

lint: clean up debug logging for initializations

Revision 1.40 / (download) - annotate - [select for diffs], Tue Dec 29 19:57:44 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.39: +26 -25 lines
Diff to previous 1.39 (colored) to selected 1.187 (colored)

lint: make debug output for initializations more uniform

Revision 1.39 / (download) - annotate - [select for diffs], Tue Dec 29 19:09:53 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.38: +2 -8 lines
Diff to previous 1.38 (colored) to selected 1.187 (colored)

lint: remove redundant function prototypes

Revision 1.38 / (download) - annotate - [select for diffs], Tue Dec 29 19:02:16 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.37: +14 -11 lines
Diff to previous 1.37 (colored) to selected 1.187 (colored)

lint: improve debug output for initializing structs

Still trying to find out where the wrong warning in d_struct_init_nested
comes from.

Revision 1.37 / (download) - annotate - [select for diffs], Tue Dec 29 16:59:12 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.36: +42 -43 lines
Diff to previous 1.36 (colored) to selected 1.187 (colored)

lint: split initstack_next into separate functions

Revision 1.36 / (download) - annotate - [select for diffs], Tue Dec 29 16:53:36 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.35: +34 -33 lines
Diff to previous 1.35 (colored) to selected 1.187 (colored)

lint: split initstack_pop into separate functions

Revision 1.35 / (download) - annotate - [select for diffs], Tue Dec 29 16:48:53 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.34: +37 -37 lines
Diff to previous 1.34 (colored) to selected 1.187 (colored)

lint: rename functions for handling the initialization stack

Revision 1.34 / (download) - annotate - [select for diffs], Tue Dec 29 13:33:03 2020 UTC (3 years, 2 months ago) by rillig
Branch: MAIN
Changes since 1.33: +13 -12 lines
Diff to previous 1.33 (colored) to selected 1.187 (colored)

lint: rename functions with very short names

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

lint: remove redundant parentheses around return value

Revision 1.32 / (download) - annotate - [select for diffs], Mon Dec 28 22:31:31 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.31: +4 -6 lines
Diff to previous 1.31 (colored) to selected 1.187 (colored)

lint: rename confusing function setcompl

The previous function name suggested that it would set the complete flag
of the type, but it was the exact opposite.  To reduce confusion, negate
the meaning of the parameter.

Revision 1.31 / (download) - annotate - [select for diffs], Mon Dec 28 19:07:43 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.30: +3 -3 lines
Diff to previous 1.30 (colored) to selected 1.187 (colored)

lint: sort includes

Revision 1.30 / (download) - annotate - [select for diffs], Mon Dec 28 19:02:16 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.29: +12 -10 lines
Diff to previous 1.29 (colored) to selected 1.187 (colored)

lint: realign code

Revision 1.29 / (download) - annotate - [select for diffs], Mon Dec 28 18:49:02 2020 UTC (3 years, 3 months ago) by rillig
Branch: MAIN
Changes since 1.28: +10 -9 lines
Diff to previous 1.28 (colored) to selected 1.187 (colored)

lint: rename tspec macros

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

lint1: remove trailing whitespace

Revision 1.27 / (download) - annotate - [select for diffs], Tue Jul 28 17:55:13 2015 UTC (8 years, 8 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, phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, phil-wifi-20191119, phil-wifi-20190609, phil-wifi, pgoyette-localcount-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, pgoyette-localcount, pgoyette-compat-merge-20190127, pgoyette-compat-base, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315, pgoyette-compat, perseant-stdc-iso10646-base, perseant-stdc-iso10646, netbsd-9-base, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9, netbsd-8-base, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, netbsd-8, matt-nb8-mediatek-base, matt-nb8-mediatek, localcount-20160914, is-mlppp-base, is-mlppp, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan
Changes since 1.26: +7 -13 lines
Diff to previous 1.26 (colored) to selected 1.187 (colored)

fix member list deallocation; remove #if 0'ed code.

Revision 1.26 / (download) - annotate - [select for diffs], Thu Nov 20 20:49:06 2014 UTC (9 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.25: +60 -36 lines
Diff to previous 1.25 (colored) to selected 1.187 (colored)

Always set i_brace in the struct case.
Cleanup some debugging.

Revision 1.24.12.1 / (download) - annotate - [select for diffs], Wed Aug 20 00:05:06 2014 UTC (9 years, 7 months ago) by tls
Branch: tls-maxphys
Changes since 1.24: +8 -17 lines
Diff to previous 1.24 (colored) next main 1.25 (colored) to selected 1.187 (colored)

Rebase to HEAD as of a few days ago.

Revision 1.24.22.1 / (download) - annotate - [select for diffs], Sun Aug 10 06:59:20 2014 UTC (9 years, 7 months ago) by tls
Branch: tls-earlyentropy
Changes since 1.24: +8 -17 lines
Diff to previous 1.24 (colored) next main 1.25 (colored) to selected 1.187 (colored)

Rebase.

Revision 1.24.6.1 / (download) - annotate - [select for diffs], Thu May 22 11:42:52 2014 UTC (9 years, 10 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.24: +8 -17 lines
Diff to previous 1.24 (colored) next main 1.25 (colored) to selected 1.187 (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], Thu Apr 17 16:29:26 2014 UTC (9 years, 11 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pagecache-base9, tls-maxphys-base, tls-earlyentropy-base, 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
Changes since 1.24: +8 -17 lines
Diff to previous 1.24 (colored) to selected 1.187 (colored)

Don't free memory; it is used later.

Revision 1.24 / (download) - annotate - [select for diffs], Fri Oct 2 18:17:16 2009 UTC (14 years, 5 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pagecache-tag8, yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, yamt-pagecache-base5, yamt-pagecache-base4, yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, 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, netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, netbsd-6, matt-premerge-20091211, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, matt-mips64-premerge-20101231, cherry-xenmp-base, cherry-xenmp, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2, agc-symver-base, agc-symver
Branch point for: yamt-pagecache, tls-maxphys, tls-earlyentropy
Changes since 1.23: +3 -3 lines
Diff to previous 1.23 (colored) to selected 1.187 (colored)

change initialization from non const of regular variables to c99 instead of
gnu since c99 now has it.

Revision 1.21.6.1 / (download) - annotate - [select for diffs], Tue Aug 18 10:58:33 2009 UTC (14 years, 7 months ago) by bouyer
Branch: netbsd-4-0
Changes since 1.21: +5 -4 lines
Diff to previous 1.21 (colored) next main 1.22 (colored) to selected 1.187 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #1353):
	usr.bin/xlint/lint1/init.c: revision 1.22
pushinit(): fix a use-after-free bug.

Revision 1.21.2.1 / (download) - annotate - [select for diffs], Tue Aug 18 10:58:29 2009 UTC (14 years, 7 months ago) by bouyer
Branch: netbsd-4
Changes since 1.21: +5 -4 lines
Diff to previous 1.21 (colored) next main 1.22 (colored) to selected 1.187 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #1353):
	usr.bin/xlint/lint1/init.c: revision 1.22
pushinit(): fix a use-after-free bug.

Revision 1.22.10.1 / (download) - annotate - [select for diffs], Sun May 18 12:36:11 2008 UTC (15 years, 10 months ago) by yamt
Branch: yamt-pf42
Changes since 1.22: +3 -3 lines
Diff to previous 1.22 (colored) next main 1.23 (colored) to selected 1.187 (colored)

sync with head.

Revision 1.23 / (download) - annotate - [select for diffs], Sat Apr 26 16:14:23 2008 UTC (15 years, 11 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pf42-base4, yamt-pf42-base3, yamt-pf42-base2, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, wrstuden-revivesa-base-1, wrstuden-revivesa-base, wrstuden-revivesa, 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, jym-xensuspend-nbase, jym-xensuspend-base, jym-xensuspend, hpcarm-cleanup-nbase
Changes since 1.22: +3 -3 lines
Diff to previous 1.22 (colored) to selected 1.187 (colored)

fix "long double" type recognition which broke with the complex changes.

Revision 1.22 / (download) - annotate - [select for diffs], Sat Jan 20 21:16:23 2007 UTC (17 years, 2 months ago) by ad
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base, 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.21: +5 -4 lines
Diff to previous 1.21 (colored) to selected 1.187 (colored)

pushinit(): fix a use-after-free bug.

Revision 1.21 / (download) - annotate - [select for diffs], Sun Oct 15 18:18:54 2006 UTC (17 years, 5 months ago) by christos
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
Branch point for: netbsd-4-0, netbsd-4
Changes since 1.20: +3 -2 lines
Diff to previous 1.20 (colored) to selected 1.187 (colored)

in the same way that we need an extra level for arrays, do the same for struct.

Revision 1.20 / (download) - annotate - [select for diffs], Sun Oct 15 15:08:20 2006 UTC (17 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.19: +13 -7 lines
Diff to previous 1.19 (colored) to selected 1.187 (colored)

previous fix broke array initializers.

Revision 1.19 / (download) - annotate - [select for diffs], Sat Oct 14 21:08:50 2006 UTC (17 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.18: +19 -11 lines
Diff to previous 1.18 (colored) to selected 1.187 (colored)

Fix c99 initialization issues. Now the regression tests work.

Revision 1.17.2.1 / (download) - annotate - [select for diffs], Tue Jun 22 07:21:53 2004 UTC (19 years, 9 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.17: +6 -2 lines
Diff to previous 1.17 (colored) next main 1.18 (colored) to selected 1.187 (colored)

Pull up revision 1.18 (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.18 / (download) - annotate - [select for diffs], Sun Jun 20 22:20:17 2004 UTC (19 years, 9 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, chap-midi-nbase, chap-midi-base, chap-midi, abandoned-netbsd-4-base, abandoned-netbsd-4
Changes since 1.17: +6 -2 lines
Diff to previous 1.17 (colored) to selected 1.187 (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.17 / (download) - annotate - [select for diffs], Fri Dec 6 03:27:39 2002 UTC (21 years, 3 months ago) by thorpej
Branch: MAIN
CVS Tags: netbsd-2-0-base, fvdl_fs64_base
Branch point for: netbsd-2-0
Changes since 1.16: +3 -2 lines
Diff to previous 1.16 (colored) to selected 1.187 (colored)

Include <string.h> for prototypes.

Revision 1.16 / (download) - annotate - [select for diffs], Wed Nov 13 21:50:57 2002 UTC (21 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.15: +16 -4 lines
Diff to previous 1.15 (colored) to selected 1.187 (colored)

PR/18896: Jason Thorpe: C99 structure member initializers broken for arrays.
XXX: The checking done does not work, but the code passes.

Revision 1.15 / (download) - annotate - [select for diffs], Wed Oct 23 00:36:36 2002 UTC (21 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.14: +4 -4 lines
Diff to previous 1.14 (colored) to selected 1.187 (colored)

forgot to commit those.

Revision 1.14 / (download) - annotate - [select for diffs], Tue Oct 22 21:09:34 2002 UTC (21 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.13: +11 -4 lines
Diff to previous 1.13 (colored) to selected 1.187 (colored)

handle free-ing of temp symbols properly. Don't segv on bad node types.

Revision 1.13 / (download) - annotate - [select for diffs], Tue Oct 22 13:30:23 2002 UTC (21 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.12: +3 -3 lines
Diff to previous 1.12 (colored) to selected 1.187 (colored)

fix spelling in comment.

Revision 1.12 / (download) - annotate - [select for diffs], Mon Oct 21 21:14:52 2002 UTC (21 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.11: +126 -5 lines
Diff to previous 1.11 (colored) to selected 1.187 (colored)

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

Revision 1.11 / (download) - annotate - [select for diffs], Fri Sep 13 14:59:24 2002 UTC (21 years, 6 months ago) by christos
Branch: MAIN
Changes since 1.10: +11 -11 lines
Diff to previous 1.10 (colored) to selected 1.187 (colored)

Minimize diffs with my C99 capable version [this commit does not include
C99 support.

- turn lerror() into a macro so that the filename and the line number of the
  error are printed before we abort.
- recurse in type printing to provide the proper type name.

Revision 1.10 / (download) - annotate - [select for diffs], Thu Jan 31 19:36:54 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, netbsd-1-6
Changes since 1.9: +3 -3 lines
Diff to previous 1.9 (colored) to selected 1.187 (colored)

Protect __RCSID and __COPYRIGHT from being invoked if not defined.

Revision 1.9 / (download) - annotate - [select for diffs], Tue Sep 18 18:15:54 2001 UTC (22 years, 6 months ago) by wiz
Branch: MAIN
Changes since 1.8: +3 -3 lines
Diff to previous 1.8 (colored) to selected 1.187 (colored)

Give initiali[sz]e all the "i"s it deserves.

Revision 1.8 / (download) - annotate - [select for diffs], Sun Sep 16 16:34:44 2001 UTC (22 years, 6 months ago) by wiz
Branch: MAIN
Changes since 1.7: +3 -3 lines
Diff to previous 1.7 (colored) to selected 1.187 (colored)

Spell 'occurred' with two 'r's.

Revision 1.7 / (download) - annotate - [select for diffs], Mon May 28 12:40:37 2001 UTC (22 years, 10 months ago) by lukem
Branch: MAIN
Changes since 1.6: +23 -23 lines
Diff to previous 1.6 (colored) to selected 1.187 (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.6 / (download) - annotate - [select for diffs], Sat Feb 24 00:43:51 2001 UTC (23 years, 1 month ago) by cgd
Branch: MAIN
Changes since 1.5: +2 -2 lines
Diff to previous 1.5 (colored) to selected 1.187 (colored)

fix broken NetBSD RCS id tags

Revision 1.5 / (download) - annotate - [select for diffs], Sun Feb 22 15:40:40 1998 UTC (26 years, 1 month 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.4: +3 -2 lines
Diff to previous 1.4 (colored) to selected 1.187 (colored)

WARNSify

Revision 1.4 / (download) - annotate - [select for diffs], Mon Oct 2 17:21:37 1995 UTC (28 years, 6 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.3: +3 -3 lines
Diff to previous 1.3 (colored) to selected 1.187 (colored)

prototypes override old style function definitions
this is a gnu extension to ansi c

Revision 1.3 / (download) - annotate - [select for diffs], Mon Oct 2 17:14:31 1995 UTC (28 years, 6 months ago) by jpo
Branch: MAIN
Changes since 1.2: +4 -4 lines
Diff to previous 1.2 (colored) to selected 1.187 (colored)

added inline keywords
"inline" is enabled by -g, "__inline" and "__inline__" are always available

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

RCS id cleanup

Revision 1.1.1.1 / (download) - annotate - [select for diffs] (vendor branch), Mon Jul 3 20:56:37 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.187 (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 (28 years, 9 months ago) by cgd
Branch: MAIN
Diff to selected 1.187 (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>