Commit Graph

4849 Commits

Author SHA1 Message Date
yamaguchi 0c15ac9ed3 Added missing waiting for DAD completion 2021-05-06 01:09:43 +00:00
rillig d16694fc52 tests/lint: make test for message 118 platform-independent 2021-05-04 19:57:56 +00:00
rillig 8d96908096 lint: fix assertion failure when promoting a bit-field larger than int 2021-05-04 05:40:10 +00:00
rillig 249bb67fed tests/lint: demonstrate assertion failure "len == size_in_bits(INT)"
Seen on sparc64 in hdtoa.c:341 since sparc64 is one of the platforms
that has 128-bit long double and defines struct ieee_ext.ext_frach:48
based on uint64_t, which is a GCC extension.  Plain C99 only allows
_Bool, signed int and unsigned int as base type for bit-fields.
2021-05-04 05:32:52 +00:00
rillig 58cf05d8c5 lint: allow variables to be named 'pcs' 2021-05-03 07:08:54 +00:00
rillig 5615754a21 tests/lint: demonstrate bug in the lexer for GCC attributes 2021-05-03 06:24:18 +00:00
rillig 944c465b9d lint: fix parsing of __typeof__ after statement in ({ ... })
Since C99, declarations and statements can be freely mixed, and GCC
supported this even before 1999.
2021-05-03 05:24:44 +00:00
rillig 413a9598ba tests/lint: remove outdated comment
The test d_gcc_extension is already activated in line 121.
2021-05-03 03:50:43 +00:00
rillig 9491476953 lint: allow large integer types for bit-fields in GCC mode
These types are explicitly allowed by GCC.

I'm not sure which of the flags -g and -p should be stronger.  That is,
if both -g and -p are given, should 'unsigned char' be allowed as a
bit-field type since -g would allow it, or should it be warned about
since -p warns about it?  For now, continue to warn about these.
2021-05-02 22:07:49 +00:00
rillig b0f8c816d4 tests/lint: fix test for GCC bit-field types
The whole purpose of this test is to try the message about invalid
bit-field types in GCC mode.  Therefore, use the default lint1-flags
that include -g.
2021-05-02 21:47:28 +00:00
rillig c29d5e341f tests/lint: add test for bit-field types in GCC mode 2021-05-02 21:22:09 +00:00
rillig ed02aca188 tests/lint: demonstrate missing support for __packed __aligned 2021-05-02 20:44:46 +00:00
martin 3e0848b4f6 Add test for POSIX_SPAWN_RESETIDS flag 2021-05-02 11:18:11 +00:00
rillig 277632d833 tests/lint: add test for __attribute__((nonnull())) 2021-05-01 07:56:20 +00:00
rillig b7fe254f77 lint: support all documented variants of __attribute__((nonnull)) 2021-05-01 07:25:07 +00:00
rillig df210e12b5 tests/lint: add very basic tests for GCC __attribute__ 2021-04-30 23:49:36 +00:00
christos 5231a05ac1 remove hacks. 2021-04-30 13:53:30 +00:00
thorpej 799aab805f config_found_ia() -> config_found(). 2021-04-25 05:33:20 +00:00
rillig cd38323370 tests/lint: test GCC compound expression without declaration 2021-04-23 20:13:29 +00:00
yamaguchi 7c3ad1a224 Added a test case for MTU of pppoe(4) 2021-04-23 03:41:55 +00:00
yamaguchi 8fd0ecaa70 Make IFF_DEBUG enabled if $DEBUG is true 2021-04-23 03:40:05 +00:00
yamaguchi 4bb5023316 functionalize rump.ifconfig and pppoectl for clearer test code 2021-04-23 03:38:19 +00:00
yamaguchi 2d87bd9bd5 Added test cases for "pppoectl passiveauthproto" 2021-04-23 03:07:19 +00:00
rillig 66445508cf tests/lint: add test for typeof after statement
Found by christos@.
2021-04-22 22:43:26 +00:00
christos a32fdb6548 Put things back, emit.ln it was meant to be there. 2021-04-21 14:04:26 +00:00
christos 2730ab42e6 remove emit.ln; looks like an accident and breaks the build. 2021-04-21 13:41:42 +00:00
rillig be94027e4e tests/lint: fix the hack for emit.ln to also work if MKUPDATE != "no" 2021-04-21 13:26:16 +00:00
rillig 97ccd8d967 tests/lint: fix inconsistent operator for emit.ln
The build failed with:

	nbmake[8]: "/.../src/share/mk/bsd.files.mk" line 47:
	    Inconsistent operator for /.../emit.ln
