rillig
cca12cba58
lint: replace simple LERROR with lint_assert
2021-01-01 09:28:22 +00:00
rillig
194bb9b625
lint: replace some more LERROR with lint_assert
2021-01-01 09:11:40 +00:00
rillig
259b122f43
lint: rename basic_type_name to tspec_name
...
The term "basic type" is precisely defined in C99 6.2.5p14, and tspec_t
is close to that, but nowhere identical.
2021-01-01 01:42:55 +00:00
rillig
15ccb490cc
lint: clean up warn_incompatible_types
...
Splitting the code arbitrarily in separate phases made the code harder
to understand, both for humans as well as automated tools.
One of these tools, check-msgs.lua, couldn't check whether the comments
match the actual messages, and of course, the comments were wrong.
There was no good reason to deviate from the pattern followed by all the
rest of the code.
2021-01-01 01:38:14 +00:00
rillig
5cf99a8e7a
lint: remove redundant printf arguments
2021-01-01 01:29:30 +00:00
rillig
6451720632
lint: align comments with actual message, in the lexer and parser
2021-01-01 01:26:02 +00:00
rillig
e93292def1
lint: fix segmentation fault when checking returned enum types (211)
2021-01-01 01:07:07 +00:00
rillig
d4b0f2fea7
lint: align comments in code with actual messages
...
Redundancy is bad. Especially in this case, separating the format
strings from the actual arguments prevents the compiler from
cross-checking them.
2021-01-01 00:00:24 +00:00
rillig
2e28c52323
lint: check messages and their IDs for consistency
2020-12-31 22:48:33 +00:00
rillig
ee607e0b85
lint: check that in "if (cond)", cond is scalar
2020-12-31 18:51:28 +00:00
rillig
fbeb97dcac
lint: in mkops, replace printf with println
...
One less backslash per line of code.
2020-12-31 16:19:05 +00:00
rillig
0197fc8fc4
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.
2020-12-30 13:17:42 +00:00
rillig
47bf7e655e
lint: replace LERROR with lint_assert
...
This removes the redundancy of mentioning the function name in the error
message. This redundancy had been correct in all but 2 cases:
build_real_imag and tsize.
2020-12-30 12:22:51 +00:00
rillig
6bddcb2931
lint: spell check comments
2020-12-30 11:56:10 +00:00
rillig
ea78491f30
lint: inline STRUCT_ASSIGN
...
This had only been necessary for some pre-C90 compilers.
2020-12-30 11:39:55 +00:00
rillig
3bd4b094fc
lint: un-abbreviate s_dpos, s_spos and s_upos
2020-12-30 11:14:03 +00:00
rillig
eb502cf640
lint: un-abbreviate s_field, s_keyw and s_xsym
2020-12-30 11:04:48 +00:00
rillig
a2826784dd
lint: un-abbreviate parenthesized and _strg
2020-12-30 10:56:51 +00:00
rillig
873deaeeb7
lint: rename remaining _nxt members to _next
2020-12-30 10:49:10 +00:00
rillig
c5b43f746f
lint: rename more _nxt members to _next
2020-12-30 10:46:11 +00:00
rillig
a2cbddd569
lint: rename symt_t constants
...
There's no need to abbreviate them, furthermore FMOS was imprecise.
2020-12-30 10:35:38 +00:00
rillig
95c0030060
lint: rename s_nxt to s_next
2020-12-30 10:26:12 +00:00
rillig
106bafb2f3
lint: reduce nesting of function calls
2020-12-30 01:44:32 +00:00
rillig
64e104d6f9
lint: reduce verbosity of assertions
...
Having 2 lines of source code per assertion is too much, especially
since most of this code is redundant anyway. Extract the common code
and the additional negation into a simple function instead.
2020-12-30 01:33:30 +00:00
rillig
85b03529a9
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.
2020-12-30 01:02:38 +00:00
rillig
dcab0392c7
lint: rename istk_t.i_cnt to i_remaining
2020-12-29 23:12:48 +00:00
rillig
8ed5e02447
lint: rename functions that had very short names
2020-12-29 23:04:31 +00:00
rillig
a5a7f2dbca
lint: fix typo in comments
2020-12-29 21:32:46 +00:00
rillig
1af901126c
lint: untangle conditions in initstack_next_nobrace
2020-12-29 20:56:28 +00:00
rillig
243e03680f
lint: clean up debug logging for initializations
2020-12-29 20:07:04 +00:00
rillig
447de2e185
lint: make debug output for initializations more uniform
2020-12-29 19:57:44 +00:00
rillig
ca73041003
lint: remove redundant function prototypes
2020-12-29 19:09:53 +00:00
rillig
351a1350bb
lint: improve debug output for initializing structs
...
Still trying to find out where the wrong warning in d_struct_init_nested
comes from.
2020-12-29 19:02:16 +00:00
rillig
374913ae51
lint: split complete_tag into separate functions
2020-12-29 17:29:31 +00:00
rillig
eaac8d6f4d
lint: split initstack_next into separate functions
2020-12-29 16:59:12 +00:00
rillig
1d9b6c3dda
lint: split initstack_pop into separate functions
2020-12-29 16:53:36 +00:00
rillig
312ed535ca
lint: rename functions for handling the initialization stack
2020-12-29 16:48:53 +00:00
rillig
2008c479fd
lint: rename functions with very short names
2020-12-29 13:33:03 +00:00
rillig
6e356060f2
lint: remove redundant parentheses around return value
2020-12-29 12:29:03 +00:00
rillig
132ce748b5
lint: fix indentation and alignment that used space-tab
2020-12-29 12:18:42 +00:00
rillig
454956c699
lint: spell check
2020-12-29 11:54:56 +00:00
rillig
9068543091
lint: remove redundant parentheses around return value
2020-12-29 11:35:11 +00:00
rillig
1864d10dbc
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.
2020-12-29 10:24:22 +00:00
rillig
e2e06973fc
lint: rename confusing function setcompl
...
The previous function name suggested that it would set the complete flag
of the type, but it was the exact opposite. To reduce confusion, negate
the meaning of the parameter.
2020-12-28 22:31:31 +00:00
rillig
0ab178ad4b
lint: spell check
2020-12-28 21:24:55 +00:00
rillig
1129695e46
lint: remove trailing whitespace
2020-12-28 19:47:42 +00:00
rillig
9be60dc2a5
lint: rename fields in mod_t
2020-12-28 19:38:54 +00:00
rillig
85dfb0396a
lint: sort includes
2020-12-28 19:07:43 +00:00
rillig
d7e85c8e1e
lint: realign code
2020-12-28 19:02:16 +00:00
rillig
de8e6de031
lint: rename tspec macros
2020-12-28 18:49:02 +00:00