The NetBSD Project

CVS log for src/usr.bin/xlint/lint1/cgram.y

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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.432 / (download) - annotate - [select for diffs], Sun Jan 29 18:13:56 2023 UTC (34 hours, 38 minutes ago) by rillig
Branch: MAIN
CVS Tags: HEAD
Changes since 1.431: +4 -4 lines
Diff to previous 1.431 (colored)

lint: rename functions for function definition

No functional change.

Revision 1.431 / (download) - annotate - [select for diffs], Sat Jan 21 13:48:40 2023 UTC (9 days, 15 hours ago) by rillig
Branch: MAIN
Changes since 1.430: +23 -7 lines
Diff to previous 1.430 (colored)

lint: add support for C11 '_Atomic' as atomic-type-specifier

Following the C11 grammar, the keyword '_Atomic' needs to be a separate
syntactic category, to avoid further conflicts in the grammar.

The two newly added conflicts in the grammar would come into play when
mixing traditional C with C11, in a type name without an implicit 'int'.
If the type '_Atomic(int)*' were parsed as '_Atomic int(int)*', the
trailing '*' would be a syntax error.

Revision 1.430 / (download) - annotate - [select for diffs], Sat Jan 21 13:07:22 2023 UTC (9 days, 15 hours ago) by rillig
Branch: MAIN
Changes since 1.429: +10 -4 lines
Diff to previous 1.429 (colored)

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

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

Revision 1.429 / (download) - annotate - [select for diffs], Sat Jan 21 12:50:52 2023 UTC (9 days, 16 hours ago) by rillig
Branch: MAIN
Changes since 1.428: +10 -10 lines
Diff to previous 1.428 (colored)

lint: use type_qualifier rule instead of the token directly

No functional change.

Revision 1.428 / (download) - annotate - [select for diffs], Sat Jan 21 12:45:27 2023 UTC (9 days, 16 hours ago) by rillig
Branch: MAIN
Changes since 1.427: +17 -12 lines
Diff to previous 1.427 (colored)

lint: clean up grammar for type-qualifier

A type-qualifier by itself does not carry pointer information, so add a
helper rule in the grammar for those cases where a type-qualifier is
actually used in a type like 'int *const'.

This allows general type qualifier checks to be performed during
parsing, for example to ensure that '_Atomic' is only used in C11 or
later.

No functional change.

Revision 1.427 / (download) - annotate - [select for diffs], Sat Jan 21 08:04:43 2023 UTC (9 days, 20 hours ago) by rillig
Branch: MAIN
Changes since 1.426: +3 -3 lines
Diff to previous 1.426 (colored)

lint: fix null pointer dereference on invalid argument to __typeof__

Revision 1.426 / (download) - annotate - [select for diffs], Sun Jan 15 00:05:38 2023 UTC (2 weeks, 2 days ago) by rillig
Branch: MAIN
Changes since 1.425: +5 -6 lines
Diff to previous 1.425 (colored)

lint: make read_until_parent easier to understand

Previously, the '--level' in the loop condition looked as if it applied
more often than it really does.

No functional change.

Revision 1.425 / (download) - annotate - [select for diffs], Sat Jan 14 10:33:34 2023 UTC (2 weeks, 2 days ago) by rillig
Branch: MAIN
Changes since 1.424: +6 -4 lines
Diff to previous 1.424 (colored)

lint: use fewer abbreviations

No binary change except for line numbers in assertions in decl.c.

Revision 1.424 / (download) - annotate - [select for diffs], Sat Oct 1 09:42:40 2022 UTC (4 months ago) by rillig
Branch: MAIN
CVS Tags: netbsd-10-base, netbsd-10
Changes since 1.423: +7 -7 lines
Diff to previous 1.423 (colored)

lint: add hyphen to adjective 'old-style'

Revision 1.423 / (download) - annotate - [select for diffs], Sun Aug 28 10:43:18 2022 UTC (5 months ago) by rillig
Branch: MAIN
Changes since 1.422: +18 -18 lines
Diff to previous 1.422 (colored)

lint: rename functions to be clearer

No need anymore to keep external identifiers at the "6 significant
initial characters" mandated by C90.

Revision 1.422 / (download) - annotate - [select for diffs], Sun Aug 28 08:41:06 2022 UTC (5 months ago) by rillig
Branch: MAIN
Changes since 1.421: +22 -22 lines
Diff to previous 1.421 (colored)

lint: rename dcs manipulation functions to be clearer

No functional change.

Revision 1.421 / (download) - annotate - [select for diffs], Thu Aug 25 19:03:47 2022 UTC (5 months ago) by rillig
Branch: MAIN
Changes since 1.420: +51 -165 lines
Diff to previous 1.420 (colored)

lint: remove explicit list of known GCC attributes

Most GCC attributes consist of a single identifier.  Up to now, it was
necessary to list each of these identifiers in the grammar, even those
that only apply to a single target architecture.

Instead, parse the general form of attributes, matching the few
attributes that lint handles by name instead.  While here, rename the
grammar rules to use the GCC terms.

To avoid conflicts between the global function 'printf' and the GCC
attribute of the same name, do not add GCC attributes to the symbol
table, and don't make these symbols 'extern' either.

ok christos@.

