Commit Graph

1383 Commits

Author SHA1 Message Date
rillig 5fe653032c tests/lint: remove wrong comment
GCC 10 does warn about returning a temporary object, but only when
optimizations are enabled.
2023-04-15 12:59:02 +00:00
rillig db7f32c2b2 tests/lint: add more tests for returning local objects 2023-04-15 12:47:32 +00:00
rillig 408e7ca205 lint: add query for parenthesized return value 2023-04-15 11:34:45 +00:00
rillig e7d3b23c6b tests/lint: extend test for returning local address 2023-04-15 10:53:59 +00:00
rillig 484ed28712 lint: don't wrongly warn about overflow in complex constants
Seen in lib/libm.
2023-04-11 00:03:42 +00:00
rillig f8bad61ed5 tests/lint: demonstrate wrong warning with complex numbers 2023-04-10 23:52:49 +00:00
rillig f92802e558 lint: fix duplicate warning when parsing big float constants 2023-04-05 20:17:30 +00:00
rillig cc35e66604 tests/lint: demonstrate duplicate warning when parsing big floats 2023-04-05 20:13:01 +00:00
rillig ce2e717784 lint: allow querying for octal integer constants 2023-03-31 13:03:05 +00:00
rillig d0a5c1bc3c lint: warn about 'extern' declarations inside function bodies
https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html

The previous attempt (message 351 about 'extern' declarations outside
headers) did not cover the proposal from the tech-userlevel mailing list
but instead warns about a different usage pattern of the 'extern'
keyword.
2023-03-28 20:04:51 +00:00
rillig b2baa50111 lint: warn about extern declarations outside headers
https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html
2023-03-28 14:44:34 +00:00
rillig eaf30a03e7 lint: split platform-specific test for loss of accuracy
Lint distinguishes between platforms where size_t is unsigned int and
platforms where size_t is unsigned long.
2023-02-27 23:07:53 +00:00
rillig 17f65f1e9a tests/lint: sync test for nonportable character comparisons
Message 230 was changed on 2023-02-22 but only tested on signed char
platforms.
2023-02-27 21:59:14 +00:00
sjg 68f52b2486 t_make skip varname-dot-make-meta-ignore_*
The meta-ignore tests will likely not work in this environment
so skip them.
2023-02-25 19:37:33 +00:00
rillig 6adfeb9415 lint: fix confusing message about nonportable character constants 2023-02-22 22:30:40 +00:00
rillig f29e29e219 tests/lint: add platform-specific tests 2023-02-22 22:12:35 +00:00
rillig 68d13a7aa7 lint: fix null pointer dereference in invalid case expression 2023-02-21 19:47:21 +00:00
rillig 4995df0909 lint: do not warn about traditional C migration in C99 mode
For large integer constants, the resulting type could differ between
traditional C and C90. In C99 mode, this difference is no longer
relevant since it is too far away from traditional C.
2023-02-19 12:00:15 +00:00
rillig a44d0c3164 tests/lint: fix and extend tests for C90 migration warning 2023-02-19 11:50:29 +00:00
rillig 8ee241b006 lint: remove compat code for lexing hex floating point literals
Hex floating literals are required by C99.
2023-02-18 14:32:32 +00:00
rillig 15a1e93882 tests/lint: sync reference to platform properties generator 2023-02-06 21:20:58 +00:00
rillig 456342a5d0 lint: eliminate unnecessary indirection
No functional change.
2023-02-06 21:01:55 +00:00
rillig f1b2140bb8 tests/lint: fix source directory for looking up the .exp-ln files 2023-02-05 17:23:01 +00:00
rillig 6d1c4d2bf4 tests/lint1: the redundantly listed files contained .exp-ln as well 2023-02-05 16:11:56 +00:00
rillig d81c1a19b2 tests/lint: fix resolving of wildcards in builds from other directories 2023-02-05 15:11:19 +00:00
rillig cd59f013cc tests/lint: merge tests for initialization 2023-02-05 13:01:28 +00:00
rillig 6730036cf8 tests/lint: remove redundancy from Makefile
The list of test files is already kept in distrib/sets/lists/tests/mi.
2023-02-05 12:36:56 +00:00
rillig 134e5c5e76 tests/lint: remove redundant tests
The names of the tests were misleading: 'recursive' should have been
'nested', and the interesting topic in the 'cast' tests was not the cast
but the pointer dereference.
2023-02-05 12:25:11 +00:00
rillig 9de3085848 tests/lint: clean up
The .exp files are no longer kept under version control, so there's no
reason anymore to forcefully trigger a warning or an error.
2023-02-05 10:57:48 +00:00
rillig e0bb9f7cf5 lint: properly clean up when leaving a function definition 2023-01-29 18:37:20 +00:00
rillig b5b35fa5a0 lint: fix definition of __func__ 2023-01-29 18:16:48 +00:00
rillig e80194217c lint: demonstrate wrong declaration of __func__ 2023-01-29 17:36:26 +00:00
rillig 2f05763014 lint: don't warn about negative '>>' when the actual value is positive 2023-01-29 17:13:10 +00:00
rillig 6b8b6837b1 tests/lint: merge tests for '>>' 2023-01-29 17:02:09 +00:00
rillig b4db8a2cd2 tests/lint: document how compilers promote bit-fields 2023-01-28 08:36:17 +00:00
rillig 93f3a70d97 tests/lint: investigate how compilers interpret bit-fields 2023-01-28 08:30:12 +00:00
rillig f25c712f32 tests/lint: merge tests for declaration after statement 2023-01-22 17:17:24 +00:00
rillig 0ad5a70976 lint: prevent undefined behavior for signed '<<'
Found by manual code inspection, verified by MKSANITIZER=yes
USE_SANITIZER=undefined.
2023-01-22 16:05:08 +00:00
rillig a695cd72f6 lint: add test for floating constant overflow 2023-01-21 17:48:29 +00:00
rillig 798c690d94 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.
2023-01-21 13:48:40 +00:00
rillig e104b7676c 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.
2023-01-21 13:07:21 +00:00
rillig 149d92727c tests/lint: test _Atomic, added in C11 2023-01-21 11:57:03 +00:00
rillig 5db76b35c9 lint: fix null pointer dereference on invalid argument to __typeof__ 2023-01-21 08:04:43 +00:00
rillig d67dd6957e tests/make: rename files that are not test cases 2023-01-19 23:26:14 +00:00
rillig f523563840 tests/lint: fix typo in comment 2023-01-16 00:37:59 +00:00
rillig 66827794fe tests/lint: add basic tests for lint (not lint1 or lint2) 2023-01-15 23:18:05 +00:00
rillig 8e78cfd5a6 tests/lint: document conversion from void pointer 2023-01-15 14:00:09 +00:00
rillig 687f4c966a tests/lint: fix test for sizeof with variable-length array 2023-01-15 13:55:06 +00:00
rillig f0df5ddf92 tests/lint: add more tests for sizeof 2023-01-15 13:30:04 +00:00
rillig 7997ddce85 tests/lint: add test for parsing sizeof expressions 2023-01-15 00:53:19 +00:00