2021-04-20 23:30:35 +00:00
rillig 105b25615a tests/lint1: fix build error "must name an existing directory"
The build failed with this error message:

	x86_64--netbsd-install: the last argument (/.../emit.ln) must
	name an existing directory

The cause for this message was that ${DESTDIR}/.../emit.ln has
${DESTDIR}/.../emit.c as implicit target, which is kind of correct but
unintended in this case.  Because of this, the command 'install' was run
like this:

	install ${NETBSDSRCDIR}/.../emit.ln ${DESTDIR}/.../emit.c \
	    ${DESTDIR}/.../emit.ln
2021-04-20 21:20:24 +00:00
rillig f1cc514d7d tests/lint: record all files from FILES in distrib/sets/lists/tests/mi 2021-04-18 23:05:26 +00:00
rillig 34039a4026 tests/lint: add emit.ln to the release files 2021-04-18 23:02:16 +00:00
rillig 3f5e7494f3 lint: test emitting of symbol information in the .ln files
Even though the new test is quite large, it didn't find any bugs in the
code.  The only thing I'm unsure about is why static functions are
exported as well, since they are supposed to be local to the translation
unit.
2021-04-18 20:02:56 +00:00
rillig fb2cd55871 tests/lint: remove work-in-progress code
The only purpose of the additional initializers was to generate an error
message, to make the .exp file non-empty.  This is no longer needed.
2021-04-18 08:03:56 +00:00
rillig 73b70e7b0b lint: document wrong location information in diagnostics 2021-04-18 07:31:47 +00:00
rillig 0580bd7587 lint: fix assertion failure for temporary objects in initialization 2021-04-17 21:20:08 +00:00
rillig d39373331c tests/lint: fix analysis from previous commit, add another example
This is not a GCC feature, it's required by C99 already.
2021-04-17 20:57:18 +00:00
rillig 80be8043c5 tests/lint: demonstrate assertion failure in initialization 2021-04-17 20:36:17 +00:00
rillig c322b8c5b5 lint: do not warn about alignment when casting from incomplete struct
This removes a bunch of technically correct but practically useless
warnings from the regular NetBSD build.
2021-04-17 16:58:04 +00:00
rillig 814d2d428a tests/lint: add test for pointer cast from incomplete struct 2021-04-17 16:52:09 +00:00
rillig 3737a339ac tests/make: remove ATF descr
The description of the tests is not going to be added anytime soon, as
that would either create redundancy or additional run-time cost.
Parsing and evaluating unit-tests/Makefile is already O(n^2) with regard
to the number of tests, and there are quite a few tests.  Therefore don't
add any overhead for now.
2021-04-17 11:36:34 +00:00
rillig 11173f1b80 tests/make: indent consistently 2021-04-17 11:31:25 +00:00
rillig eefa5d1cf5 tests/make: simplify selection of the files to be copied
No functional change.
2021-04-17 11:21:17 +00:00
rillig 63eed110a6 tests/lint: adjust test for C11 to the change in grammar and options 2021-04-14 22:06:38 +00:00
rillig 3874a90eb6 lint: add option to accept C11 features
The list of available letters for the command line options gets shorter
and shorter.  Most of the interesting letters are already used for some
warning categories.  Curiously, -A, -W and -E were all still available.

The option -A nicely matches the intention of the option, which is to
allow a certain set of language features.  To keep the option available
for further extensions, define -Ac11 as the currently only valid option
of that kind.  This allows straight-forward extension for C17 and future
language standards, as well as independent feature-sets.  The options -W
and -E may someday complement the -A option, using the allow/warn/error
categories.
2021-04-14 20:06:40 +00:00
rillig 67509c5839 lint: add support for C11-isms such as int[static 3] 2021-04-14 18:35:40 +00:00
rillig 6aa88d9625 lint: add test for newly added message about static array size 2021-04-14 18:27:11 +00:00
christos f7e8f455fd add a test for a type attribute after a param function pointer 2021-04-13 22:21:19 +00:00
christos 8396636f1d Add an example of attribute fallthrough 2021-04-12 15:54:55 +00:00
mrg 7e5e03e2b7 new GCC_NO_* uses for warning issues. most of the users of the new
GCC_NO_RETURN_LOCAL_ADDR are bugs in GCC itself, not the code.
2021-04-12 06:08:30 +00:00
mrg a2d1542565 add some new uses of existing GCC_NO_* variables for warning issues.
remove an no longer relevant for gcc7 workaround (works fine in both
gcc9 and gcc 10.)
2021-04-12 02:54:07 +00:00