Revision 1.420 / (download) - annotate - [select for diffs], Mon Jun 20 21:13:35 2022 UTC (7 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.419: +3 -3 lines
Diff to previous 1.419 (colored)

lint: add quotes around several placeholders in messages

Revision 1.419 / (download) - annotate - [select for diffs], Thu May 26 13:40:49 2022 UTC (8 months ago) by rillig
Branch: MAIN
Changes since 1.418: +13 -11 lines
Diff to previous 1.418 (colored)

lint: rename olwarn and LWARN_BAD to be more expressive

No functional change.

Revision 1.418 / (download) - annotate - [select for diffs], Thu May 26 12:47:20 2022 UTC (8 months ago) by rillig
Branch: MAIN
Changes since 1.417: +21 -17 lines
Diff to previous 1.417 (colored)

lint: merge debug and non-debug code for saving and restoring warnings

No functional change.

Revision 1.417 / (download) - annotate - [select for diffs], Thu May 26 12:27:25 2022 UTC (8 months ago) by rillig
Branch: MAIN
Changes since 1.416: +8 -3 lines
Diff to previous 1.416 (colored)

lint: remove assertion about saving and restoring warning flags

The assertion only triggers in debug mode, which is generally not used
as it adds lots of debug logging.  In production mode, the assumption
didn't hold for many years now, so remove the assertion.

Revision 1.416 / (download) - annotate - [select for diffs], Fri May 20 21:18:55 2022 UTC (8 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.415: +3 -3 lines
Diff to previous 1.415 (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.415 / (download) - annotate - [select for diffs], Thu May 12 20:57:49 2022 UTC (8 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.414: +5 -11 lines
Diff to previous 1.414 (colored)

lint: merge duplicate grammar rules for __alignof__ expr

This allows expressions like '__alignof__(ptr)->member', just as with
'sizeof'.

The upper rule in the grammar was preferred over the lower rule since it
shifted the T_LPAREN instead of reducing unary_expression.  Its
implementation invoked undefined behavior if the expression was NULL
since it didn't assign anything to $$.

Revision 1.414 / (download) - annotate - [select for diffs], Thu May 12 20:22:58 2022 UTC (8 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.413: +3 -2 lines
Diff to previous 1.413 (colored)

lint: add message text to newly added call to gnuism

Required by check-msgs.lua.

Revision 1.413 / (download) - annotate - [select for diffs], Thu May 12 18:47:29 2022 UTC (8 months, 2 weeks ago) by martin
Branch: MAIN
Changes since 1.412: +3 -3 lines
Diff to previous 1.412 (colored)

We have 130 shift/reduce conflicts now

Revision 1.412 / (download) - annotate - [select for diffs], Thu May 12 17:31:30 2022 UTC (8 months, 2 weeks ago) by christos
Branch: MAIN
Changes since 1.411: +8 -2 lines
Diff to previous 1.411 (colored)

gcc allows __alignof__(unary-expression)

Revision 1.411 / (download) - annotate - [select for diffs], Thu May 12 00:28:01 2022 UTC (8 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.410: +7 -2 lines
Diff to previous 1.410 (colored)

lint: add support for __alignof__ expr, a GCC extension

Seen in lib/libc/gmon/gmon.c:153.

Revision 1.410 / (download) - annotate - [select for diffs], Sat Apr 30 22:31:23 2022 UTC (9 months ago) by rillig
Branch: MAIN
Changes since 1.409: +13 -6 lines
Diff to previous 1.409 (colored)

lint: inline macro 'sflag'

Mark all places where lint's C90 mode is stricter than its C99 mode.

Most of the situations in which lint produces only warnings instead of
errors covered by the "Constraints" sections in the relevant standards.
This doesn't prevent a specific compiler from accepting it though.

No functional change.

Revision 1.409 / (download) - annotate - [select for diffs], Sat Apr 30 21:38:03 2022 UTC (9 months ago) by rillig
Branch: MAIN
Changes since 1.408: +8 -8 lines
Diff to previous 1.408 (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.408 / (download) - annotate - [select for diffs], Sat Apr 30 19:18:48 2022 UTC (9 months ago) by rillig
Branch: MAIN
Changes since 1.407: +8 -10 lines
Diff to previous 1.407 (colored)

lint: inline macro Sflag in cases of expected behavior

In the grammar rules 'enums_with_opt_comma' and 'block_item_list',
checking for allow_c99 was redundant since c99ism does not warn in C99
mode.

In the grammar rule 'designator', align the two actions structurally.

No functional change.

Revision 1.407 / (download) - annotate - [select for diffs], Fri Apr 29 22:44:44 2022 UTC (9 months ago) by rillig
Branch: MAIN
Changes since 1.406: +7 -8 lines
Diff to previous 1.406 (colored)

lint: make grammar compatible with Bison

Bison and BSD Yacc differ in how they translate the grammar into C code.

Bison:
	code above '%union' (YYDEBUG is either undefined or 1)
	#include "cgram.h" (which defines YYDEBUG to 0 if undefined)
	code from below '%union' until the first '%%'
	actions
	code below the second '%%'

BSD Yacc:
	code above the first '%%' (YYDEBUG is either undefined or 1)
	(no #include for "cgram.h")
	define YYDEBUG to 0 if undefined
	code below the second '%%' (YYDEBUG is either 0 or 1)
	actions

The easiest way around these differences is to remove the 'defined(...)'
around the conditionals YYDEBUG, YYBISON and YYBYACC.

Revision 1.406 / (download) - annotate - [select for diffs], Fri Apr 29 19:37:00 2022 UTC (9 months ago) by rillig
Branch: MAIN
Changes since 1.405: +4 -4 lines
Diff to previous 1.405 (colored)

lint: reorder grammar rule begin_type_typespec

This makes the rule structurally more similar to the other rules.  The
goal is that all rules whose name starts with 'begin_type_' actually
start with the rule 'begin_type'.  Currently, some rules parse their
type attributes before 'begin_type', which feels wrong, as type
attributes should be part of the type.

No functional change intended.

Revision 1.405 / (download) - annotate - [select for diffs], Fri Apr 29 07:02:40 2022 UTC (9 months ago) by rillig
Branch: MAIN
Changes since 1.404: +3 -3 lines
Diff to previous 1.404 (colored)

lint: only allow GCC attribute in null statement

The only indented usage in that position is a fallthrough statement, as
a replacement for a /* FALLTHROUGH */ comment.  There is no point in
using _Noreturn or _Alignas as a statement.

Ideally, instead of gcc_attribute, the grammar would allow
gcc_attribute_list here (as always with GCC attributes), but that would
have introduced a reduce/reduce conflict, due to the attributes in the
middle of labeled_statement.

Revision 1.404 / (download) - annotate - [select for diffs], Fri Apr 29 06:40:51 2022 UTC (9 months ago) by rillig
Branch: MAIN
Changes since 1.403: +4 -4 lines
Diff to previous 1.403 (colored)

lint: do not allow type attributes after label

After a label, the type attributes _Alignas, __packed and _Noreturn do
not make sense, so don't allow them.  The only kind of attributes that
makes sense there syntactically is GCC __attribute__.  Allow multiple
such attributes, like everywhere in the GCC grammar.

Revision 1.403 / (download) - annotate - [select for diffs], Thu Apr 28 21:38:38 2022 UTC (9 months ago) by rillig
Branch: MAIN
Changes since 1.402: +4 -4 lines
Diff to previous 1.402 (colored)

lint: revert resolving grammar conflicts for labeled statements

Restore the grammar rule for labeled_statement as it was before cgram.y
1.400 from 2022-04-24.  This allows labels with attributes again.  Fix
the wrong interpretation in the tests; the attributes belong to the
label, not to the statement.

Today in the morning, when I thought that the change in cgram.y 1.400
were innocent, I accidentally ran lint only with the options '-Sw' but
forgot the option '-g' for GNU mode.  Without that option, the token
'__attribute__' is unknown, which unsurprisingly leads to lots of syntax
errors, and these didn't change with that commit.  The actual change was
only visible in GNU mode.

Revision 1.402 / (download) - annotate - [select for diffs], Sun Apr 24 20:08:22 2022 UTC (9 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.401: +12 -6 lines
Diff to previous 1.401 (colored)

lint: error out on declarations with implicit int type

Revision 1.401 / (download) - annotate - [select for diffs], Sun Apr 24 19:21:01 2022 UTC (9 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.400: +11 -4 lines
Diff to previous 1.400 (colored)

lint: error out on missing type in declarations

Revision 1.400 / (download) - annotate - [select for diffs], Sun Apr 24 17:32:22 2022 UTC (9 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.399: +4 -4 lines
Diff to previous 1.399 (colored)

lint: resolve 4 shift/reduce conflicts in labeled_statement

The attributes are already parsed as part of the statement.

No functional change intended.

Revision 1.399 / (download) - annotate - [select for diffs], Sun Apr 24 16:54:09 2022 UTC (9 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.398: +7 -10 lines
Diff to previous 1.398 (colored)

lint: resolve 6 shift/reduce conflicts in type_direct_declarator

No functional change intended.

Revision 1.398 / (download) - annotate - [select for diffs], Sun Apr 24 16:50:06 2022 UTC (9 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.397: +12 -10 lines
Diff to previous 1.397 (colored)

lint: solve 6 shift/reduce conflicts in notype_direct_declarator

No functional change intended.

Revision 1.397 / (download) - annotate - [select for diffs], Sun Apr 24 15:55:50 2022 UTC (9 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.396: +3 -3 lines
Diff to previous 1.396 (colored)

lint: warn about anonymous struct in struct, in plain C99 mode

Revision 1.396 / (download) - annotate - [select for diffs], Sun Apr 24 13:38:57 2022 UTC (9 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.395: +9 -6 lines
Diff to previous 1.395 (colored)

lint: reduce shift/reduce conflicts in C grammar

Previously, direct_abstract_declarator allowed type attributes like
_Noreturn to be prepended and appended to a type without specifying any
order.

No functional change intended.

Revision 1.395 / (download) - annotate - [select for diffs], Sat Apr 16 09:22:25 2022 UTC (9 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.394: +6 -3 lines
Diff to previous 1.394 (colored)

lint: in C99 mode, allow trailing comma in enum declarations

Adjust the test to be run in C90 mode instead of traditional mode, since
traditional C didn't have enums.

Revision 1.394 / (download) - annotate - [select for diffs], Sun Apr 10 12:14:10 2022 UTC (9 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.393: +4 -3 lines
Diff to previous 1.393 (colored)

lint: fix assertion failure on duplicate qualifiers from __typeof__

Revision 1.393 / (download) - annotate - [select for diffs], Sat Apr 9 23:41:22 2022 UTC (9 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.392: +10 -10 lines
Diff to previous 1.392 (colored)

lint: distinguish between storage class and declaration kind

These types overlap but are not the same.

No functional change.

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

lint: rename dinfo_t.d_offset to d_offset_in_bits

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

No functional change.

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

lint: disambiguate sym_t.s_value

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

No functional change.

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

lint: split CTCONST into BOOL_CONST and ENUM_CONST

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

No functional change.

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

lint: inline member access macros for sym_t

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

No functional change.

Revision 1.388 / (download) - annotate - [select for diffs], Wed Mar 9 00:20:48 2022 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.387: +8 -7 lines
Diff to previous 1.387 (colored)

lint: fix indentation in C grammar

No functional change.

Revision 1.387 / (download) - annotate - [select for diffs], Tue Mar 1 00:17:12 2022 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.386: +3 -6 lines
Diff to previous 1.386 (colored)

lint: add debug logging for symbols and the symbol table

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

Revision 1.386 / (download) - annotate - [select for diffs], Sun Feb 27 19:32:51 2022 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.385: +3 -14 lines
Diff to previous 1.385 (colored)

lint: concatenate string literals from left to right

Previously, the string literals "1" "2" "3" "4" were concatenated in the
order "23", "234", "1234".  This influenced the location of the
diagnostics for traditional C (which doesn't know concatenation at all)
and for mixing regular strings and wide strings.

Now the diagnostics occur exactly where they are expected.  The first
string literal defines whether the whole string is regular or wide, and
any further string literals must match it.

In traditional C mode, there are more diagnostics than before, but that
doesn't hurt since they are still correct and nobody uses lint in
traditional C mode anyway.

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

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

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

lint: unabbreviate two more members of sym_t

No functional change.

Revision 1.383 / (download) - annotate - [select for diffs], Sun Feb 27 08:31:26 2022 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.382: +8 -8 lines
Diff to previous 1.382 (colored)

lint: encode lifetime of allocated memory in the function names

No functional change.

Revision 1.382 / (download) - annotate - [select for diffs], Sun Feb 27 01:47:28 2022 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.381: +3 -3 lines
Diff to previous 1.381 (colored)

lint: rename ARG to OLD_STYLE_ARG

Pre-C90 argument declarations have been old for more than 30 years now,
so mention that fact in the constant name.  This reduces potential
confusion with other occurrences of the words 'arg' or 'argument'.

No functional change.

Revision 1.381 / (download) - annotate - [select for diffs], Sat Feb 26 20:36:11 2022 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.380: +6 -4 lines
Diff to previous 1.380 (colored)

lint: fix memory corruption in statement expressions (since 2021-12-17)

The commit that introduced the assertion failure looks innocent, it only
adds a few predefined functions for GCC mode.  Nevertheless, before that
commit, lint consistently complained about 'error: void type illegal in
expression [109]', which doesn't make sense either.

This fix also removes the creative use of the initialization stack to
store the type of the statement expression.  Having a separate stack for
these statement expressions makes the code easier to understand.

Revision 1.380 / (download) - annotate - [select for diffs], Sat Feb 26 19:01:09 2022 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.379: +4 -11 lines
Diff to previous 1.379 (colored)

lint: extract code for handling statement expressions from the grammar

This prepares the fix of the memory corruption bug that is demonstrated
in t_integration.sh, test case assertion_failures.

No functional change.

Revision 1.379 / (download) - annotate - [select for diffs], Sat Jan 15 23:21:34 2022 UTC (12 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.378: +3 -2 lines
Diff to previous 1.378 (colored)

lint: warn about unreachable null statements

This warning flags the second semicolon of 'return;;' as being
unreachable.  It does not warn about these superfluous semicolons in
general though.

Seen in usr.bin/make/bmake_malloc.c.

Revision 1.378 / (download) - annotate - [select for diffs], Sun Dec 26 18:16:41 2021 UTC (13 months ago) by christos
Branch: MAIN
Changes since 1.377: +4 -2 lines
Diff to previous 1.377 (colored)

Add clang's optnone attribute.

Revision 1.377 / (download) - annotate - [select for diffs], Mon Dec 20 19:34:01 2021 UTC (13 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.376: +10 -3 lines
Diff to previous 1.376 (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.376 / (download) - annotate - [select for diffs], Sat Dec 18 11:37:00 2021 UTC (13 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.375: +4 -4 lines
Diff to previous 1.375 (colored)

lint: format grammar consistently

No binary change.

Revision 1.375 / (download) - annotate - [select for diffs], Thu Dec 16 23:46:21 2021 UTC (13 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.374: +5 -5 lines
Diff to previous 1.374 (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.374 / (download) - annotate - [select for diffs], Wed Dec 15 15:20:51 2021 UTC (13 months, 2 weeks ago) by christos
Branch: MAIN
Changes since 1.373: +8 -2 lines
Diff to previous 1.373 (colored)

Add more attributes

Revision 1.373 / (download) - annotate - [select for diffs], Tue Dec 14 20:13:13 2021 UTC (13 months, 2 weeks ago) by christos
Branch: MAIN
Changes since 1.372: +9 -3 lines
Diff to previous 1.372 (colored)

Improve restrict handling.

Revision 1.372 / (download) - annotate - [select for diffs], Sun Nov 28 09:59:59 2021 UTC (14 months ago) by rillig
Branch: MAIN
Changes since 1.371: +4 -4 lines
Diff to previous 1.371 (colored)

lint: allow Bison debug functions to be unused

The grammar is only compiled using Bison during development time. In the
official builds, it is built with byacc.

No functional change.

Revision 1.371 / (download) - annotate - [select for diffs], Sat Nov 27 20:13:48 2021 UTC (14 months ago) by christos
Branch: MAIN
Changes since 1.370: +4 -2 lines
Diff to previous 1.370 (colored)

Add target attribute

Revision 1.370 / (download) - annotate - [select for diffs], Tue Nov 16 21:01:05 2021 UTC (14 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.369: +72 -63 lines
Diff to previous 1.369 (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.369 / (download) - annotate - [select for diffs], Tue Nov 16 18:27:04 2021 UTC (14 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.368: +7 -3 lines
Diff to previous 1.368 (colored)

lint: fix wrong error message in strict bool mode

This fix only affects the last token before a macro, as well as the last
token in the expanded macro.

Revision 1.368 / (download) - annotate - [select for diffs], Tue Nov 16 17:41:23 2021 UTC (14 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.367: +4 -4 lines
Diff to previous 1.367 (colored)

lint: rename attron to in_gcc_attribute

No functional change.

Revision 1.367 / (download) - annotate - [select for diffs], Sun Sep 26 01:28:43 2021 UTC (16 months ago) by rillig
Branch: MAIN
Changes since 1.366: +5 -3 lines
Diff to previous 1.366 (colored)

lint: fix Bison warnings

cgram.y:998.11-35: warning: type clash on default action: <y_sym> != <>
    [-Wother]

No functional change.

Revision 1.366 / (download) - annotate - [select for diffs], Fri Sep 17 21:06:04 2021 UTC (16 months, 1 week ago) by christos
Branch: MAIN
Changes since 1.365: +4 -4 lines
Diff to previous 1.365 (colored)

Extra commit to fix the actual wrong comment before:
Add _Static_assert grammar and keyword

Revision 1.365 / (download) - annotate - [select for diffs], Fri Sep 17 20:17:30 2021 UTC (16 months, 1 week ago) by christos
Branch: MAIN
Changes since 1.364: +10 -2 lines
Diff to previous 1.364 (colored)

remove the lint kludges

Revision 1.364 / (download) - annotate - [select for diffs], Tue Sep 14 19:44:40 2021 UTC (16 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.363: +32 -41 lines
Diff to previous 1.363 (colored)

lint: allow [*] everywhere where [] and [integer] are allowed

It's a seldom used feature, but now it's at least consistent.

Revision 1.363 / (download) - annotate - [select for diffs], Tue Sep 14 19:06:27 2021 UTC (16 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.362: +8 -4 lines
Diff to previous 1.362 (colored)

lint: support int[*][3] from C99

No warning in pre-C99 mode since this declarator is not used in practice
anyway.

Revision 1.362 / (download) - annotate - [select for diffs], Mon Sep 13 06:11:51 2021 UTC (16 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.361: +4 -2 lines
Diff to previous 1.361 (colored)

lint: continue analysis of wrong type in abstract declaration

No functional change.

Revision 1.361 / (download) - annotate - [select for diffs], Fri Sep 10 20:02:50 2021 UTC (16 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.360: +4 -4 lines
Diff to previous 1.360 (colored)

lint: replace space followed by tab with simply tab

No functional change.

Revision 1.360 / (download) - annotate - [select for diffs], Sat Sep 4 12:30:46 2021 UTC (16 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.359: +3 -3 lines
Diff to previous 1.359 (colored)

lint: spell out abbreviations in comments

No functional change.

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

lint: explicitly ignore return value of some function calls

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

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

No functional change.

Revision 1.358 / (download) - annotate - [select for diffs], Wed Aug 25 22:48:40 2021 UTC (17 months ago) by rillig
Branch: MAIN
Changes since 1.357: +4 -2 lines
Diff to previous 1.357 (colored)

lint: add __attribute__ regparm

Seen in libexec/ld.elf_so/rtld.h.

Revision 1.357 / (download) - annotate - [select for diffs], Sat Aug 21 07:03:30 2021 UTC (17 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.356: +4 -4 lines
Diff to previous 1.356 (colored)

lint: add missing newlines to grammar debug output

Revision 1.356 / (download) - annotate - [select for diffs], Thu Aug 19 08:59:22 2021 UTC (17 months, 1 week ago) by christos
Branch: MAIN
Changes since 1.355: +4 -2 lines
Diff to previous 1.355 (colored)

Add returns_nonnull attribute

Revision 1.355 / (download) - annotate - [select for diffs], Wed Aug 11 05:19:32 2021 UTC (17 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.354: +5 -4 lines
Diff to previous 1.354 (colored)

lint: allow GCC __attribute__ after array brackets

GCC accepts this, so should lint.  Seen in pam_lastlog.c:115.

Revision 1.354 / (download) - annotate - [select for diffs], Sun Aug 1 19:18:10 2021 UTC (17 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.353: +7 -9 lines
Diff to previous 1.353 (colored)

lint: clean up debug logging in the C grammar

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

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

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

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

Revision 1.352 / (download) - annotate - [select for diffs], Sat Jul 31 17:09:21 2021 UTC (18 months ago) by rillig
Branch: MAIN
Changes since 1.351: +56 -2 lines
Diff to previous 1.351 (colored)

lint: add debugging output for the grammar tokens

No functional change outside debug mode.

Revision 1.351 / (download) - annotate - [select for diffs], Tue Jul 27 05:52:53 2021 UTC (18 months ago) by rillig
Branch: MAIN
Changes since 1.350: +4 -9 lines
Diff to previous 1.350 (colored)

lint: inline align_as in the grammar

This saves 500 bytes in the resulting binary.

No functional change.

Revision 1.350 / (download) - annotate - [select for diffs], Tue Jul 27 05:42:36 2021 UTC (18 months ago) by rillig
Branch: MAIN
Changes since 1.349: +4 -4 lines
Diff to previous 1.349 (colored)

lint: provide a direct link to the documentation

No functional change.

Revision 1.349 / (download) - annotate - [select for diffs], Mon Jul 26 18:10:14 2021 UTC (18 months ago) by rillig
Branch: MAIN
Changes since 1.348: +3 -3 lines
Diff to previous 1.348 (colored)

lint: fix parse error in conditional expression (since 2021-07-15)

Revision 1.348 / (download) - annotate - [select for diffs], Mon Jul 26 17:27:22 2021 UTC (18 months ago) by rillig
Branch: MAIN
Changes since 1.347: +4 -4 lines
Diff to previous 1.347 (colored)

lint: fix parsing of chained assignments (since 2021-07-15)

The grammar rule for assignment_expression is quite different from those
of the other expressions, for 2 reasons: first, its precedence is
right-to-left.  Second, its left-hand side must be an lvalue, which
rules out all binary operators.  K&R C even had a grammar rule named
'lvalue' for this purpose.  Later C standards made the kinds of
expressions more fine-grained and used 'unary_expression' in this place.

Revision 1.347 / (download) - annotate - [select for diffs], Mon Jul 26 17:15:24 2021 UTC (18 months ago) by rillig
Branch: MAIN
Changes since 1.346: +2 -4 lines
Diff to previous 1.346 (colored)

lint: remove redundant associativity declarations

Since cgram.y 1.325 from 2021-07-15, these are not needed anymore.
Strangely, neither yacc nor Bison warned about this redundancy.

No functional change, the grammar rules are the same as before.

Revision 1.346 / (download) - annotate - [select for diffs], Sun Jul 25 21:31:01 2021 UTC (18 months ago) by rillig
Branch: MAIN
Changes since 1.345: +12 -20 lines
Diff to previous 1.345 (colored)

lint: revert previous commit; it didn't improve readability

No functional change.

Revision 1.345 / (download) - annotate - [select for diffs], Sun Jul 25 19:57:22 2021 UTC (18 months ago) by rillig
Branch: MAIN
Changes since 1.344: +22 -14 lines
Diff to previous 1.344 (colored)

lint: merge duplicate code for abstract_declaration

No functional change; same code coverage outside of cgram.y.

Revision 1.344 / (download) - annotate - [select for diffs], Sun Jul 25 19:27:26 2021 UTC (18 months ago) by rillig
Branch: MAIN
Changes since 1.343: +11 -8 lines
Diff to previous 1.343 (colored)

lint: resolve conflicts in begin_type_specifier_qualifier_list

The 9 shift/reduce conflicts were all internal to the grammar rule
begin_type_specifier_qualifier_list.  Previously, there were two
possible ways to parse '__attribute__(()) const int':

1. '__attribute__(())' 'const int'
2. '__attribute__(()) const' 'int'

Both ways would produce the same result since __attribute__ has almost
no observable effects on the resulting type.

No functional change.

Revision 1.343 / (download) - annotate - [select for diffs], Sun Jul 25 19:05:27 2021 UTC (18 months ago) by rillig
Branch: MAIN
Changes since 1.342: +7 -6 lines
Diff to previous 1.342 (colored)

lint: reorder grammar rules

First the base cases, then the extensions, like in most other rules in
this file.

No functional change.

Revision 1.342 / (download) - annotate - [select for diffs], Sun Jul 25 18:48:47 2021 UTC (18 months ago) by rillig
Branch: MAIN
Changes since 1.341: +5 -5 lines
Diff to previous 1.341 (colored)

lint: fix parsing of enumerators with __attribute__

Revision 1.341 / (download) - annotate - [select for diffs], Sun Jul 25 18:44:21 2021 UTC (18 months ago) by rillig
Branch: MAIN
Changes since 1.340: +11 -11 lines
Diff to previous 1.340 (colored)

lint: fix parsing of __attribute__ before enum tag

The __attribute__ after the enumerators will be fixed in a follow-up
commit since lint exits after the 5th syntax error in a translation
unit, which up to now shadowed the error messages about the enumerators.

Revision 1.340 / (download) - annotate - [select for diffs], Sun Jul 25 18:01:03 2021 UTC (18 months ago) by rillig
Branch: MAIN
Changes since 1.339: +11 -8 lines
Diff to previous 1.339 (colored)

lint: add citations for a few grammar rules

No functional change.

Revision 1.339 / (download) - annotate - [select for diffs], Sun Jul 25 17:40:04 2021 UTC (18 months ago) by rillig
Branch: MAIN
Changes since 1.338: +24 -10 lines
Diff to previous 1.338 (colored)

lint: fix parsing of GNU __attribute__ after __asm

GCC only accepts them in the order __asm __attribute__, not the other
way round.  So should lint.

Revision 1.338 / (download) - annotate - [select for diffs], Sun Jul 25 16:57:23 2021 UTC (18 months ago) by rillig
Branch: MAIN
Changes since 1.337: +18 -12 lines
Diff to previous 1.337 (colored)

lint: wrap overly long lines

No functional change.

Revision 1.337 / (download) - annotate - [select for diffs], Sun Jul 25 15:58:24 2021 UTC (18 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.336: +5 -5 lines
Diff to previous 1.336 (colored)

lint: do not parse 'typeof(0)(void)' as function call

Previously, lint tried to parse 'typeof(0)(void)' as 'typeof'
'(0)(void)', which tries to call 0 as a function.

Revision 1.336 / (download) - annotate - [select for diffs], Sun Jul 25 15:48:57 2021 UTC (18 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.335: +3 -6 lines
Diff to previous 1.335 (colored)

lint: fix parsing of 'typeof(double(typeof(0.0)))'

By removing the misplaced grammar rule 'abstract_declarator: T_TYPEOF',
the type expression 'typeof(double(typeof(0.0)))' is no longer
interpreted as a declarator, but rather as a type specifier, just as in
the GCC parser.

This resolves 7 shift/reduce conflicts.

Revision 1.335 / (download) - annotate - [select for diffs], Fri Jul 23 15:14:49 2021 UTC (18 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.334: +14 -14 lines
Diff to previous 1.334 (colored)

lint: move single semicolon to external_declaration

This aligns more closely with the grammar from GCC's parser.  The global
cleanup from the grammar rule 'external_declaration:
top_level_declaration' is not performed anymore, which doesn't matter
since there is nothing to clean up after a single semicolon.

No functional change.

Revision 1.334 / (download) - annotate - [select for diffs], Wed Jul 21 21:24:45 2021 UTC (18 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.333: +16 -5 lines
Diff to previous 1.333 (colored)

lint: move assignments to $$ at the end of the action

They are closely related to return statements.

While here, add some more remarks from reviewing the grammar.

No functional change.

Revision 1.333 / (download) - annotate - [select for diffs], Wed Jul 21 21:17:57 2021 UTC (18 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.332: +18 -18 lines
Diff to previous 1.332 (colored)

lint: rename grammar rules for specifier-qualifier-list

No functional change.

Revision 1.332 / (download) - annotate - [select for diffs], Wed Jul 21 21:11:19 2021 UTC (18 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.331: +4 -7 lines
Diff to previous 1.331 (colored)

lint: remove unnecessary assertion for type qualifier

If there is any new type qualifier that lint should support (such as
_Atomic from C11), the obvious place is to look in the grammar rule
type_qualifier, so there is no need to have an assertion.

No functional change.

Revision 1.331 / (download) - annotate - [select for diffs], Wed Jul 21 21:04:00 2021 UTC (18 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.330: +5 -5 lines
Diff to previous 1.330 (colored)

lint: rename ignore_up_to_rparen to match the grammar rule

No functional change.

Revision 1.330 / (download) - annotate - [select for diffs], Tue Jul 20 19:44:36 2021 UTC (18 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.329: +11 -11 lines
Diff to previous 1.329 (colored)

lint: use consistent naming scheme for functions that build nodes

No functional change.

Revision 1.329 / (download) - annotate - [select for diffs], Tue Jul 20 19:35:53 2021 UTC (18 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.328: +27 -27 lines
Diff to previous 1.328 (colored)

lint: split 'build' into build_binary and build_unary

No functional change.

Revision 1.328 / (download) - annotate - [select for diffs], Thu Jul 15 20:05:49 2021 UTC (18 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.327: +11 -20 lines
Diff to previous 1.327 (colored)

lint: remove message 66 about missing semicolon in struct-declaration

Revision 1.327 / (download) - annotate - [select for diffs], Thu Jul 15 18:18:15 2021 UTC (18 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.326: +3 -23 lines
Diff to previous 1.326 (colored)

lint: merge duplicate code in declarations

No functional change, code coverage outside cgram.y stays the same.

Revision 1.326 / (download) - annotate - [select for diffs], Thu Jul 15 18:13:25 2021 UTC (18 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.325: +10 -6 lines
Diff to previous 1.325 (colored)

lint: rename grammar rule 'declaration' to 'declaration_or_error'

This prepares for merging the duplicate code from top_level_declaration.
The code coverage outside cgram.y is exactly the same as before.

No functional change.

Revision 1.325 / (download) - annotate - [select for diffs], Thu Jul 15 17:20:57 2021 UTC (18 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.324: +46 -42 lines
Diff to previous 1.324 (colored)

lint: in the grammar, replace %prec with explicit rules

This way, in the arguments of __attribute__, where only constant
expressions are expected, a '=' leads to a syntax error.  Previously,
this was not detected.

No noticeable change in practice since these cases are already handled
by the compilers.

Revision 1.324 / (download) - annotate - [select for diffs], Wed Jul 14 17:19:37 2021 UTC (18 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.323: +99 -97 lines
Diff to previous 1.323 (colored)

lint: in the grammar, rename 'decl' to 'declarator'

For a casual reader, the abbreviation 'decl' was ambiguous since C has
both declarations and declarators.

No functional change.

Revision 1.323 / (download) - annotate - [select for diffs], Wed Jul 14 17:07:24 2021 UTC (18 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.322: +3 -20 lines
Diff to previous 1.322 (colored)

lint: extract build_member_access from the grammar

No functional change.

Revision 1.322 / (download) - annotate - [select for diffs], Wed Jul 14 16:59:39 2021 UTC (18 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.321: +44 -40 lines
Diff to previous 1.321 (colored)

lint: rename grammar rule 'expr' to 'expression'

No functional change.

Revision 1.321 / (download) - annotate - [select for diffs], Wed Jul 14 16:51:57 2021 UTC (18 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.320: +14 -14 lines
Diff to previous 1.320 (colored)

lint: remove references to C18

The standard is called C17, not C18, and furthermore the section
numbering didn't change between C11 and C17.

No functional change.

Revision 1.320 / (download) - annotate - [select for diffs], Mon Jul 12 22:02:44 2021 UTC (18 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.319: +35 -33 lines
Diff to previous 1.319 (colored)

lint: order type declarations in grammar, group by C99 section

No functional change.

Revision 1.319 / (download) - annotate - [select for diffs], Mon Jul 12 21:43:44 2021 UTC (18 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.318: +733 -711 lines
Diff to previous 1.318 (colored)

lint: reorder grammar rules in the same way as in C99

The code coverage before and after this change is exactly the same,
except of course for cgram.y and cgram.c.

No functional change.

Revision 1.318 / (download) - annotate - [select for diffs], Sun Jul 11 21:07:44 2021 UTC (18 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.317: +55 -46 lines
Diff to previous 1.317 (colored)

lint: reorder grammar rules for expressions according to C18

No functional change.

Revision 1.317 / (download) - annotate - [select for diffs], Sun Jul 11 20:37:21 2021 UTC (18 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.316: +3 -3 lines
Diff to previous 1.316 (colored)

lint: make _Generic a primary-expression

C11 says so, and unless the _Generic expression was wrapped in
parentheses, it was not possible before to use it as a function call
expression.

Revision 1.316 / (download) - annotate - [select for diffs], Sun Jul 11 20:25:54 2021 UTC (18 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.315: +19 -19 lines
Diff to previous 1.315 (colored)

lint: rename grammar rule 'term' to 'cast_expression'

No functional change.

Revision 1.315 / (download) - annotate - [select for diffs], Sun Jul 11 20:07:41 2021 UTC (18 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.314: +21 -20 lines
Diff to previous 1.314 (colored)

lint: reorganize grammar rules for unary expressions

According to GCC, __builtin_offsetof is a primary-expression.

According to GCC, __real__, __imag__ and __extension__ are
unary-operator, just like '!' and '~'.

According to C11, _Alignof is a unary-operator.

Revision 1.314 / (download) - annotate - [select for diffs], Sun Jul 11 19:46:09 2021 UTC (18 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.313: +3 -9 lines
Diff to previous 1.313 (colored)

lint: remove grammar conflict for __real__ and __imag__

The rules were redundant since a term can be parenthesized by itself,
there is no need for an extra rule.  The rules for '__real__(term)' and
'__imag__(term)' were never reduced since these cases were handled by
the rules '__real__ term' and '__imag__ term' a few lines above.

No functional change.

Revision 1.313 / (download) - annotate - [select for diffs], Sun Jul 11 19:24:41 2021 UTC (18 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.312: +4 -2 lines
Diff to previous 1.312 (colored)

lint: support __attribute__((hot))

The corresponding attribute 'cold' was already added in cgram.y 1.84
from 2016-12-29.

Revision 1.312 / (download) - annotate - [select for diffs], Sun Jul 11 19:01:37 2021 UTC (18 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.311: +6 -4 lines
Diff to previous 1.311 (colored)

lint: fix shift/reduce conflict for dangling else

The following line no longer occurs in the yacc output:
257: shift/reduce conflict (shift 427, reduce 270) on T_ELSE

No functional change.

Revision 1.311 / (download) - annotate - [select for diffs], Sun Jul 11 18:22:02 2021 UTC (18 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.310: +4 -4 lines
Diff to previous 1.310 (colored)

lint: resolve shift/reduce conflict in notype_direct_decl

When a notype_direct_decl was followed by a type_attribute_list, and the
next token was another type_attribute, the parser could either continue
the current type_attribute_list or start a new one.  Either way has the
same effect since type_attribute_list has no associated action.

This reduces the conflicts by 4, one for each of T_ALIGNAS, T_ATTRIBUTE,
T_NORETURN, T_PACKED.  There are several other conflicts involving these
4 tokens, but they are harder to fix.

No functional change.

Revision 1.310 / (download) - annotate - [select for diffs], Sun Jul 11 18:03:47 2021 UTC (18 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.309: +8 -5 lines
Diff to previous 1.309 (colored)

lint: use separate tokens for logical not and bitwise complement

The token T_UNARY was misleading since it only captured 2 of the 6
operators that C99 calls unary-operator.  Make the grammar easier to
understand by explicitly listing these 2 operators.

No functional change.

Revision 1.309 / (download) - annotate - [select for diffs], Sun Jul 11 17:52:20 2021 UTC (18 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.308: +4 -6 lines
Diff to previous 1.308 (colored)

lint: remove redundant %prec from the grammar

Now that the precedence of the unary operators has been modeled via
separate rules, the precedence is no longer needed.

No change to the generated parser, with both yacc or Bison.

Revision 1.308 / (download) - annotate - [select for diffs], Sun Jul 11 17:38:55 2021 UTC (18 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.307: +23 -18 lines
Diff to previous 1.307 (colored)

lint: remove shift/reduce conflict for sizeof

According to the grammar, the expression 'sizeof(int)x' was ambiguous.
Since 'sizeof(int)' is a valid term, that could have been reduced,
which would have resulted in a parse error when trying to parse 'x'.

Now 'sizeof' takes a unary_expression instead of a term.

No functional change.

Revision 1.307 / (download) - annotate - [select for diffs], Sun Jul 11 16:57:21 2021 UTC (18 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.306: +61 -50 lines
Diff to previous 1.306 (colored)

lint: resolve shift/reduce conflicts for unary expressions

The grammar rule 'term' was ambiguous since both the prefix and postfix
increment operators were listed with the same precedence.  The
expression '++x++' was parsed as '++ (x++)', as expected, since
conflicts resolve towards shift.

Resolve these conflicts by structuring the grammar as in C99, with the
GCC extension of statement-expressions.  The resolved conflicts are:

134: shift/reduce conflict (shift 161, reduce 347) on T_LBRACK
134: shift/reduce conflict (shift 162, reduce 347) on T_LPAREN
134: shift/reduce conflict (shift 163, reduce 347) on T_POINT
134: shift/reduce conflict (shift 164, reduce 347) on T_ARROW
134: shift/reduce conflict (shift 165, reduce 347) on T_INCDEC
state 134
	term : term . T_INCDEC  (335)
	term : term . T_LBRACK expr T_RBRACK  (341)
	term : term . T_LPAREN T_RPAREN  (342)
	term : term . T_LPAREN argument_expression_list T_RPAREN  (343)
	term : term . point_or_arrow T_NAME  (344)
	term : T_EXTENSION term .  (347)

No functional change.

Revision 1.306 / (download) - annotate - [select for diffs], Sun Jul 11 15:07:39 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.305: +277 -225 lines
Diff to previous 1.305 (colored)

lint: fix bug when parsing unused variable (since 2021-07-10)

Partially revert to cgram.y 1.248 from 2021-06-29.

This fixes the parse error for variables whose declaration starts with
__attribute__((unused)).  In the many refactorings of the last days this
bug has slipped in, and since there were several refactorings in that
area, there may be have been further bugs that are not caught by the
current test suite.  Revert for now and maybe apply them later again
when there are more tests.

Things kept from the current version are:

The names of most of the rules, as they correspond more closely to C99
and do not affect the behavior in any way.

In type_direct_decl, the replacement of type_attribute_list with
type_attribute since that nonterminal is already part of a repetition
(saves 4 conflicts).

In block_item, the order of the rules corresponds to C99.  This has no
influence on the generated parser, except for the rule numbers, which
are informative.

The merge of the duplicate code for struct_tag, enum_tag and
enum_constant, as they all contained exactly the same code.

Revision 1.305 / (download) - annotate - [select for diffs], Sat Jul 10 22:46:02 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.304: +4 -4 lines
Diff to previous 1.304 (colored)

lint: fix parsing of __attribute__ for member (since 2021-07-10)

Since cgram.y 1.280 from 2021-07-10, lint could not parse struct members
that have multiple __attribute__ in front of their type.

Revision 1.304 / (download) - annotate - [select for diffs], Sat Jul 10 21:44:51 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.303: +12 -13 lines
Diff to previous 1.303 (colored)

lint: inline grammar rules declmod and qualifier_or_storage_class

The rule declmod had a confusing name since declmods was not exactly a
list of declmod.

Inlining the rules reduces the abstraction level.  There are still some
shift/reduce conflicts in that area, so make the rules as simple as
possible, in order to resolve these conflicts.

No functional change.

Revision 1.303 / (download) - annotate - [select for diffs], Sat Jul 10 21:08:16 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.302: +21 -37 lines
Diff to previous 1.302 (colored)

lint: merge duplicate code for struct and enum declarations

No functional change.

Revision 1.302 / (download) - annotate - [select for diffs], Sat Jul 10 20:58:35 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.301: +26 -26 lines
Diff to previous 1.301 (colored)

lint: move type_attribute back into the main section

Type attributes are a standard feature since C11 and thus do not belong
in the GCC-specific section.  Only the GCC __attribute__ belongs there.

No functional change.

Revision 1.301 / (download) - annotate - [select for diffs], Sat Jul 10 20:44:23 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.300: +15 -29 lines
Diff to previous 1.300 (colored)

lint: merge duplicate code for struct and enum tags

This is a tricky area.  Inlining identifier_sym did not work because of
the side-effects of getsym.  In situations where two identifiers of
different kinds follow each other, such as 'enum id1 id2', the timing is
crucial, and inlining identifier_sym would have led to an internal error
in getsym.  The symbol type has to be reset from FTAG to FVFT before
reading the next token.

No functional change.

Revision 1.300 / (download) - annotate - [select for diffs], Sat Jul 10 19:29:28 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.299: +52 -51 lines
Diff to previous 1.299 (colored)

lint: rename grammar rules to align with C99

No functional change.

Revision 1.299 / (download) - annotate - [select for diffs], Sat Jul 10 18:56:54 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.298: +22 -26 lines
Diff to previous 1.298 (colored)

lint: merge duplicate code for typespec and notype_typespec

No functional change.

Revision 1.298 / (download) - annotate - [select for diffs], Sat Jul 10 18:13:06 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.297: +13 -13 lines
Diff to previous 1.297 (colored)

lint: rename func_arg_list to align with C99

No functional change.

Revision 1.297 / (download) - annotate - [select for diffs], Sat Jul 10 17:46:55 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.296: +8 -7 lines
Diff to previous 1.296 (colored)

lint: rename y_sb to y_name

That buffer is only used for names of identifiers, so be more specific.

No functional change.

Revision 1.296 / (download) - annotate - [select for diffs], Sat Jul 10 17:35:54 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.295: +35 -35 lines
Diff to previous 1.295 (colored)

lint: rename clrtyp/deftyp to begin_type/end_type

The abbreviations clr/def did not make it obvious that these two
functions or grammar rules form pairs.

No functional change.

Revision 1.295 / (download) - annotate - [select for diffs], Sat Jul 10 17:17:05 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.294: +12 -13 lines
Diff to previous 1.294 (colored)

lint: extract clrtyp from noclass_declspecs

Finally each clrtyp pairs up with its corresponding deftyp, which makes
the grammar much easier to understand.  The many grammar rules that
contain these actions now all look the same.

No functional change.

Revision 1.294 / (download) - annotate - [select for diffs], Sat Jul 10 17:06:56 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.293: +24 -21 lines
Diff to previous 1.293 (colored)

lint: extract clrtyp from declaration_specifiers

This makes the grammar more uniform and thereby easier to understand.
The actions clrtyp and deftyp now come in pairs almost everywhere.

No functional change.

Revision 1.293 / (download) - annotate - [select for diffs], Sat Jul 10 16:54:40 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.292: +19 -19 lines
Diff to previous 1.292 (colored)

lint: split grammar rule clrtyp_declmods

By extracting clrtyp from that rule, clrtyp and deftyp pair up nicely in
most of the grammar rules.  These two actions delimit the common part of
a declaration that declares multiple identifiers.

No functional change.

Revision 1.292 / (download) - annotate - [select for diffs], Sat Jul 10 16:41:51 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.291: +6 -13 lines
Diff to previous 1.291 (colored)

lint: inline grammar rule clrtyp_typespec

No functional change.

Revision 1.291 / (download) - annotate - [select for diffs], Sat Jul 10 16:39:43 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.290: +3 -6 lines
Diff to previous 1.290 (colored)

lint: merge duplicate code from grammar rule clrtyp_typespec

No functional change.

Revision 1.290 / (download) - annotate - [select for diffs], Sat Jul 10 15:04:07 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.289: +4 -4 lines
Diff to previous 1.289 (colored)

lint: swap order in grammar rule clrtyp_typespec

It should not make a difference whether the rule says 'T_TYPENAME
clrtyp' or 'clrtyp T_TYPENAME'.  The latter order is more consistent
with the name of the rule, though.

According to the code, these two tokens take completely distinct
actions.  The code coverage outside of cgram.y and cgram.c stays exactly
the same, at least for lint's test suite.

No functional change intended.

Revision 1.289 / (download) - annotate - [select for diffs], Sat Jul 10 14:45:15 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.288: +14 -14 lines
Diff to previous 1.288 (colored)

lint: rename grammar rule declmods to clrtyp_declmods

It wasn't obvious from the name 'declmods' that this rule starts a new
type declaration.

No functional change.

Revision 1.288 / (download) - annotate - [select for diffs], Sat Jul 10 11:22:19 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.287: +5 -15 lines
Diff to previous 1.287 (colored)

lint: do not allow struct{const;}

In traditional C, a struct member was defined syntactically as
'type-specifier struct-declarator-list', the concept of a type-qualifier
was not known back then.

C90 invented the type-qualifier 'const' and relaxed the syntactic
requirement for struct member declarations by allowing 'const x'. Having
only a type-qualifier without an actual type may be regarded as an
"incomplete type", which would be forbidden by C90 and later.

Anyway, this doesn't occur in practice anyway, so there is no need for
lint to try to parse it.  This removes a bit of dead code, since a
type-qualifier-list can never have type struct or union.

Revision 1.287 / (download) - annotate - [select for diffs], Sat Jul 10 10:56:30 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.286: +18 -16 lines
Diff to previous 1.286 (colored)

lint: remove noclass_declmods from grammar

That rule was hard to understand since it contained clrtyp but not the
corresponding deftyp.  It's easier to read when a grammar rule contains
both clrtyp and deftyp in the same line.

C99 does not mention the term 'decl-modifier' anywhere, and in fact the
only thing that this grammar rule allowed was a type-qualifier-list.
The new name better reflect this.

No functional change.

Revision 1.286 / (download) - annotate - [select for diffs], Sat Jul 10 10:30:26 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.285: +11 -8 lines
Diff to previous 1.285 (colored)

lint: fix assertion failure for malformed member declaration

Revision 1.285 / (download) - annotate - [select for diffs], Sat Jul 10 09:53:00 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.284: +5 -11 lines
Diff to previous 1.284 (colored)

lint: merge duplicate code in grammar for 'for' loops

No functional change.

Revision 1.284 / (download) - annotate - [select for diffs], Sat Jul 10 09:48:41 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.283: +6 -17 lines
Diff to previous 1.283 (colored)

lint: clean up grammar for do-while statements

No functional change.

Revision 1.283 / (download) - annotate - [select for diffs], Sat Jul 10 09:40:12 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.282: +8 -11 lines
Diff to previous 1.282 (colored)

lint: merge duplicate code in grammar for 'while' statements

No functional change.

Revision 1.282 / (download) - annotate - [select for diffs], Sat Jul 10 05:42:29 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.281: +3 -3 lines
Diff to previous 1.281 (colored)

lint: do not allow __packed or _Alignas in statement

When the rule 'statement: type_attribute T_SEMI' was added in cgram.y
1.214 from 2021-04-14, type_attribute was the closest match since there
was no definition for gcc_attribute yet.

Revision 1.281 / (download) - annotate - [select for diffs], Sat Jul 10 05:03:03 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.280: +18 -16 lines
Diff to previous 1.280 (colored)

lint: reduce shift/reduce conflicts in direct_abstract_declarator

No functional change.

Revision 1.280 / (download) - annotate - [select for diffs], Sat Jul 10 04:57:41 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.279: +11 -12 lines
Diff to previous 1.279 (colored)

lint: remove 8 of the grammar conflicts, 142 remaining

No functional change.

Revision 1.279 / (download) - annotate - [select for diffs], Sat Jul 10 04:47:25 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.278: +8 -9 lines
Diff to previous 1.278 (colored)

lint: merge duplicate code in declmods and declmod

No functional change.

Revision 1.278 / (download) - annotate - [select for diffs], Sat Jul 10 04:25:47 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.277: +8 -23 lines
Diff to previous 1.277 (colored)

lint: remove duplicate code for parsing declarations

No functional change.

Revision 1.277 / (download) - annotate - [select for diffs], Fri Jul 9 20:51:27 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.276: +9 -14 lines
Diff to previous 1.276 (colored)

lint: remove 6 conflicts from the grammar, in type_direct_decl

No functional change.

Revision 1.276 / (download) - annotate - [select for diffs], Fri Jul 9 20:36:34 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.275: +9 -14 lines
Diff to previous 1.275 (colored)

lint: remove 6 of the remaining 162 conflicts from the grammar

No functional change.

Revision 1.275 / (download) - annotate - [select for diffs], Fri Jul 9 06:37:11 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.274: +4 -4 lines
Diff to previous 1.274 (colored)

lint: indent grammar actions properly

No functional change.

Revision 1.274 / (download) - annotate - [select for diffs], Thu Jul 8 19:08:03 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.273: +2 -3 lines
Diff to previous 1.273 (colored)

lint: fix assignment to midrule in grammar (since today)

When compiling the grammar with Bison, it complains:

	error: $$ for the midrule at $2 of 'struct' has no declared type

Yacc does not complain, instead it assumes that a midrule has the same
type as the rule itself.

The assignment '$$ = $1' in the midrule action does not influence the $$
of the whole rule, it only assigns to $2.  The assignment to $$ was done
via the default action, therefore everything worked as expected.  Any
missing assignment in this rule would have been caught quickly by the
strict assertion in mktag.

No functional change.

Revision 1.273 / (download) - annotate - [select for diffs], Thu Jul 8 18:53:57 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.272: +3 -4 lines
Diff to previous 1.272 (colored)

lint: fix wrong check for enum constants in switch (since today)

Revision 1.272 / (download) - annotate - [select for diffs], Thu Jul 8 18:50:57 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.271: +3 -2 lines
Diff to previous 1.271 (colored)

lint: demonstrate bug in handling enum declarations (since today)

Since cgram.y 1.270 from today (a "cleanup" commit), the enum constants
were only registered in the symbol table, but they were not added to the
enum type (en_first_enumerator).  That information is used for
validating switch statements on enum types.

The actual bug is an off-by-one error in the grammar, in the grammar
rule 'enum_declaration'.  Yacc does not notice this obvious error.
Bison does, but it is not involved in building lint.

In the grammar rule 'enum_declaration', the intended $3 contains the
first enumeration constant of the type, while $2, which yacc interprets
as a symbol, contains a null pointer, at least on x86_64.

The existing tests did not cover this scenario, so the bug went
unnoticed.

Revision 1.271 / (download) - annotate - [select for diffs], Thu Jul 8 04:09:10 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.270: +11 -12 lines
Diff to previous 1.270 (colored)

lint: add grammar rule type_attribute_list_opt

Since type attributes (and GCC attributes as well) often modify the
preceding identifier, without referring to $$, the easiest way to
integrate them into the grammar is to define a separate grammar rule
that can be placed wherever these attributes are allowed.  This avoids
duplicate actions like in direct_param_decl.

No functional change.

Revision 1.270 / (download) - annotate - [select for diffs], Thu Jul 8 03:55:54 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.269: +23 -22 lines
Diff to previous 1.269 (colored)

lint: clean up grammar

enum_decl_lbrace was only used once and was small enough to be inlined.

Renamed expr_statement and added block_item_list_opt to match the
wording from C99.

Added references to C99.

No functional change.

Revision 1.269 / (download) - annotate - [select for diffs], Thu Jul 8 03:35:07 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.268: +11 -15 lines
Diff to previous 1.268 (colored)

lint: clean up grammar for member declarations

No functional change.

Revision 1.268 / (download) - annotate - [select for diffs], Thu Jul 8 03:22:47 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.267: +14 -14 lines
Diff to previous 1.267 (colored)

lint: move optional grammar rules above their corresponding rules

No functional change.

Revision 1.267 / (download) - annotate - [select for diffs], Thu Jul 8 03:19:17 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.266: +32 -32 lines
Diff to previous 1.266 (colored)

lint: move grammar rules for generic_selection around

They were misplaced between the statements, as they belong to the
expressions, as indicated by the C99 section number.

No functional change.

Revision 1.266 / (download) - annotate - [select for diffs], Thu Jul 8 03:14:56 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.265: +50 -50 lines
Diff to previous 1.265 (colored)

lint: remove irrelevant type information from __attribute__ tokens

The grammar once declared that an __attribute__ contained type
information, but that was not used anyway.

No functional change.

Revision 1.265 / (download) - annotate - [select for diffs], Tue Jul 6 21:41:36 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.264: +12 -2 lines
Diff to previous 1.264 (colored)

lint: document further shift/reduce conflicts

These cannot be resolved as easily as those from the previous commit.
Anyway, the relevant code from the grammar is not yet covered by the
tests, this needs to be done first.

Revision 1.264 / (download) - annotate - [select for diffs], Tue Jul 6 20:56:38 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.263: +12 -2 lines
Diff to previous 1.263 (colored)

lint: document the cause for 24 of the 162 grammar conflicts

Revision 1.263 / (download) - annotate - [select for diffs], Tue Jul 6 20:29:08 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.262: +3 -9 lines
Diff to previous 1.262 (colored)

lint: resolve conflict in grammar for __real__ and __imag__

There is no need for extra rules for '__real__(term)' since that is
already handled by the simpler '__real__ term', just a few lines further
up in the grammar.  Likewise for __imag__.

The GCC manual does not mention anything about parentheses either.

Revision 1.262 / (download) - annotate - [select for diffs], Tue Jul 6 19:08:28 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.261: +14 -6 lines
Diff to previous 1.261 (colored)

lint: do not allow _Alignas (from C11) or __packed after a label

Revision 1.261 / (download) - annotate - [select for diffs], Tue Jul 6 18:28:08 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.260: +21 -19 lines
Diff to previous 1.260 (colored)

lint: rename grammar rules for GCC __attribute__

No functional change.

Revision 1.260 / (download) - annotate - [select for diffs], Tue Jul 6 18:22:40 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.259: +114 -110 lines
Diff to previous 1.259 (colored)

lint: move grammar rules for GCC __attribute__ to the bottom

In GCC 2.95.3, attributes had already been available for functions,
variables and types.  At that time they were indeed related to
declarations, and that's where they ended up in lint's grammar.  Later,
attributes were extended to labels, enumerators and statements as well.

To keep the grammar for declarations short and comprehensible, move the
rather large part about __attribute__ at the bottom of the grammar,
creating a new section called "GCC extensions".

The grammar rules are not named accurately (and never were).  They are
called "type attributes" but apply not only to types.  These names will
be improved in a follow-up commit.

No functional change.

Revision 1.259 / (download) - annotate - [select for diffs], Tue Jul 6 17:52:04 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.258: +18 -20 lines
Diff to previous 1.258 (colored)

lint: align grammar rules for enum-specifier with C99

No functional change.

Revision 1.258 / (download) - annotate - [select for diffs], Tue Jul 6 16:02:44 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.257: +3 -2 lines
Diff to previous 1.257 (colored)

lint: document grammar rule that deviates from C99

Revision 1.257 / (download) - annotate - [select for diffs], Tue Jul 6 05:39:27 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.256: +18 -24 lines
Diff to previous 1.256 (colored)

lint: rearrange and rename grammar rules for parameter declarations

Place the notype/type variants close to each other to be able to compare
them visually.

No functional change.

Revision 1.256 / (download) - annotate - [select for diffs], Tue Jul 6 05:22:34 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.255: +19 -15 lines
Diff to previous 1.255 (colored)

lint: move the grammar rule array_size out of the type/notype section

An array size is used in several grammar rules for different types of
declarations, therefore it doesn't make sense to place that rule
somewhere in the middle, where it disrupted the flow of notype/type
rules.  The whole point of having the notype/type rules grouped is to be
able to quickly compare them, since they are almost equal.

No functional change.

Revision 1.255 / (download) - annotate - [select for diffs], Tue Jul 6 05:12:44 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.254: +7 -7 lines
Diff to previous 1.254 (colored)

lint: reduce grammar conflicts for GCC attributes

In all but one case, the use of type_attribute_list introduced an
unnecessary ambiguity in the grammar.  It appeared in a place where it
could be repeated either by the type_attribute_list or by the enclosing
rule.  Both variants have the same effect.

No functional change.

Revision 1.254 / (download) - annotate - [select for diffs], Tue Jul 6 04:48:17 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.253: +12 -10 lines
Diff to previous 1.253 (colored)

lint: clean up style in grammar

No functional change.

Revision 1.253 / (download) - annotate - [select for diffs], Tue Jul 6 04:44:20 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.252: +10 -10 lines
Diff to previous 1.252 (colored)

lint: rename type generic_association_types to generic_association

The word 'types' was misleading and unnecessary.

No functional change.

Revision 1.252 / (download) - annotate - [select for diffs], Mon Jul 5 19:59:10 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.251: +3 -2 lines
Diff to previous 1.251 (colored)

lint: refer to documentation about the 'notype' rules in the grammar

Revision 1.251 / (download) - annotate - [select for diffs], Mon Jul 5 19:53:43 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.250: +3 -3 lines
Diff to previous 1.250 (colored)

lint: rename message 340 to talk about "GCC extension", not "GNU"

Revision 1.250 / (download) - annotate - [select for diffs], Mon Jul 5 19:48:32 2021 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.249: +3 -3 lines
Diff to previous 1.249 (colored)

lint: rename dinfo_t.d_stralign to d_sou_align_in_bits

When talking about alignment, offset and size of a type, the measurement
unit must be mentioned in the variable name, especially when it differs
from the standard unit of measurement, which is a byte, not a bit.

No functional change.

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

lint: guard against segmentation fault when parsing struct

Found by afl.  The code that triggers this case is:

	struct{const}

Revision 1.248 / (download) - annotate - [select for diffs], Tue Jun 29 05:41:45 2021 UTC (19 months ago) by rillig
Branch: MAIN
Changes since 1.247: +2 -6 lines
Diff to previous 1.247 (colored)

lint: remove comment from grammar rule type_direct_decl

The 'identifier' in type_direct_decl is necessary, as demonstrated in
the test d_typename_as_var.  Replacing T_NAME with 'identifier' in
notype_direct_decl would increase the shift/reduce conflicts by 6.  To
keep this number low, keep everything as-is.

Revision 1.247 / (download) - annotate - [select for diffs], Mon Jun 28 11:09:35 2021 UTC (19 months ago) by rillig
Branch: MAIN
Changes since 1.246: +6 -3 lines
Diff to previous 1.246 (colored)

lint: fix parse error for type 'void (*)[*]'

Revision 1.246 / (download) - annotate - [select for diffs], Mon Jun 28 09:40:52 2021 UTC (19 months ago) by rillig
Branch: MAIN
Changes since 1.245: +20 -21 lines
Diff to previous 1.245 (colored)

lint: rename grammar rules for abstract declarators

The previous name 'decl' was ambiguous, it could have meant declaration
as well as declarator.  The new names are aligned with C99.

No functional change.

Revision 1.245 / (download) - annotate - [select for diffs], Mon Jun 28 09:14:42 2021 UTC (19 months ago) by rillig
Branch: MAIN
Changes since 1.244: +13 -15 lines
Diff to previous 1.244 (colored)

lint: align grammar with C99

C99 uses type-qualifier-list_opt in section 6.7.5.

Revision 1.244 / (download) - annotate - [select for diffs], Mon Jun 28 09:01:48 2021 UTC (19 months ago) by rillig
Branch: MAIN
Changes since 1.243: +3 -4 lines
Diff to previous 1.243 (colored)

lint: refrain from renaming the grammar rule 'pointer'

That rule is called 'pointer' by C99 as well.

No functional change.

Revision 1.243 / (download) - annotate - [select for diffs], Mon Jun 28 08:52:55 2021 UTC (19 months ago) by rillig
Branch: MAIN
Changes since 1.242: +12 -14 lines
Diff to previous 1.242 (colored)

lint: rename pqinf_t to qual_ptr and clean up code

The 'inf' from the type name meant 'information' and was redundant. Each
object of that type represents a single pointer level, which made the
documentation about 'pointers' a bit confusing.

The members of struct qual_ptr are now in the canonical reading order,
which is 'const volatile pointer'.

No functional change.

Revision 1.242 / (download) - annotate - [select for diffs], Mon Jun 28 07:55:05 2021 UTC (19 months ago) by rillig
Branch: MAIN
Changes since 1.241: +4 -4 lines
Diff to previous 1.241 (colored)

lint: only accept assignment-expression in _Generic

That's what C11 says.

Revision 1.241 / (download) - annotate - [select for diffs], Sun Jun 27 21:52:18 2021 UTC (19 months ago) by rillig
Branch: MAIN
Changes since 1.240: +29 -30 lines
Diff to previous 1.240 (colored)

lint: consistently use 'opt' as suffix

This corresponds to the usage in the C standards, where 'opt' is used as
a subscripted suffix.

No functional change.

Revision 1.240 / (download) - annotate - [select for diffs], Sun Jun 27 21:46:17 2021 UTC (19 months ago) by rillig
Branch: MAIN
Changes since 1.239: +26 -75 lines
Diff to previous 1.239 (colored)

lint: remove redundant '{ $$ = $1; }' from the grammar

In some cases the redundant code had been spelled out, in others it had
been left out.  Be consistent.

Revision 1.239 / (download) - annotate - [select for diffs], Sun Jun 27 21:36:14 2021 UTC (19 months ago) by rillig
Branch: MAIN
Changes since 1.238: +34 -36 lines
Diff to previous 1.238 (colored)

lint: reorder grammar rules from big to small

No functional change.

Revision 1.238 / (download) - annotate - [select for diffs], Sun Jun 27 21:30:46 2021 UTC (19 months ago) by rillig
Branch: MAIN
Changes since 1.237: +9 -5 lines
Diff to previous 1.237 (colored)

lint: fix parsing of _Generic selection expressions

Previously, lint accepted comma-expressions where only
assignment-expressions are allowed.

This change does not make a difference in practice though since lint is
usually only run on source code that properly compiles.  Nevertheless,
rather be precise and accurate since the grammar might some day be
reused on less reliable input.

Revision 1.237 / (download) - annotate - [select for diffs], Sun Jun 27 20:47:13 2021 UTC (19 months ago) by rillig
Branch: MAIN
Changes since 1.236: +20 -6 lines
Diff to previous 1.236 (colored)

lint: fix result type of _Generic expressions

Revision 1.236 / (download) - annotate - [select for diffs], Sun Jun 27 19:10:29 2021 UTC (19 months ago) by rillig
Branch: MAIN
Changes since 1.235: +4 -2 lines
Diff to previous 1.235 (colored)

lint: require C11 for _Generic

This does not have any effect in practice since the option -g
(originally meant for GCC extensions to the C standards) implicitly
allows all features from C11, since err.c 1.111 from 2021-04-14.

Since the default lint flags for NetBSD builds include the option -g,
this allows all C11 features.

Currently it is not possible to say "allow GNU extensions but not C11".

Revision 1.235 / (download) - annotate - [select for diffs], Sun Jun 27 18:54:14 2021 UTC (19 months ago) by rillig
Branch: MAIN
Changes since 1.234: +16 -19 lines
Diff to previous 1.234 (colored)

lint: sort and rename grammar rules for generic selection

No functional change.

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

lint: fix uninitialized variable for declaration after statement

Revision 1.233 / (download) - annotate - [select for diffs], Sun Jun 27 18:03:05 2021 UTC (19 months ago) by rillig
Branch: MAIN
Changes since 1.232: +23 -5 lines
Diff to previous 1.232 (colored)

lint: proof-read the C grammar, remove unnecessary %type

After the fix from the previous commit (a missing assignment to $$ in an
error case), make sure that there are no other bugs of the same kind, by
manually checking that each rule with a %type assigns $$ in each and
every case.  There is one more instance in block_item_list, but that
does not lead to a crash since it affects only a boolean variable, not a
pointer.

It should not be necessary to check for this class of bugs manually, but
neither BSD yacc nor GNU Bison provide any warning option to help with
this scenario.  They should have remarked that the %type for
type_attribute is never used, since that is easy to detect.  They should
have also warned that the rule for block_item_list does not mention $$
at all.

Detecting the bug from the previous commit would probably be too much to
ask since it involves control flow analysis in the C code.  In this
particular case, it would have been necessary to visit each possible
branch from the 'if' statement and ensure that there is a $$ on the
left-hand side of an assignment.

While here, note down several small inconsistencies in the grammar that
should be fixed in follow-up commits.

Revision 1.232 / (download) - annotate - [select for diffs], Sun Jun 27 13:59:29 2021 UTC (19 months ago) by rillig
Branch: MAIN
Changes since 1.231: +3 -2 lines
Diff to previous 1.231 (colored)

lint: fix undefined behavior after syntax error 'unnamed member'

There should really be a linter or other check that guards against
forgetting to assign a value to '$$'.

Revision 1.231 / (download) - annotate - [select for diffs], Sun Jun 27 08:20:50 2021 UTC (19 months ago) by rillig
Branch: MAIN
Changes since 1.230: +3 -3 lines
Diff to previous 1.230 (colored)

lint: fix type of pqinf.p_pcnt

A counter that can either be 0 or 1 and is never incremented is not
really a counter, it's a flag.

No functional change.

Revision 1.230 / (download) - annotate - [select for diffs], Sun Jun 20 18:15:12 2021 UTC (19 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.229: +11 -16 lines
Diff to previous 1.229 (colored)

lint: use different tokens for operators '.' and '->'

Before C99, these tokens were only used in member access expressions.
C99 reused the operator '.' in initializations of structs and unions.
Let the grammar check for syntax errors instead of writing custom code.

No functional change.

Revision 1.229 / (download) - annotate - [select for diffs], Sun Jun 20 11:42:25 2021 UTC (19 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.228: +13 -8 lines
Diff to previous 1.228 (colored)

lint: fix crash on semantically wrong code in ({...})

Found by afl.

Revision 1.228 / (download) - annotate - [select for diffs], Sat Jun 19 19:49:15 2021 UTC (19 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.227: +10 -6 lines
Diff to previous 1.227 (colored)

lint: fix assertion failure in struct with unnamed member

Found using afl.

Revision 1.227 / (download) - annotate - [select for diffs], Sat Jun 19 15:23:57 2021 UTC (19 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.226: +3 -2 lines
Diff to previous 1.226 (colored)

lint: replace undefined behavior with assertion failure

Triggered by this malformed code:

	struct{int;

Revision 1.226 / (download) - annotate - [select for diffs], Mon May 3 05:24:44 2021 UTC (20 months, 4 weeks 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.225: +38 -49 lines
Diff to previous 1.225 (colored)

lint: fix parsing of __typeof__ after statement in ({ ... })

Since C99, declarations and statements can be freely mixed, and GCC
supported this even before 1999.

Revision 1.225 / (download) - annotate - [select for diffs], Sun May 2 20:53:13 2021 UTC (20 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.224: +31 -31 lines
Diff to previous 1.224 (colored)

lint: sort GCC attributes alphabetically in the grammar

No functional change.

Revision 1.224 / (download) - annotate - [select for diffs], Sat May 1 07:25:07 2021 UTC (21 months ago) by rillig
Branch: MAIN
Changes since 1.223: +14 -3 lines
Diff to previous 1.223 (colored)

lint: support all documented variants of __attribute__((nonnull))

Revision 1.223 / (download) - annotate - [select for diffs], Fri Apr 30 19:46:24 2021 UTC (21 months ago) by christos
Branch: MAIN
Changes since 1.222: +6 -4 lines
Diff to previous 1.222 (colored)

- add nonstring attribute
- allow attributes after labels (for unused)
XXX: split the attributes into function, variable, etc attributes
so that we don't accept all attributes in all places (only where they make
sense)

Revision 1.222 / (download) - annotate - [select for diffs], Thu Apr 29 17:11:30 2021 UTC (21 months ago) by christos
Branch: MAIN
Changes since 1.221: +4 -2 lines
Diff to previous 1.221 (colored)

Add constructor and destructor attribute priorities

Revision 1.221 / (download) - annotate - [select for diffs], Fri Apr 23 20:26:43 2021 UTC (21 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.220: +9 -16 lines
Diff to previous 1.220 (colored)

lint: merge duplicate code in grammar for GCC compound expressions

This increases the number of shift/reduce conflicts, once again.  I
don't know why since the previous two grammar rules only differed in a
single detail.  One of them had a declaration_list while the other
didn't.  This difference is exactly what declaration_list_opt is for.

Anyway, the tests for both cases (with and without declarations) work
exactly as before.

Merging this duplicate code will probably make it easier to fix the
current limitation in lint regarding GCC compound expressions that a
statement followed by a declaration generates a syntax error.

Fixing this is not trivial, my first attempt failed either with
segmentation faults or with sym->s_type becoming NOSPEC during the
expression.

Revision 1.220 / (download) - annotate - [select for diffs], Tue Apr 20 21:48:39 2021 UTC (21 months, 1 week ago) by christos
Branch: MAIN
Changes since 1.219: +4 -2 lines
Diff to previous 1.219 (colored)

Add common attribute

Revision 1.219 / (download) - annotate - [select for diffs], Sun Apr 18 21:53:37 2021 UTC (21 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.218: +5 -5 lines
Diff to previous 1.218 (colored)

lint: fix strict bool mode errors in cgram.y

The code generated by yacc already adheres to strict bool mode, in
default mode as well as in debug mode.

Running lint on the generated cgram.c as well avoids most of the
"declared but not used" warnings from lint2.

The code generated by lex does not adhere to strict bool mode though.
Suppressing the errors from strict bool mode works, but then lint1 runs
into an assertion failure:

	assertion "tn != NULL || nerr != 0" failed
	    in expr at tree.c:3610 near scan.c:822

This leaves several warnings about "declared but not used" for the
functions from lex.c.

Revision 1.218 / (download) - annotate - [select for diffs], Wed Apr 14 22:08:28 2021 UTC (21 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.217: +4 -3 lines
Diff to previous 1.217 (colored)

lint: remove stray semicolon from grammar, make empty rule visible

No functional change.

Revision 1.217 / (download) - annotate - [select for diffs], Wed Apr 14 21:20:21 2021 UTC (21 months, 2 weeks ago) by christos
Branch: MAIN
Changes since 1.216: +9 -5 lines
Diff to previous 1.216 (colored)

there is also an optional type qualifier list in the array size

Revision 1.216 / (download) - annotate - [select for diffs], Wed Apr 14 18:35:40 2021 UTC (21 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.215: +5 -5 lines
Diff to previous 1.215 (colored)

lint: add support for C11-isms such as int[static 3]

Revision 1.215 / (download) - annotate - [select for diffs], Wed Apr 14 18:27:11 2021 UTC (21 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.214: +4 -3 lines
Diff to previous 1.214 (colored)

lint: add test for newly added message about static array size

Revision 1.214 / (download) - annotate - [select for diffs], Wed Apr 14 13:34:08 2021 UTC (21 months, 2 weeks ago) by christos
Branch: MAIN
Changes since 1.213: +22 -8 lines
Diff to previous 1.213 (colored)

support parsing c99's static class for array size expressions.

Revision 1.213 / (download) - annotate - [select for diffs], Tue Apr 13 22:22:02 2021 UTC (21 months, 2 weeks ago) by christos
Branch: MAIN
Changes since 1.212: +6 -6 lines
Diff to previous 1.212 (colored)

Allow type attributes after function pointer parameters

Revision 1.212 / (download) - annotate - [select for diffs], Mon Apr 12 15:55:26 2021 UTC (21 months, 2 weeks ago) by christos
Branch: MAIN
Changes since 1.211: +9 -3 lines
Diff to previous 1.211 (colored)

Add attribute fallthrough

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

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

No functional change.

Revision 1.210 / (download) - annotate - [select for diffs], Fri Apr 2 11:53:25 2021 UTC (21 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.209: +3 -3 lines
Diff to previous 1.209 (colored)

lint: rename functions for duplicating types

No functional change.

Revision 1.209 / (download) - annotate - [select for diffs], Fri Apr 2 10:13:03 2021 UTC (21 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.208: +3 -3 lines
Diff to previous 1.208 (colored)

lint: name memory allocation functions consistently

No functional change.

Revision 1.208 / (download) - annotate - [select for diffs], Fri Apr 2 09:52:36 2021 UTC (21 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.207: +3 -3 lines
Diff to previous 1.207 (colored)

lint: rename getnode to expr_zalloc_tnode

The new name highlights that the returned memory is only valid in the
scope of the current expression.  This was misleading before since the
other related functions all have a 't' (probably for 'temporary') in
their names.

Also encode in the function name that the returned memory is zeroed out
as that could not be inferred from the old name.

No functional change.

Revision 1.207 / (download) - annotate - [select for diffs], Tue Mar 30 14:25:28 2021 UTC (22 months ago) by rillig
Branch: MAIN
Changes since 1.206: +3 -3 lines
Diff to previous 1.206 (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.206 / (download) - annotate - [select for diffs], Mon Mar 29 20:39:18 2021 UTC (22 months ago) by rillig
Branch: MAIN
Changes since 1.205: +2 -4 lines
Diff to previous 1.205 (colored)

lint: remove outdated comments, clean up style

No functional change.

Revision 1.205 / (download) - annotate - [select for diffs], Sun Mar 28 10:09:34 2021 UTC (22 months ago) by rillig
Branch: MAIN
Changes since 1.204: +5 -5 lines
Diff to previous 1.204 (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.204 / (download) - annotate - [select for diffs], Fri Mar 26 20:31:07 2021 UTC (22 months ago) by rillig
Branch: MAIN
Changes since 1.203: +4 -4 lines
Diff to previous 1.203 (colored)

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

No functional change.

Revision 1.203 / (download) - annotate - [select for diffs], Fri Mar 26 18:54:39 2021 UTC (22 months ago) by rillig
Branch: MAIN
Changes since 1.202: +4 -4 lines
Diff to previous 1.202 (colored)

lint: rename pushctrl and popctrl to be more expressive

While here, remove the magic number 0 that in this context means
"function body".

No functional change.

Revision 1.202 / (download) - annotate - [select for diffs], Fri Mar 26 17:44:52 2021 UTC (22 months ago) by rillig
Branch: MAIN
Changes since 1.201: +23 -23 lines
Diff to previous 1.201 (colored)

lint: rename pushdecl and popdecl to be more expressive

The previous names were highly ambiguous.  The 'decl' could have meant
'declaration', which would be the usual abbreviation.  It could also be
split into 'dec' and 'l', meaning 'declaration level', which would make
more sense in this particular context.

To avoid having to guess anything about these names, rename the
functions.  Instead of 'push' and 'pop', I renamed them to 'begin' and
'end' since these are the high-level operation that are of interest.
That the hierarchy of declaration levels is implemented as a stack is
nice to know but not as important to understand the whole situation.

No functional change.

Revision 1.201 / (download) - annotate - [select for diffs], Fri Mar 26 16:05:19 2021 UTC (22 months ago) by rillig
Branch: MAIN
Changes since 1.200: +3 -3 lines
Diff to previous 1.200 (colored)

lint: remove redundant '%prec' from grammar for compound literals

No change to the resulting binary.

Revision 1.200 / (download) - annotate - [select for diffs], Thu Mar 25 21:51:55 2021 UTC (22 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.199: +5 -5 lines
Diff to previous 1.199 (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.199 / (download) - annotate - [select for diffs], Tue Mar 23 20:57:40 2021 UTC (22 months, 1 week ago) by christos
Branch: MAIN
Changes since 1.198: +11 -3 lines
Diff to previous 1.198 (colored)

Add _Alignas()

Revision 1.198 / (download) - annotate - [select for diffs], Tue Mar 23 18:40:50 2021 UTC (22 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.197: +16 -14 lines
Diff to previous 1.197 (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.197 / (download) - annotate - [select for diffs], Tue Mar 23 17:36:55 2021 UTC (22 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.196: +7 -7 lines
Diff to previous 1.196 (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.196 / (download) - annotate - [select for diffs], Sun Mar 21 14:49:21 2021 UTC (22 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.195: +7 -7 lines
Diff to previous 1.195 (colored)

lint: rename functions for handling control statements

No functional change.

Revision 1.195 / (download) - annotate - [select for diffs], Sun Mar 21 10:25:40 2021 UTC (22 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.194: +6 -6 lines
Diff to previous 1.194 (colored)

lint: rename d_nedecl to d_nonempty_decl

No functional change.

Revision 1.194 / (download) - annotate - [select for diffs], Sun Mar 21 09:54:02 2021 UTC (22 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.193: +19 -19 lines
Diff to previous 1.193 (colored)

lint: rename declspecs to declaration_specifiers, just as in C99

No functional change.

Revision 1.193 / (download) - annotate - [select for diffs], Sun Mar 21 09:49:34 2021 UTC (22 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.192: +17 -9 lines
Diff to previous 1.192 (colored)

lint: rename grammar rule 'data_def' to 'top_level_declaration'

No functional change.

Revision 1.192 / (download) - annotate - [select for diffs], Sun Mar 21 09:22:35 2021 UTC (22 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.191: +7 -8 lines
Diff to previous 1.191 (colored)

lint: remove redundant '%prec' declarations from the grammar

No change to the generated binary.

Revision 1.191 / (download) - annotate - [select for diffs], Sun Mar 21 08:55:59 2021 UTC (22 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.190: +5 -5 lines
Diff to previous 1.190 (colored)

lint: rename token T_XOR to T_BITXOR

For symmetry with the operator, which is named BITXOR.

No functional change.

Revision 1.190 / (download) - annotate - [select for diffs], Sun Mar 21 08:52:05 2021 UTC (22 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.189: +12 -12 lines
Diff to previous 1.189 (colored)

lint: in debug output, use uniform file location references

This makes it easy to click on the location in the IDE instead of having
to manually parse the location and navigate to it.

No functional change outside debug mode.

Revision 1.189 / (download) - annotate - [select for diffs], Sun Mar 21 08:46:26 2021 UTC (22 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.188: +9 -10 lines
Diff to previous 1.188 (colored)

lint: remove redundant operator information from the grammar

Several tokens can only ever map to a single operator and thus do not
need to encode the operator.  Indeed, they already encoded it as NOOP,
and it was not used by any grammar rule.

No functional change.

Revision 1.188 / (download) - annotate - [select for diffs], Sat Mar 20 16:16:32 2021 UTC (22 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.187: +11 -11 lines
Diff to previous 1.187 (colored)

lint: rename ftflg to seen_fallthrough

One less abbreviation to remember when reading the code.

No functional change.

Revision 1.187 / (download) - annotate - [select for diffs], Sat Mar 20 16:11:12 2021 UTC (22 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.186: +29 -26 lines
Diff to previous 1.186 (colored)

lint: make the calls to clear_warning_flags stand out less

Even though clear_warning_flags and its companions are implemented as
macros, they act like ordinary functions.  Do not distract the reader by
using uppercase names for them.

No functional change.

Revision 1.186 / (download) - annotate - [select for diffs], Sat Mar 20 15:30:58 2021 UTC (22 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.185: +3 -15 lines
Diff to previous 1.185 (colored)

lint: clean up grammar for declaration after statement

No functional change.

Revision 1.185 / (download) - annotate - [select for diffs], Sat Mar 20 15:28:07 2021 UTC (22 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.184: +36 -20 lines
Diff to previous 1.184 (colored)

lint: fix check for declaration after statement in pre-C99 mode

The new code may not be the most beautiful, but it fixes all bugs that
occurred while testing message 327.  The grammar rules are taken from
C99 6.8.2, so it's no surprise they work well.

Revision 1.184 / (download) - annotate - [select for diffs], Sat Mar 20 14:17:56 2021 UTC (22 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.183: +3 -3 lines
Diff to previous 1.183 (colored)

lint: properly name C99 in message about declaration after statement

Now that C99 has been released and published, there is no reason anymore
to refer to it as C9X.

Revision 1.183 / (download) - annotate - [select for diffs], Sat Mar 20 13:53:28 2021 UTC (22 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.182: +34 -34 lines
Diff to previous 1.182 (colored)

lint: use proper boolean literals instead of 0/1

The code in the C grammar is generated by yacc and is not checked by
lint's strict bool mode, therefore the replacement was done manually.

No change to the resulting change.

Revision 1.182 / (download) - annotate - [select for diffs], Sat Mar 20 11:33:50 2021 UTC (22 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.181: +3 -3 lines
Diff to previous 1.181 (colored)

lint: remove unnecessary '%prec T_COMMA' from grammar

My previous commit message was wrong in saying that the '%prec' was
necessary.  It is not necessary.

Most probably I misspelled the name of the grammar rule as opt_comma
instead of comma_opt, which would lead to the same number of conflicts
in the grammar plus a warning, but no build failure.

Revision 1.181 / (download) - annotate - [select for diffs], Sat Mar 20 11:24:49 2021 UTC (22 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.180: +3 -4 lines
Diff to previous 1.180 (colored)

lint: join grammar rules for initialization

The '%prec T_COMMA' is necessary to avoid lots of parse errors in the
lint1 unit tests.  Curiously, further down in the grammar, for compound
literals, the '%prec T_COMMA' is not necessary, even though the context
looks very similar.

No functional change.

Revision 1.180 / (download) - annotate - [select for diffs], Sat Mar 20 11:05:16 2021 UTC (22 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.179: +15 -10 lines
Diff to previous 1.179 (colored)

lint: fix grammar for initialization

Previously, the grammar syntactically accepted the following code:

	int var = .member = 12345;

The designation '.member =' can only be used with brace-enclosed
initializers.

Revision 1.179 / (download) - annotate - [select for diffs], Sat Mar 20 10:32:43 2021 UTC (22 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.178: +17 -17 lines
Diff to previous 1.178 (colored)

lint: align rule names in grammar with C99

No functional change.

Revision 1.178 / (download) - annotate - [select for diffs], Fri Mar 19 07:54:13 2021 UTC (22 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.177: +5 -3 lines
Diff to previous 1.177 (colored)

lint: add reminder that C99 does not allow '{}' in initializer

No functional change.

Revision 1.177 / (download) - annotate - [select for diffs], Fri Mar 19 00:55:02 2021 UTC (22 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.176: +4 -4 lines
Diff to previous 1.176 (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.176 / (download) - annotate - [select for diffs], Wed Mar 17 15:45:30 2021 UTC (22 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.175: +4 -3 lines
Diff to previous 1.175 (colored)

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

No functional change outside debug mode.

Revision 1.175 / (download) - annotate - [select for diffs], Wed Mar 17 01:53:21 2021 UTC (22 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.174: +16 -95 lines
Diff to previous 1.174 (colored)

lint: move to_int_constant from the grammar to decl.c

This way, the code is covered by running 'make lint'.  The code from the
grammar is not covered, therefore it still uses int instead of bool in a
few places.

Inline the comparison functions for uint64_t.  These functions didn't
add any clarity to the code.

No functional change.

Revision 1.174 / (download) - annotate - [select for diffs], Wed Mar 17 01:38:31 2021 UTC (22 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.173: +12 -49 lines
Diff to previous 1.173 (colored)

lint: move main part of idecl over to decl.c and rename it

No functional change.

Revision 1.173 / (download) - annotate - [select for diffs], Wed Mar 17 01:22:55 2021 UTC (22 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.172: +4 -5 lines
Diff to previous 1.172 (colored)

lint: replace a call to LERROR with lint_assert

No functional change.

Revision 1.172 / (download) - annotate - [select for diffs], Wed Mar 17 01:19:50 2021 UTC (22 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.171: +19 -19 lines
Diff to previous 1.171 (colored)

lint: rename 'toicon' to 'to_int_constant'

No functional change.

Revision 1.171 / (download) - annotate - [select for diffs], Wed Mar 17 01:15:31 2021 UTC (22 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.170: +30 -30 lines
Diff to previous 1.170 (colored)

lint: rename 'blklev' to 'block_level'

No functional change.

Revision 1.170 / (download) - annotate - [select for diffs], Wed Mar 17 01:07:33 2021 UTC (22 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.169: +11 -11 lines
Diff to previous 1.169 (colored)

lint: rename 'parn' to 'paren' in the grammar

No functional change.

Revision 1.169 / (download) - annotate - [select for diffs], Sun Mar 7 20:06:48 2021 UTC (22 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.168: +4 -4 lines
Diff to previous 1.168 (colored)

lint: do not allow assignment-expression for constant-expression

It's a funny idea to do something like 'case a = 13:', but since any
compiler will reject this code, there is no point in lint supporting it.

No functional change since everywhere the grammar allows a constant
expression, there is no ambiguity where an assignment could be
interpreted differently.

Revision 1.168 / (download) - annotate - [select for diffs], Sun Mar 7 19:57:46 2021 UTC (22 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.167: +29 -29 lines
Diff to previous 1.167 (colored)

lint: rename grammar rule 'constant'

C99 6.4.4 already defines a grammar rule named 'constant' for an number
literal or an enum constant, so don't use that name for something else.

No functional change.

Revision 1.167 / (download) - annotate - [select for diffs], Sun Mar 7 19:46:18 2021 UTC (22 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.166: +7 -7 lines
Diff to previous 1.166 (colored)

lint: align names of C grammar rules with C99

No functional change.

Revision 1.166 / (download) - annotate - [select for diffs], Sun Mar 7 19:42:54 2021 UTC (22 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.165: +4 -2 lines
Diff to previous 1.165 (colored)

lint: in strict C mode, warn about initialization with '[a ... b]'

https://gcc.gnu.org/onlinedocs/gcc/Case-Ranges.html

Revision 1.165 / (download) - annotate - [select for diffs], Sun Mar 7 18:02:45 2021 UTC (22 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.164: +3 -3 lines
Diff to previous 1.164 (colored)

lint: fix off-by-one error in 'case 3...5'

According to the GCC documentation[1], the high end of the range is
inclusive as well, which makes sense since otherwise there would be no
way of specifying a range that includes the maximum representable
number.

Since the range is not used at all in the code, none of the tests could
possibly fail.

[1] https://gcc.gnu.org/onlinedocs/gcc/Case-Ranges.html

No functional change.

Revision 1.164 / (download) - annotate - [select for diffs], Sun Mar 7 17:57:52 2021 UTC (22 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.163: +5 -11 lines
Diff to previous 1.163 (colored)

lint: inline 'case 3...5' in grammar

There was no point in having a separate grammar rule for the '3...' part
of a range expression, it just made the code more complicated than
necessary.

No functional change.

Revision 1.163 / (download) - annotate - [select for diffs], Sat Feb 20 16:03:56 2021 UTC (23 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.162: +3 -3 lines
Diff to previous 1.162 (colored)

lint: rename mkinit to init_using_expr

No functional change outside debug mode.

Revision 1.162 / (download) - annotate - [select for diffs], Fri Feb 19 22:35:42 2021 UTC (23 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.161: +4 -4 lines
Diff to previous 1.161 (colored)

lint: rename storage class constants to be more expressive

No functional change.

Revision 1.161 / (download) - annotate - [select for diffs], Fri Feb 19 22:16:12 2021 UTC (23 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.160: +4 -4 lines
Diff to previous 1.160 (colored)

lint: rename str_t and its members to be more expressive

No functional change.

Revision 1.160 / (download) - annotate - [select for diffs], Sun Jan 31 12:44:34 2021 UTC (23 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.159: +4 -4 lines
Diff to previous 1.159 (colored)

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

Revision 1.159 / (download) - annotate - [select for diffs], Sun Jan 31 11:23:01 2021 UTC (23 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.158: +4 -4 lines
Diff to previous 1.158 (colored)

lint: add quotes to messages 1 and 19

Revision 1.158 / (download) - annotate - [select for diffs], Sun Jan 31 09:26:27 2021 UTC (23 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.157: +6 -10 lines
Diff to previous 1.157 (colored)

lint: be more precise in message 003 "tag in argument list"

Revision 1.157 / (download) - annotate - [select for diffs], Mon Jan 18 19:24:09 2021 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.156: +4 -3 lines
Diff to previous 1.156 (colored)

lint: clean up member names of control_structure and comments

Revision 1.156 / (download) - annotate - [select for diffs], Mon Jan 18 18:53:28 2021 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.155: +5 -5 lines
Diff to previous 1.155 (colored)

lint: rename grammar rule lorange

It looked too much like an orange.

Revision 1.155 / (download) - annotate - [select for diffs], Mon Jan 18 18:18:20 2021 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.154: +26 -26 lines
Diff to previous 1.154 (colored)

lint: rename grammar rules to align with C99 6.7.6

Revision 1.154 / (download) - annotate - [select for diffs], Mon Jan 18 18:14:57 2021 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.153: +3 -3 lines
Diff to previous 1.153 (colored)

lint: fix precedence of __builtin_offsetof

A previous version of the C grammar contained TBUILTIN_SIZEOF in this
place, which had two typos.  Therefore it was handled as a separate
token that was otherwise ignored.  Curiously, bison didn't warn about
this obvious inconsistency.

Revision 1.153 / (download) - annotate - [select for diffs], Mon Jan 18 17:59:51 2021 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.152: +12 -14 lines
Diff to previous 1.152 (colored)

lint: sort tokens in grammar

Revision 1.152 / (download) - annotate - [select for diffs], Mon Jan 18 17:54:50 2021 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.151: +9 -6 lines
Diff to previous 1.151 (colored)

lint: rename T_SOU to T_STRUCT_OR_UNION

This abbreviation occurred too seldom to be used.

Revision 1.151 / (download) - annotate - [select for diffs], Mon Jan 18 17:47:44 2021 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.150: +5 -3 lines
Diff to previous 1.150 (colored)

lint: don't treat restrict and _Thread_local as volatile anymore

Revision 1.150 / (download) - annotate - [select for diffs], Mon Jan 18 17:20:15 2021 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.149: +29 -29 lines
Diff to previous 1.149 (colored)

lint: align token names with the wording from C99

Revision 1.149 / (download) - annotate - [select for diffs], Mon Jan 18 16:47:46 2021 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.148: +3 -4 lines
Diff to previous 1.148 (colored)

lint: replace abort with lint_assert

Revision 1.148 / (download) - annotate - [select for diffs], Mon Jan 18 16:41:57 2021 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.147: +41 -40 lines
Diff to previous 1.147 (colored)

lint: expand abbreviations in function names

Revision 1.147 / (download) - annotate - [select for diffs], Mon Jan 18 16:34:08 2021 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.146: +7 -7 lines
Diff to previous 1.146 (colored)

lint: rename T_ELLIPSE to T_ELLIPSIS

The 3 dots have nothing to do with geometry.

Revision 1.146 / (download) - annotate - [select for diffs], Mon Jan 18 16:29:59 2021 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.145: +6 -6 lines
Diff to previous 1.145 (colored)

lint: rename T_STROP to T_MEMBACC

The 'STR' was misleading since it is the abbreviation for 'string' in
many other programs.  Member access not only happens in structs, it also
happens in unions.

Revision 1.145 / (download) - annotate - [select for diffs], Sun Jan 17 15:09:56 2021 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.144: +6 -6 lines
Diff to previous 1.144 (colored)

lint: rename T_AND to T_AMPER

When parsing a text into a C program, the character '&' does not yet
mean 'bitwise and', it could also be the address operator.

Revision 1.144 / (download) - annotate - [select for diffs], Sun Jan 17 15:06:54 2021 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.143: +5 -5 lines
Diff to previous 1.143 (colored)

lint: rename bitwise operators

When there are several variants of the AND operator, both of them should
get a distinguishing prefix, otherwise it's not clear which of the two
possible operators is meant by the plain AND.

Revision 1.143 / (download) - annotate - [select for diffs], Sun Jan 17 14:55:22 2021 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.142: +4 -4 lines
Diff to previous 1.142 (colored)

lint: rename operator STAR to INDIR

C99 calls this operator the "indirection operator".  The word "star"
does not occur in the index of that standard.

Revision 1.142 / (download) - annotate - [select for diffs], Sun Jan 17 14:50:11 2021 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.141: +3 -3 lines
Diff to previous 1.141 (colored)

lint: rename operator AMPER to ADDR

There is no operator called 'ampersand'.  The ampersand sign is merely
the textual representation of both the operator ADDR and the operator
BITAND.

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

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

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

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

Revision 1.140 / (download) - annotate - [select for diffs], Sat Jan 16 02:40:02 2021 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.139: +22 -22 lines
Diff to previous 1.139 (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.139 / (download) - annotate - [select for diffs], Tue Jan 12 20:42:01 2021 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.138: +9 -2 lines
Diff to previous 1.138 (colored)

lint: add new check for strict bool mode

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

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

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

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

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

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

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

Revision 1.138 / (download) - annotate - [select for diffs], Sun Jan 10 14:07:34 2021 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.137: +10 -10 lines
Diff to previous 1.137 (colored)

lint: rename functions with short names

Revision 1.137 / (download) - annotate - [select for diffs], Sun Jan 10 00:05:46 2021 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.136: +3 -3 lines
Diff to previous 1.136 (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.136 / (download) - annotate - [select for diffs], Sat Jan 9 14:10:15 2021 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.135: +3 -3 lines
Diff to previous 1.135 (colored)

lint: make target platform independent of host platform

If lint is run on a platform that has CHAR_BIT == 10, this doesn't
magically make an ILP32 platform have 40 bits per uint32_t.

At the moment, all of the supported platforms are either ILP32 or
I32LP64 anyway, and all of them have CHAR_BIT == 8 == CHAR_SIZE,
so nothing changes practically.

Revision 1.135 / (download) - annotate - [select for diffs], Sat Jan 9 13:12:13 2021 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.134: +8 -8 lines
Diff to previous 1.134 (colored)

lint: rename ename to enumeration_constant

Revision 1.134 / (download) - annotate - [select for diffs], Sat Jan 9 03:28:47 2021 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.133: +16 -16 lines
Diff to previous 1.133 (colored)

lint: align grammar rules with C99

Revision 1.133 / (download) - annotate - [select for diffs], Sat Jan 9 03:08:54 2021 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.132: +56 -54 lines
Diff to previous 1.132 (colored)

lint: expand abbreviations in grammar rules

stmnt -> statement
comp -> compound

The abbreviation "stmnt" was non-standard, and "comp" was ambiguous
since it is used for "comparison" as well.

Revision 1.132 / (download) - annotate - [select for diffs], Sat Jan 9 02:38:27 2021 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.131: +8 -7 lines
Diff to previous 1.131 (colored)

lint: rename T_MULT to T_ASTERISK

In the early phase of lexical analysis, the '*' does not mean
multiplication, therefore its name should not suggest that.  It is only
an asterisk, and depending on the surrounding context, it will only
later turn into a pointer dereference or a multiplication.

The call operator(T_MULT, MULT) was misleading since the MULT was not
used at all.

Revision 1.131 / (download) - annotate - [select for diffs], Tue Jan 5 00:02:52 2021 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.130: +3 -3 lines
Diff to previous 1.130 (colored)

lint: remove unused TBUILTIN_SIZEOF from the C grammar

This token is not generated by the lexer, and it was misspelled anyway.
All other token names start with "T_", this one was missing the
underscore.

Revision 1.130 / (download) - annotate - [select for diffs], Sun Jan 3 21:33:50 2021 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.129: +22 -22 lines
Diff to previous 1.129 (colored)

lint: use consistent indentation for C grammar

Revision 1.129 / (download) - annotate - [select for diffs], Sun Jan 3 20:38:26 2021 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.128: +6 -6 lines
Diff to previous 1.128 (colored)

lint: rename funcarg and funccall to longer names

From the previous short names, it was no obvious that these functions
create a new tree node.

The function named funccall in lint2 has been left as-is, since it has a
completely different prototype.

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

lint: rename functions that create nodes

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

lint: add missing redundant messages in source code

Revision 1.126 / (download) - annotate - [select for diffs], Fri Jan 1 11:09:40 2021 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.125: +63 -63 lines
Diff to previous 1.125 (colored)

lint: rename tokens for left and right parentheses

Revision 1.125 / (download) - annotate - [select for diffs], Fri Jan 1 10:55:27 2021 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.124: +6 -6 lines
Diff to previous 1.124 (colored)

lint: split label handling into separate functions

The only thing these cases have in common is the name "label" and the
"reached = 1" assignment.  That's not reason enough to combine
completely unrelated functions.

Revision 1.124 / (download) - annotate - [select for diffs], Fri Jan 1 09:28:22 2021 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.123: +3 -4 lines
Diff to previous 1.123 (colored)

lint: replace simple LERROR with lint_assert

Revision 1.123 / (download) - annotate - [select for diffs], Fri Jan 1 01:26:02 2021 UTC (2 years ago) by rillig
Branch: MAIN
Changes since 1.122: +13 -13 lines
Diff to previous 1.122 (colored)

lint: align comments with actual message, in the lexer and parser

Revision 1.122 / (download) - annotate - [select for diffs], Wed Dec 30 13:17:42 2020 UTC (2 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.121: +4 -3 lines
Diff to previous 1.121 (colored)

lint: split cluparg into separate functions

That function did more than its short name could express, and the things
it did were not related in any way.

Revision 1.121 / (download) - annotate - [select for diffs], Wed Dec 30 10:56:51 2020 UTC (2 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.120: +7 -7 lines
Diff to previous 1.120 (colored)

lint: un-abbreviate parenthesized and _strg

Revision 1.120 / (download) - annotate - [select for diffs], Wed Dec 30 10:35:38 2020 UTC (2 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.119: +10 -10 lines
Diff to previous 1.119 (colored)

lint: rename symt_t constants

There's no need to abbreviate them, furthermore FMOS was imprecise.

Revision 1.119 / (download) - annotate - [select for diffs], Wed Dec 30 10:26:12 2020 UTC (2 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.118: +3 -3 lines
Diff to previous 1.118 (colored)

lint: rename s_nxt to s_next

Revision 1.118 / (download) - annotate - [select for diffs], Wed Dec 30 01:44:32 2020 UTC (2 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.117: +4 -4 lines
Diff to previous 1.117 (colored)

lint: reduce nesting of function calls

Revision 1.117 / (download) - annotate - [select for diffs], Wed Dec 30 01:02:38 2020 UTC (2 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.116: +11 -3 lines
Diff to previous 1.116 (colored)

lint: add debug logging to the parser

Even with -DDEBUG and -DYYDEBUG, the debug output is not detailed enough
to clearly see what happens.

Add some custom debug logging to the parser, mainly for demonstration
purposes, and also to find out how to fix the test d_struct_init_nested.

Revision 1.116 / (download) - annotate - [select for diffs], Tue Dec 29 17:29:31 2020 UTC (2 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.115: +6 -6 lines
Diff to previous 1.115 (colored)

lint: split complete_tag into separate functions

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

lint: rename functions for handling the initialization stack

Revision 1.114 / (download) - annotate - [select for diffs], Tue Dec 29 13:33:03 2020 UTC (2 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.113: +46 -39 lines
Diff to previous 1.113 (colored)

lint: rename functions with very short names

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

lint: fix indentation and alignment that used space-tab

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

lint: remove redundant parentheses around return value

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

lint: rename functions that had very short names

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

Revision 1.110 / (download) - annotate - [select for diffs], Mon Dec 28 21:24:55 2020 UTC (2 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.109: +13 -13 lines
Diff to previous 1.109 (colored)

lint: spell check

Revision 1.109 / (download) - annotate - [select for diffs], Mon Dec 28 19:47:42 2020 UTC (2 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.108: +10 -10 lines
Diff to previous 1.108 (colored)

lint: remove trailing whitespace

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

lint: sort includes

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

lint: rename tspec macros

Revision 1.106 / (download) - annotate - [select for diffs], Fri Dec 4 17:56:04 2020 UTC (2 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.105: +3 -2 lines
Diff to previous 1.105 (colored)

__sentinel__ = __sentinel__(0)

Revision 1.105 / (download) - annotate - [select for diffs], Fri Sep 18 14:19:08 2020 UTC (2 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.104: +4 -2 lines
Diff to previous 1.104 (colored)

add optimize attribute

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

Sync with HEAD

Revision 1.104 / (download) - annotate - [select for diffs], Mon Mar 4 17:45:16 2019 UTC (3 years, 10 months ago) by christos
Branch: MAIN
CVS Tags: phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, phil-wifi-20191119, phil-wifi-20190609, netbsd-9-base, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9, is-mlppp-base, is-mlppp
Changes since 1.103: +4 -2 lines
Diff to previous 1.103 (colored)

Add __thread/tls_model attribute

Revision 1.103 / (download) - annotate - [select for diffs], Mon Mar 4 15:28:18 2019 UTC (3 years, 10 months ago) by christos
Branch: MAIN
Changes since 1.102: +3 -2 lines
Diff to previous 1.102 (colored)

add a two argument version of alloc_size

Revision 1.102 / (download) - annotate - [select for diffs], Mon Mar 4 15:26:18 2019 UTC (3 years, 10 months ago) by christos
Branch: MAIN
Changes since 1.101: +5 -3 lines
Diff to previous 1.101 (colored)

add gnu_printf

Revision 1.101 / (download) - annotate - [select for diffs], Sun Mar 3 23:06:08 2019 UTC (3 years, 10 months ago) by christos
Branch: MAIN
Changes since 1.100: +8 -2 lines
Diff to previous 1.100 (colored)

Add more gnu attributes

Revision 1.95.2.4 / (download) - annotate - [select for diffs], Fri Jan 18 08:51:02 2019 UTC (4 years ago) by pgoyette
Branch: pgoyette-compat
CVS Tags: pgoyette-compat-merge-20190127
Changes since 1.95.2.3: +4 -2 lines
Diff to previous 1.95.2.3 (colored) to branchpoint 1.95 (colored) next main 1.96 (colored)

Synch with HEAD

Revision 1.100 / (download) - annotate - [select for diffs], Fri Jan 4 18:51:23 2019 UTC (4 years ago) by christos
Branch: MAIN
CVS Tags: pgoyette-compat-20190127, pgoyette-compat-20190118
Changes since 1.99: +4 -2 lines
Diff to previous 1.99 (colored)

recognize destructor attribute.

Revision 1.95.2.3 / (download) - annotate - [select for diffs], Mon Nov 26 01:52:54 2018 UTC (4 years, 2 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.95.2.2: +4 -2 lines
Diff to previous 1.95.2.2 (colored) to branchpoint 1.95 (colored)

Sync with HEAD, resolve a couple of conflicts

Revision 1.99 / (download) - annotate - [select for diffs], Sat Nov 24 13:10:20 2018 UTC (4 years, 2 months ago) by christos
Branch: MAIN
CVS Tags: pgoyette-compat-1226, pgoyette-compat-1126
Changes since 1.98: +4 -2 lines
Diff to previous 1.98 (colored)

add warn_unused_result.

Revision 1.95.2.2 / (download) - annotate - [select for diffs], Thu Sep 6 06:56:50 2018 UTC (4 years, 4 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.95.2.1: +4 -2 lines
Diff to previous 1.95.2.1 (colored) to branchpoint 1.95 (colored)

Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)

Revision 1.98 / (download) - annotate - [select for diffs], Mon Sep 3 15:16:33 2018 UTC (4 years, 4 months ago) by christos
Branch: MAIN
CVS Tags: pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906
Changes since 1.97: +4 -2 lines
Diff to previous 1.97 (colored)

support deprecated("string") for libpcap

Revision 1.95.2.1 / (download) - annotate - [select for diffs], Sat Jul 28 04:38:14 2018 UTC (4 years, 6 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.95: +6 -2 lines
Diff to previous 1.95 (colored)

Sync with HEAD

Revision 1.97 / (download) - annotate - [select for diffs], Sun Jul 8 17:48:42 2018 UTC (4 years, 6 months ago) by christos
Branch: MAIN
CVS Tags: pgoyette-compat-0728
Changes since 1.96: +4 -2 lines
Diff to previous 1.96 (colored)

recognize noinline attribute

Revision 1.96 / (download) - annotate - [select for diffs], Fri Jun 29 20:18:36 2018 UTC (4 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.95: +4 -2 lines
Diff to previous 1.95 (colored)

Add our syslog format.

Revision 1.95 / (download) - annotate - [select for diffs], Mon Jan 15 21:58:54 2018 UTC (5 years ago) by christos
Branch: MAIN
CVS Tags: phil-wifi-base, pgoyette-compat-base, 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
Branch point for: phil-wifi, pgoyette-compat
Changes since 1.94: +6 -3 lines
Diff to previous 1.94 (colored)

Add a _Noreturn token

Revision 1.92.2.1 / (download) - annotate - [select for diffs], Fri Apr 21 16:54:16 2017 UTC (5 years, 9 months ago) by bouyer
Branch: bouyer-socketcan
Changes since 1.92: +14 -5 lines
Diff to previous 1.92 (colored) next main 1.93 (colored)

Sync with HEAD

Revision 1.76.2.4 / (download) - annotate - [select for diffs], Mon Mar 20 06:58:06 2017 UTC (5 years, 10 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.76.2.3: +16 -5 lines
Diff to previous 1.76.2.3 (colored) to branchpoint 1.76 (colored) next main 1.77 (colored)

Sync with HEAD

Revision 1.94 / (download) - annotate - [select for diffs], Mon Mar 6 21:01:39 2017 UTC (5 years, 10 months ago) by christos
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, pgoyette-localcount-20170426, pgoyette-localcount-20170320, perseant-stdc-iso10646-base, perseant-stdc-iso10646, netbsd-8-base, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, netbsd-8, matt-nb8-mediatek-base, matt-nb8-mediatek, bouyer-socketcan-base1
Changes since 1.93: +13 -7 lines
Diff to previous 1.93 (colored)

fix typeof, add __builtin_offsetof

Revision 1.93 / (download) - annotate - [select for diffs], Mon Mar 6 11:58:31 2017 UTC (5 years, 10 months ago) by christos
Branch: MAIN
Changes since 1.92: +7 -4 lines
Diff to previous 1.92 (colored)

handle typeof in casts

Revision 1.92 / (download) - annotate - [select for diffs], Sat Jan 7 18:28:49 2017 UTC (6 years ago) by christos
Branch: MAIN
CVS Tags: bouyer-socketcan-base
Branch point for: bouyer-socketcan
Changes since 1.91: +4 -2 lines
Diff to previous 1.91 (colored)

add pcs

Revision 1.76.2.3 / (download) - annotate - [select for diffs], Sat Jan 7 08:56:59 2017 UTC (6 years ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.76.2.2: +97 -27 lines
Diff to previous 1.76.2.2 (colored) to branchpoint 1.76 (colored)

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

Revision 1.91 / (download) - annotate - [select for diffs], Fri Dec 30 19:53:08 2016 UTC (6 years, 1 month ago) by christos
Branch: MAIN
CVS Tags: pgoyette-localcount-20170107
Changes since 1.90: +14 -10 lines
Diff to previous 1.90 (colored)

- add buffer bounded attribute
- allow empty attributes

Revision 1.90 / (download) - annotate - [select for diffs], Fri Dec 30 03:36:51 2016 UTC (6 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.89: +4 -5 lines
Diff to previous 1.89 (colored)

sort, kill typo

Revision 1.89 / (download) - annotate - [select for diffs], Fri Dec 30 02:16:36 2016 UTC (6 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.88: +11 -4 lines
Diff to previous 1.88 (colored)

add bounded, fix nonnull

Revision 1.88 / (download) - annotate - [select for diffs], Thu Dec 29 23:54:29 2016 UTC (6 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.87: +4 -2 lines
Diff to previous 1.87 (colored)

handle __ symbols differently (so we don't duplicate entries in the table)
and add non_null.

Revision 1.87 / (download) - annotate - [select for diffs], Thu Dec 29 19:40:21 2016 UTC (6 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.86: +13 -8 lines
Diff to previous 1.86 (colored)

allow cascaded attributes

Revision 1.86 / (download) - annotate - [select for diffs], Thu Dec 29 18:44:49 2016 UTC (6 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.85: +4 -2 lines
Diff to previous 1.85 (colored)

Add alias attribute

Revision 1.85 / (download) - annotate - [select for diffs], Thu Dec 29 18:37:32 2016 UTC (6 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.84: +4 -2 lines
Diff to previous 1.84 (colored)

Add always_inline

Revision 1.84 / (download) - annotate - [select for diffs], Thu Dec 29 16:41:16 2016 UTC (6 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.83: +32 -13 lines
Diff to previous 1.83 (colored)

Add more attributes.

Revision 1.83 / (download) - annotate - [select for diffs], Thu Dec 29 16:01:46 2016 UTC (6 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.82: +14 -7 lines
Diff to previous 1.82 (colored)

accept optional type attributes after struct/union members

Revision 1.82 / (download) - annotate - [select for diffs], Tue Dec 27 21:52:35 2016 UTC (6 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.81: +5 -3 lines
Diff to previous 1.81 (colored)

teach lint __attribute__((__unused__))

Revision 1.81 / (download) - annotate - [select for diffs], Sat Nov 5 01:09:30 2016 UTC (6 years, 2 months ago) by christos
Branch: MAIN
Changes since 1.80: +23 -2 lines
Diff to previous 1.80 (colored)

Add _Generic C11 support.

Revision 1.80 / (download) - annotate - [select for diffs], Fri Aug 19 10:58:15 2016 UTC (6 years, 5 months ago) by christos
Branch: MAIN
CVS Tags: pgoyette-localcount-20161104, localcount-20160914
Changes since 1.79: +3 -3 lines
Diff to previous 1.79 (colored)

be less aggressive in clearing blocks to protect against:

int
main(int argc, char *argv[])
{
	int rv;

	if ((rv = ({ int _ret = 1; if (argc == 1) {} _ret; })) != 0)
	    printf("%d\n", rv);
	return 0;
}

Revision 1.76.2.2 / (download) - annotate - [select for diffs], Sat Aug 6 00:19:12 2016 UTC (6 years, 5 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.76.2.1: +11 -8 lines
Diff to previous 1.76.2.1 (colored) to branchpoint 1.76 (colored)

Sync with HEAD

Revision 1.79 / (download) - annotate - [select for diffs], Sun Jul 31 22:38:04 2016 UTC (6 years, 6 months ago) by dholland
Branch: MAIN
CVS Tags: pgoyette-localcount-20160806
Changes since 1.78: +11 -8 lines
Diff to previous 1.78 (colored)

Don't allow initializers of the form { .a = .b = expr } as this is not
valid. Helps a bit with PR 22500.

Revision 1.76.2.1 / (download) - annotate - [select for diffs], Tue Jul 26 03:24:24 2016 UTC (6 years, 6 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.76: +10 -5 lines
Diff to previous 1.76 (colored)

Sync with HEAD

Revision 1.78 / (download) - annotate - [select for diffs], Wed Jul 20 18:14:12 2016 UTC (6 years, 6 months ago) by christos
Branch: MAIN
CVS Tags: pgoyette-localcount-20160726
Changes since 1.77: +6 -3 lines
Diff to previous 1.77 (colored)

accept attributes in param decls

Revision 1.77 / (download) - annotate - [select for diffs], Wed Jul 20 17:42:14 2016 UTC (6 years, 6 months ago) by christos
Branch: MAIN
Changes since 1.76: +6 -4 lines
Diff to previous 1.76 (colored)

handle "extern __attribute__((__gnu_inline__)) __inline"

Revision 1.76 / (download) - annotate - [select for diffs], Sat Feb 27 21:37:14 2016 UTC (6 years, 11 months ago) by christos
Branch: MAIN
CVS Tags: pgoyette-localcount-base
Branch point for: pgoyette-localcount
Changes since 1.75: +6 -2 lines
Diff to previous 1.75 (colored)

Add visibility and weak

Revision 1.75 / (download) - annotate - [select for diffs], Sat Jan 2 17:44:33 2016 UTC (7 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.74: +18 -8 lines
Diff to previous 1.74 (colored)

Handle function symbol renames.

Revision 1.74 / (download) - annotate - [select for diffs], Tue Oct 13 20:49:39 2015 UTC (7 years, 3 months ago) by christos
Branch: MAIN
Changes since 1.73: +4 -4 lines
Diff to previous 1.73 (colored)

the next symbol should be a type.

Revision 1.73 / (download) - annotate - [select for diffs], Tue Oct 13 20:25:21 2015 UTC (7 years, 3 months ago) by christos
Branch: MAIN
Changes since 1.72: +22 -6 lines
Diff to previous 1.72 (colored)

handle anonymous struct/union members.

Revision 1.72 / (download) - annotate - [select for diffs], Tue Oct 13 16:09:33 2015 UTC (7 years, 3 months ago) by christos
Branch: MAIN
Changes since 1.71: +4 -4 lines
Diff to previous 1.71 (colored)

more descriptive aborts

Revision 1.71 / (download) - annotate - [select for diffs], Tue Jul 28 17:56:56 2015 UTC (7 years, 6 months ago) by christos
Branch: MAIN
Changes since 1.70: +14 -5 lines
Diff to previous 1.70 (colored)

handle c99 nested struct initialization { .data.foo[0] = 1 }

Revision 1.70 / (download) - annotate - [select for diffs], Wed Jul 1 15:34:30 2015 UTC (7 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.69: +5 -3 lines
Diff to previous 1.69 (colored)

Fix segmentation fault caused by freeing prematurely function parameter types
inside cast expressions.

Revision 1.69 / (download) - annotate - [select for diffs], Mon May 11 17:20:06 2015 UTC (7 years, 8 months ago) by christos
Branch: MAIN
Changes since 1.68: +6 -6 lines
Diff to previous 1.68 (colored)

handle compound literals with a trailing comma

Revision 1.68 / (download) - annotate - [select for diffs], Fri Apr 3 21:40:04 2015 UTC (7 years, 10 months ago) by christos
Branch: MAIN
Changes since 1.67: +4 -4 lines
Diff to previous 1.67 (colored)

accept typenames in param decls.

Revision 1.67 / (download) - annotate - [select for diffs], Fri Sep 26 15:26:01 2014 UTC (8 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.66: +6 -6 lines
Diff to previous 1.66 (colored)

oops I terminated the block too early (thanks unit tests!)

Revision 1.66 / (download) - annotate - [select for diffs], Fri Sep 26 01:20:00 2014 UTC (8 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.65: +16 -6 lines
Diff to previous 1.65 (colored)

make for introduce a new block level for c99 decls.

Revision 1.54.2.2 / (download) - annotate - [select for diffs], Wed Aug 20 00:05:06 2014 UTC (8 years, 5 months ago) by tls
Branch: tls-maxphys
Changes since 1.54.2.1: +62 -12 lines
Diff to previous 1.54.2.1 (colored) to branchpoint 1.54 (colored) next main 1.55 (colored)

Rebase to HEAD as of a few days ago.

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

Rebase.

Revision 1.50.2.2 / (download) - annotate - [select for diffs], Thu May 22 11:42:52 2014 UTC (8 years, 8 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.50.2.1: +77 -27 lines
Diff to previous 1.50.2.1 (colored) to branchpoint 1.50 (colored) next main 1.51 (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.65 / (download) - annotate - [select for diffs], Mon Apr 21 21:52:24 2014 UTC (8 years, 9 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.64: +10 -4 lines
Diff to previous 1.64 (colored)

add more attributes

Revision 1.64 / (download) - annotate - [select for diffs], Mon Apr 21 18:57:20 2014 UTC (8 years, 9 months ago) by christos
Branch: MAIN
Changes since 1.63: +9 -9 lines
Diff to previous 1.63 (colored)

add asm function renames

Revision 1.63 / (download) - annotate - [select for diffs], Fri Apr 18 21:54:52 2014 UTC (8 years, 9 months ago) by christos
Branch: MAIN
Changes since 1.62: +14 -3 lines
Diff to previous 1.62 (colored)

add more places where attribute is valid.

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

handle constant attribute

Revision 1.61 / (download) - annotate - [select for diffs], Fri Apr 18 00:23:46 2014 UTC (8 years, 9 months ago) by christos
Branch: MAIN
Changes since 1.60: +23 -3 lines
Diff to previous 1.60 (colored)

Handle the rest of gcc __attribute__ s.

Revision 1.60 / (download) - annotate - [select for diffs], Thu Apr 17 17:29:24 2014 UTC (8 years, 9 months ago) by christos
Branch: MAIN
Changes since 1.59: +8 -8 lines
Diff to previous 1.59 (colored)

typeof and extension don't need parens

Revision 1.59 / (download) - annotate - [select for diffs], Sun Mar 23 04:58:16 2014 UTC (8 years, 10 months ago) by dholland
Branch: MAIN
CVS Tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15
Branch point for: tls-earlyentropy
Changes since 1.58: +3 -3 lines
Diff to previous 1.58 (colored)

typo in comment

Revision 1.58 / (download) - annotate - [select for diffs], Tue Feb 18 22:01:36 2014 UTC (8 years, 11 months ago) by christos
Branch: MAIN
CVS Tags: riastradh-drm2-base3
Changes since 1.57: +10 -2 lines
Diff to previous 1.57 (colored)

add __extension__ and typeof

Revision 1.57 / (download) - annotate - [select for diffs], Tue Feb 4 08:08:59 2014 UTC (8 years, 11 months ago) by njoly
Branch: MAIN
Changes since 1.56: +3 -3 lines
Diff to previous 1.56 (colored)

Handle another declaration after statement case for lint in c99 mode.
Add the corresponding testcase.

Revision 1.56 / (download) - annotate - [select for diffs], Thu Jan 16 00:43:43 2014 UTC (9 years ago) by christos
Branch: MAIN
Changes since 1.55: +3 -2 lines
Diff to previous 1.55 (colored)

empty init_decl {} is valid

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

resync from head

Revision 1.55 / (download) - annotate - [select for diffs], Fri Apr 19 17:43:05 2013 UTC (9 years, 9 months ago) by christos
Branch: MAIN
CVS Tags: riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2
Changes since 1.54: +15 -15 lines
Diff to previous 1.54 (colored)

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

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

sync with head

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

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

Revision 1.53 / (download) - annotate - [select for diffs], Sun Dec 25 20:11:22 2011 UTC (11 years, 1 month ago) by christos
Branch: MAIN
CVS Tags: netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, netbsd-6, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus
Changes since 1.52: +3 -5 lines
Diff to previous 1.52 (colored)

fix the grammar conflict differently.

Revision 1.52 / (download) - annotate - [select for diffs], Sun Dec 25 01:05:03 2011 UTC (11 years, 1 month ago) by christos
Branch: MAIN
Changes since 1.51: +5 -3 lines
Diff to previous 1.51 (colored)

PR/45666: Nicolas Joly: lint(1) wrong 'syntax error' message

Revision 1.51 / (download) - annotate - [select for diffs], Mon Dec 19 16:52:27 2011 UTC (11 years, 1 month ago) by njoly
Branch: MAIN
Changes since 1.50: +3 -3 lines
Diff to previous 1.50 (colored)

c99: do not warn about trailing comma in enum declaration.

Revision 1.50 / (download) - annotate - [select for diffs], Tue Oct 4 16:19:59 2011 UTC (11 years, 3 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base
Branch point for: yamt-pagecache
Changes since 1.49: +17 -11 lines
Diff to previous 1.49 (colored)

Handle c99 declarations in the middle of blocks.

Revision 1.49 / (download) - annotate - [select for diffs], Tue Feb 9 23:05:16 2010 UTC (12 years, 11 months ago) by wiz
Branch: MAIN
CVS Tags: matt-mips64-premerge-20101231, cherry-xenmp-base, cherry-xenmp, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2
Changes since 1.48: +3 -3 lines
Diff to previous 1.48 (colored)

Fix typo in comment.

Revision 1.48 / (download) - annotate - [select for diffs], Sat Oct 3 17:09:18 2009 UTC (13 years, 4 months ago) by christos
Branch: MAIN
CVS Tags: matt-premerge-20091211
Changes since 1.47: +6 -3 lines
Diff to previous 1.47 (colored)

add type attributes in a few more places.

Revision 1.47 / (download) - annotate - [select for diffs], Sat Oct 3 01:35:20 2009 UTC (13 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.46: +3 -2 lines
Diff to previous 1.46 (colored)

accept struct { ... } __packed name;

Revision 1.46 / (download) - annotate - [select for diffs], Fri Oct 2 19:01:13 2009 UTC (13 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.45: +4 -3 lines
Diff to previous 1.45 (colored)

recognize struct __packed x { }; in addition to struct x { } __packed;

Revision 1.45 / (download) - annotate - [select for diffs], Fri Oct 2 15:03:45 2009 UTC (13 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.44: +35 -2 lines
Diff to previous 1.44 (colored)

understand __attribute__((__packed__)) and __packed.

Revision 1.42.2.1 / (download) - annotate - [select for diffs], Wed May 13 19:20:13 2009 UTC (13 years, 8 months ago) by jym
Branch: jym-xensuspend
Changes since 1.42: +15 -5 lines
Diff to previous 1.42 (colored) next main 1.43 (colored)

Sync with HEAD.

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

Revision 1.44 / (download) - annotate - [select for diffs], Sat May 2 16:10:49 2009 UTC (13 years, 9 months ago) by christos
Branch: MAIN
CVS Tags: jym-xensuspend-nbase, jym-xensuspend-base
Changes since 1.43: +7 -3 lines
Diff to previous 1.43 (colored)

Add __alignof__.

Revision 1.43 / (download) - annotate - [select for diffs], Fri May 1 22:03:36 2009 UTC (13 years, 9 months ago) by christos
Branch: MAIN
Changes since 1.42: +10 -4 lines
Diff to previous 1.42 (colored)

add variable declarations in for loops for c99

Revision 1.42 / (download) - annotate - [select for diffs], Sun Nov 16 07:06:37 2008 UTC (14 years, 2 months ago) by dholland
Branch: MAIN
Branch point for: jym-xensuspend
Changes since 1.41: +12 -12 lines
Diff to previous 1.41 (colored)

WARNS=4

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

sync with head.

Revision 1.41 / (download) - annotate - [select for diffs], Fri Apr 25 22:18:34 2008 UTC (14 years, 9 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pf42-base4, yamt-pf42-base3, yamt-pf42-base2, wrstuden-revivesa-base-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, hpcarm-cleanup-nbase
Changes since 1.40: +21 -6 lines
Diff to previous 1.40 (colored)

preliminary _Complex support.
NB: Does not really understand type conversions between complex and doubles.

Revision 1.40 / (download) - annotate - [select for diffs], Fri Apr 25 17:18:24 2008 UTC (14 years, 9 months ago) by christos
Branch: MAIN
Changes since 1.39: +10 -3 lines
Diff to previous 1.39 (colored)

handle case C1 ... C2:

Revision 1.39 / (download) - annotate - [select for diffs], Wed Nov 8 18:31:15 2006 UTC (16 years, 2 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base, wrstuden-fixsa-newbase, wrstuden-fixsa-base-1, wrstuden-fixsa-base, wrstuden-fixsa, netbsd-4-base, netbsd-4-0-RELEASE, netbsd-4-0-RC5, netbsd-4-0-RC4, netbsd-4-0-RC3, netbsd-4-0-RC2, netbsd-4-0-RC1, netbsd-4-0-1-RELEASE, netbsd-4-0, netbsd-4, matt-mips64-base, matt-mips64, matt-armv6-prevmlocking, matt-armv6-nbase, matt-armv6-base, matt-armv6, keiichi-mipv6-nbase, keiichi-mipv6-base, keiichi-mipv6, hpcarm-cleanup-base, hpcarm-cleanup, cube-autoconf-base, cube-autoconf
Branch point for: yamt-pf42
Changes since 1.38: +41 -39 lines
Diff to previous 1.38 (colored)

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

Revision 1.38 / (download) - annotate - [select for diffs], Tue Oct 17 23:53:30 2006 UTC (16 years, 3 months ago) by he
Branch: MAIN
Changes since 1.37: +6 -6 lines
Diff to previous 1.37 (colored)

Use __inline instead of inline, to allow linting of ourselves...

Revision 1.37 / (download) - annotate - [select for diffs], Wed Jul 12 20:03:48 2006 UTC (16 years, 6 months ago) by christos
Branch: MAIN
CVS Tags: abandoned-netbsd-4-base, abandoned-netbsd-4
Changes since 1.36: +4 -4 lines
Diff to previous 1.36 (colored)

PR/33984: YAMAMOTO Takashi: lint complains about typedef
The grammar for c99 initializers only looked for name tokens, so if there
was a typedef'ed name it failed. Fixed by looking at all identifier tokens.

Revision 1.36 / (download) - annotate - [select for diffs], Sat Dec 24 20:47:56 2005 UTC (17 years, 1 month ago) by perry
Branch: MAIN
CVS Tags: chap-midi-nbase, chap-midi-base, chap-midi
Changes since 1.35: +8 -8 lines
Diff to previous 1.35 (colored)

Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.

Revision 1.35 / (download) - annotate - [select for diffs], Sun Jul 17 19:35:48 2005 UTC (17 years, 6 months ago) by christos
Branch: MAIN
Changes since 1.34: +22 -4 lines
Diff to previous 1.34 (colored)

Handle C99 array range initializers:

    type a[] = { [lo ... hi] = c }:

Revision 1.34 / (download) - annotate - [select for diffs], Tue Aug 3 12:11:54 2004 UTC (18 years, 6 months ago) by yamt
Branch: MAIN
CVS Tags: netbsd-3-base, netbsd-3-1-RELEASE, netbsd-3-1-RC4, netbsd-3-1-RC3, netbsd-3-1-RC2, netbsd-3-1-RC1, netbsd-3-1-1-RELEASE, netbsd-3-1, netbsd-3-0-RELEASE, netbsd-3-0-RC6, netbsd-3-0-RC5, netbsd-3-0-RC4, netbsd-3-0-RC3, netbsd-3-0-RC2, netbsd-3-0-RC1, netbsd-3-0-3-RELEASE, netbsd-3-0-2-RELEASE, netbsd-3-0-1-RELEASE, netbsd-3-0, netbsd-3
Changes since 1.33: +8 -4 lines
Diff to previous 1.33 (colored)

recognize C99 array initializer designators.  PR/18896.

Revision 1.33 / (download) - annotate - [select for diffs], Sat May 24 22:17:46 2003 UTC (19 years, 8 months ago) by christos
Branch: MAIN
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-base, 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-0, netbsd-2
Changes since 1.32: +7 -4 lines
Diff to previous 1.32 (colored)

handle void ({ })

Revision 1.32 / (download) - annotate - [select for diffs], Tue May 20 13:59:32 2003 UTC (19 years, 8 months ago) by christos
Branch: MAIN
Changes since 1.31: +14 -12 lines
Diff to previous 1.31 (colored)

Better implementation of ({}) gcc extension.

Revision 1.31 / (download) - annotate - [select for diffs], Sun May 18 23:30:00 2003 UTC (19 years, 8 months ago) by kristerw
Branch: MAIN
Changes since 1.30: +3 -3 lines
Diff to previous 1.30 (colored)

Prevent use of stale pointer for determining return type of ({ })
expressions.

Details:
lint did fail on constructs like

   struct foo *x;
   x = ({ struct foo *y; /* do stuff */; y;});

since it gave the whole ({ }) the same structure representing the
type as y, but that structure is reclaimed when y goes out of scope.

Revision 1.30 / (download) - annotate - [select for diffs], Wed Oct 23 13:01:16 2002 UTC (20 years, 3 months ago) by christos
Branch: MAIN
CVS Tags: fvdl_fs64_base
Changes since 1.29: +11 -2 lines
Diff to previous 1.29 (colored)

mention what is wrong with the ({}) productions.

Revision 1.29 / (download) - annotate - [select for diffs], Tue Oct 22 22:50:11 2002 UTC (20 years, 3 months ago) by christos
Branch: MAIN
Changes since 1.28: +45 -7 lines
Diff to previous 1.28 (colored)

add support for ({}) gcc shit.

Revision 1.28 / (download) - annotate - [select for diffs], Tue Oct 22 18:15:00 2002 UTC (20 years, 3 months ago) by christos
Branch: MAIN
Changes since 1.27: +10 -3 lines
Diff to previous 1.27 (colored)

add C9X/GCC compound literal expressions.

Revision 1.27 / (download) - annotate - [select for diffs], Tue Oct 22 13:48:51 2002 UTC (20 years, 3 months ago) by christos
Branch: MAIN
Changes since 1.26: +16 -16 lines
Diff to previous 1.26 (colored)

add variable array dimension.

Revision 1.26 / (download) - annotate - [select for diffs], Mon Oct 21 21:14:51 2002 UTC (20 years, 3 months ago) by christos
Branch: MAIN
Changes since 1.25: +21 -0 lines
Diff to previous 1.25 (colored)

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

Revision 1.25 / (download) - annotate - [select for diffs], Fri Sep 13 14:59:24 2002 UTC (20 years, 4 months ago) by christos
Branch: MAIN
Changes since 1.24: +4 -4 lines
Diff to previous 1.24 (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.24 / (download) - annotate - [select for diffs], Tue Feb 5 03:04:27 2002 UTC (21 years ago) by thorpej
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.23: +10 -9 lines
Diff to previous 1.23 (colored)

Replace u_quad_t with uint64_t and quad_t with int64_t, and use
<inttypes.h> to get those type definitions.  These types are more
portable, and a little more sane to do autoconf tests for.

Revision 1.23 / (download) - annotate - [select for diffs], Thu Jan 31 19:36:53 2002 UTC (21 years ago) by tv
Branch: MAIN
Changes since 1.22: +3 -3 lines
Diff to previous 1.22 (colored)

Protect __RCSID and __COPYRIGHT from being invoked if not defined.

Revision 1.22 / (download) - annotate - [select for diffs], Wed Jan 30 06:48:32 2002 UTC (21 years ago) by thorpej
Branch: MAIN
Changes since 1.21: +3 -3 lines
Diff to previous 1.21 (colored)

Add a missing "static" on a function decl.

Revision 1.21 / (download) - annotate - [select for diffs], Thu Jul 26 15:05:10 2001 UTC (21 years, 6 months ago) by wiz
Branch: MAIN
Changes since 1.20: +3 -3 lines
Diff to previous 1.20 (colored)

Various typos in comments (neccessary, sceme, choise, ...).

Revision 1.20 / (download) - annotate - [select for diffs], Mon May 28 12:40:37 2001 UTC (21 years, 8 months ago) by lukem
Branch: MAIN
Changes since 1.19: +19 -25 lines
Diff to previous 1.19 (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.19 / (download) - annotate - [select for diffs], Thu May 24 12:05:28 2001 UTC (21 years, 8 months ago) by lukem
Branch: MAIN
Changes since 1.18: +3 -3 lines
Diff to previous 1.18 (colored)

oops! delint previous

Revision 1.18 / (download) - annotate - [select for diffs], Thu May 24 11:56:03 2001 UTC (21 years, 8 months ago) by lukem
Branch: MAIN
Changes since 1.17: +3 -3 lines
Diff to previous 1.17 (colored)

allow trailing , in enum if -g

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

fix broken NetBSD RCS id tags

Revision 1.15.8.1 / (download) - annotate - [select for diffs], Fri Jun 23 16:40:17 2000 UTC (22 years, 7 months ago) by minoura
Branch: minoura-xpg4dl
Changes since 1.15: +1 -1 lines
Diff to previous 1.15 (colored) next main 1.16 (colored)

Sync w/ netbsd-1-5-base.

Revision 1.16 / (download) - annotate - [select for diffs], Wed Jun 14 06:49:22 2000 UTC (22 years, 7 months ago) by cgd
Branch: MAIN
CVS Tags: 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
Changes since 1.15: +1 -1 lines
Diff to previous 1.15 (colored)

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

Revision 1.15 / (download) - annotate - [select for diffs], Mon Nov 23 14:37:08 1998 UTC (24 years, 2 months ago) by christos
Branch: MAIN
CVS Tags: wrstuden-devbsize-base, wrstuden-devbsize-19991221, wrstuden-devbsize, 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, comdex-fall-1999-base, comdex-fall-1999
Branch point for: minoura-xpg4dl
Changes since 1.14: +65 -23 lines
Diff to previous 1.14 (colored)

Unfortunately lint uses c-style comments as directives and these get parsed
at the lexical analysis stage not at the syntax parsing stage. The upshot
is that:
	if (expr) {
		stmt1;
	}
	/* LINTED */
	stmt2;

stmt2 is the look-ahead token for the parser to choose between and if-then-else
statement as opposed to an if-then statement. Unfortunately the side effect
is that the LINTED directive gets reset before stmt2 gets parsed. We fix this,
by remembering the the linted directive during the if statement parsing and
restoring it at the appropriate time.

Revision 1.14 / (download) - annotate - [select for diffs], Fri Nov 13 16:48:01 1998 UTC (24 years, 2 months ago) by christos
Branch: MAIN
Changes since 1.13: +19 -6 lines
Diff to previous 1.13 (colored)

Fix problems with LINTED comment:

	if (a) b;
	/*LINTED*/
	c;

	if (a) { b; }
	/*LINTED*/
	c;

	do { b; }
	/*LINTED*/
	while (c);

Produced warnings for c.

Revision 1.13 / (download) - annotate - [select for diffs], Sun Feb 22 15:40:39 1998 UTC (24 years, 11 months ago) by christos
Branch: MAIN
Changes since 1.12: +3 -2 lines
Diff to previous 1.12 (colored)

WARNSify

Revision 1.10.2.2 / (download) - annotate - [select for diffs], Wed Nov 12 02:36:39 1997 UTC (25 years, 2 months ago) by mellon
Branch: netbsd-1-3
CVS Tags: 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
Changes since 1.10.2.1: +3 -2 lines
Diff to previous 1.10.2.1 (colored) to branchpoint 1.10 (colored) next main 1.11 (colored)

Pull rev 1.12 up from trunk (cjs)

Revision 1.12 / (download) - annotate - [select for diffs], Thu Nov 6 15:47:23 1997 UTC (25 years, 3 months ago) by cjs
Branch: MAIN
Changes since 1.11: +3 -2 lines
Diff to previous 1.11 (colored)

I do wish people would start including <string.h> when they use memcpy.

Revision 1.10.2.1 / (download) - annotate - [select for diffs], Tue Nov 4 21:42:17 1997 UTC (25 years, 3 months ago) by thorpej
Branch: netbsd-1-3
Changes since 1.10: +49 -17 lines
Diff to previous 1.10 (colored)

Pull up from trunk: make renaming work and other minor fixes.

Revision 1.11 / (download) - annotate - [select for diffs], Mon Nov 3 22:36:31 1997 UTC (25 years, 3 months ago) by cgd
Branch: MAIN
Changes since 1.10: +49 -17 lines
Diff to previous 1.10 (colored)

implement (hack in) symbol (function and variable) renaming, so that
the function renaming tricks currently needed by libc can be tolerated
by lint.  This needs some cleanup, but it appears to work.

Revision 1.10 / (download) - annotate - [select for diffs], Fri May 9 18:07:23 1997 UTC (25 years, 8 months ago) by mycroft
Branch: MAIN
CVS Tags: netbsd-1-3-base
Branch point for: netbsd-1-3
Changes since 1.9: +26 -4 lines
Diff to previous 1.9 (colored)

Hack to work around compiler bug for now.

Revision 1.9 / (download) - annotate - [select for diffs], Sun Dec 22 11:30:49 1996 UTC (26 years, 1 month ago) by cgd
Branch: MAIN
Changes since 1.8: +5 -3 lines
Diff to previous 1.8 (colored)

* Accept asm statements at any place where you could see a function or
  variable declaration, in addition to within function & variable
  declarations and function bodies.  I think this comes close enough
  to what gcc does to be considered "correct enough."  Certainly, it
  fixes the problem for the couple of cases where this is a problem
  in our tree.

Revision 1.8 / (download) - annotate - [select for diffs], Mon Oct 2 17:31:35 1995 UTC (27 years, 4 months ago) by jpo
Branch: MAIN
CVS Tags: netbsd-1-2-base, netbsd-1-2-RELEASE, netbsd-1-2-PATCH001, netbsd-1-2-BETA, netbsd-1-2, netbsd-1-1-base, netbsd-1-1-RELEASE, netbsd-1-1-PATCH001, netbsd-1-1
Changes since 1.7: +11 -6 lines
Diff to previous 1.7 (colored)

don't print warnings about unused variables or arguments in compound
statements which contain asm statements.

Revision 1.7 / (download) - annotate - [select for diffs], Mon Oct 2 17:29:45 1995 UTC (27 years, 4 months ago) by jpo
Branch: MAIN
Changes since 1.6: +23 -7 lines
Diff to previous 1.6 (colored)

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

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

Revision 1.6 / (download) - annotate - [select for diffs], Mon Oct 2 17:26:52 1995 UTC (27 years, 4 months ago) by jpo
Branch: MAIN
Changes since 1.5: +56 -9 lines
Diff to previous 1.5 (colored)

support asm statements and asm modifiers in declarations

asm statements consist of an asm keyword, an optional qualifier, a
left paren, a list of tokens up to and including the matching right
paren, and a semicolon.

asm modifiers consist of an asm keyword, an left paren, a string and a
right paren.

asm statements and modifiers have no semantic for lint(1), they exist only
to avoid complaints about them.

Revision 1.5 / (download) - annotate - [select for diffs], Mon Oct 2 17:18:53 1995 UTC (27 years, 4 months ago) by jpo
Branch: MAIN
Changes since 1.4: +5 -10 lines
Diff to previous 1.4 (colored)

__{const,signed,volatile}{__,} added
const, signed and volatile are disabled with -t

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

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

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

prefixed members of dinfo_t with 'd_'

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

RCS id cleanup

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

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

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

Initial revision

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




CVSweb <webmaster@jp.NetBSD.org>