These platforms don't provide __uint128_t, at least not in lint.
The exact data type does not matter in this test, it just has to be
different from 'int'.
The functions 'debug_node' and 'display_expression' were similar enough
to be merged.
Migrate debug_node to use the existing debug logging functions.
Remove the now unused option 'd' from the options string.
The command line option -d was not used by /usr/bin/lint, and it only
triggered a handful of debug messages. Move this debug logging over to
the compile-time -DDEBUG setting.
Move display_expression further up to avoid the forward declaration.
Conceptually, a symbol buffer does not need to remember its hash value
since that belongs to the symbol table. This makes the code for the
symbol table simpler. The number of hash calculations increases by
about 5%, which is negligible.
No functional change.
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.
For the .ln files, I chose the letter 'J' to represent the 128-bit
integer types since it is close to 'I' for int. The naming of 'L' for
'long' is obvious, but 'Q' for 64-bit integers is a quad-16-bit word,
which is an unusual measurement unit nowadays. One benefit of choosing
'J' is that the next letter, 'K' can then be used for 256-bit integer
types.
Support for 128-bit integer types is still very basic. Plus, it is only
supported on LP64 platforms, which means that lint cannot be
cross-compiled to check for an LP64 platform while running on an ILP32
platform.
To analyze the unexpected test failure of op_shl_lp64, I had reverted
debug_step to evaluate its arguments. I then accidentally committed
that without running the tests again.
Anyway, the previous commit can now be used as a demonstration that
initdecl is indeed missing the initialization for __uint128_t, which
leads to the internal error in op_shl_lp64.
The calls to debug_step, unlike printf, don't need a trailing newline.
Remove the debug_step0 macro and its relatives since lint already uses
enough other features from C99 that it essentially requires this
standard, which supports varargs macro arguments. Among these features
are __func__ and printf("%zu").
In non-debug mode, do not evaluate the arguments of debug_step.
Evaluating the arguments had caused an internal error when running the
test op_shl_lp64. This is indeed a bug since initdecl should have
initialized the type table for __uint128_t. This had been forgotten
when support for __uint128_t was added in decl.c 1.69 from 2018-09-07.
No functional change.
Lint currently has several different kinds of debug log:
* The -DDEBUG log is controlled at compile time.
* The -d command line options enables some other debug logging.
* The -DYYDEBUG log for parsing is controlled at compile time.
* The -y command line option only has an effect in -DYYDEBUG mode.
Extracting the logging into a separate file is a first step towards
unifying these logs and making the code for debug logging stand out less
than the current #ifdef DEBUG.
No functional change.