Commit Graph

286552 Commits

Author SHA1 Message Date
martin
9096d3ad6e Add siisata 2021-03-28 08:34:18 +00:00
rillig
8d7ac35e4f lint: reorder code for handling initializations
First the primitives for debug logging, then the functions that do not
access any global variables, finally everything else.

No functional change.
2021-03-28 08:30:22 +00:00
rillig
18eeb7dffa lint: move debug primitives to the top of the code
No functional change.
2021-03-28 07:59:09 +00:00
isaki
1b5c35427c Update documents.
- query_format has been mandatory (since at least Feb 2020).
- set_params has been replaced to set_format (since May 2019).
2021-03-28 07:42:06 +00:00
dholland
2ab5b263a3 Document EINVAL for out of range socket address lengths.
This is what happens, but wasn't documented. Applies to bind(2),
connect(2), and send(2).
2021-03-28 03:29:31 +00:00
dholland
7ec5b82b08 In getvfsstat(2), clarify that the size argument is in bytes.
That the size argument is in bytes (not the count of structures) and
the return value is the count of structures (not bytes) is
counterintuitive.
2021-03-27 23:35:37 +00:00
rillig
713cdeb737 lint: extract brace_level_next_member from initstack_pop_item_unnamed
No functional change.
2021-03-27 23:18:37 +00:00
rillig
7524fdaade tests/lint: test initializing a struct ending with unnamed bit-field 2021-03-27 23:13:48 +00:00
rillig
a638669c26 lint: extract brace level code into separate functions
No functional change.
2021-03-27 22:53:10 +00:00
rillig
e8a58a4a0e lint: prepare support for adding array designators
No functional change.
2021-03-27 22:35:10 +00:00
rillig
ef9afa2e18 lint: move handling of function renaming over to declare_extern
No functional change.
2021-03-27 22:13:55 +00:00
rillig
1eacbd0104 lint: rename decl1ext, reduce visibility
No functional change.
2021-03-27 22:04:39 +00:00
rillig
ba16517256 lint: add function for setting the initialization error
No functional change.
2021-03-27 21:56:51 +00:00
ryo
58b879d3a8 Removed little endian dependencies.
Now vmt(4) works on aarch64eb on vmware ESXIonARM.
2021-03-27 21:23:14 +00:00
rillig
ccfb8928c0 lint: remove unnecessary typedefs
No functional change.
2021-03-27 19:59:22 +00:00
rillig
fe9fcc3850 lint: rename initstack_element to brace_level
No functional change.
2021-03-27 19:48:00 +00:00
christos
65371df829 Add fn_complete2() that controls the quoting of the returned match.
Before it was based on the heuristic that we were not supplied an
attempted_completion_function, which worked well because programs
that supplied that function were not shells and did not want/understand
shell quoting. Recently though Piotr Stefaniak wanted to enhance command
completion for the Bourne Shell and this could benefit quoting the returned
command. This function adds an extra flags argument that controls that quoting.
2021-03-27 18:55:02 +00:00
rillig
4b2a451006 lint: extract look_up_member from initstack_push_struct_or_union
No functional change.
2021-03-27 16:37:12 +00:00
rillig
6ff83f9559 lint: clean up initstack_pop_item_named_member
Previously, the code accessed the global variable for the designator
several times, even though the designator cannot change during this part
of the code.  Make this obvious by passing this designator as a
parameter instead.

No functional change.
2021-03-27 16:24:21 +00:00
rillig
16d4772b31 tests/lint: document expectations in test about array initialization 2021-03-27 16:13:41 +00:00
rillig
8f24804db0 tests/lint: trigger assertion failure in array initialization 2021-03-27 15:49:33 +00:00
rillig
c581ec06d7 tests/lint: move description of tests into the tests themselves
In most cases the descriptions didn't add much to the test name anyway.
2021-03-27 13:59:18 +00:00
rillig
125c83e1c2 tests/lint: do not force tests to start with 'd_'
Using only parts of the test name files in t_integration.sh made it
unnecessarily difficult to find a test based on its filename.  The tests
for the individual messages already have a different prefix.

No functional change.
2021-03-27 13:28:03 +00:00
rillig
5787cf077c lint: fix and update comments about initialization 2021-03-27 13:17:42 +00:00
rillig
ebecd520af lint: merge duplicate code in initialization
No functional change.
2021-03-27 13:08:20 +00:00
rillig
ae661a2bff lint: rename LERROR to INTERNAL_ERROR
The '#ifndef' in tyname.c is meant to distinguish between lint1 and
lint2, it is not meant to be defined from anywhere outside the lint code
itself.

No functional change.
2021-03-27 12:42:22 +00:00
rillig
a71c5054a7 lint: rename filename management functions
No functional change.
2021-03-27 12:32:19 +00:00
rillig
23f85da8c6 lint: clean up code for filename management
In add_directory_replacement, the expression 'r->repl - r->orig' looked
strange, as if two pointers into separate objects were subtracted.

The code was probably optimized to a particular compiler on a particular
platform to generate fast and simple code.  Since compilers have made
considerable progress over the last 25 years, optimize the code for
human legibility instead.  The compilers will somehow cope with that.

No functional change.
2021-03-27 12:24:43 +00:00
rillig
993e4d3b00 lint: rename filename_replacement.len to orig_len
No functional change.
2021-03-27 12:17:22 +00:00
jmcneill
1aeb00284a Revert recent pic optimizations until I have more time to work on this. 2021-03-27 12:15:08 +00:00
rillig
7b6e605eda lint: rename global variables in filename management
No functional change.
2021-03-27 12:14:49 +00:00
rillig
625ccc15a1 lint: rename srchfn to search_filename, return const value
No functional change.
2021-03-27 12:10:41 +00:00
rillig
054e76c5e6 lint: rename types in filename management
No functional change.
2021-03-27 12:01:49 +00:00
rillig
95991669ee lint: reduce indentation in fnnalloc
No functional change.
2021-03-27 11:54:35 +00:00
rillig
414d96f2ad lint: rename fnaddreplsrcdir to something less cryptic
No functional change.
2021-03-27 11:50:34 +00:00
rillig
e19973139d lint: remove unused fnalloc 2021-03-27 11:47:59 +00:00
rillig
5e491b8d10 lint: remove space between 'sizeof ('
No functional change.
2021-03-27 11:08:00 +00:00
nia
7bef196ea2 Add uxrcom(4) 2021-03-27 08:01:21 +00:00
simonb
19a5a25b1a Use LDADD/DPADD instead of PROGDPLIBS - we are linking against installed
libraries.

Use compat/exec.mk - dtrace isn't compat32 friendly (yet?).
2021-03-27 02:58:39 +00:00
simonb
8d4bbb0957 Make columns nicely aligned. 2021-03-27 02:46:45 +00:00
rillig
c74ec7a475 bind: fix typo in stdatomic to support lint + Clang
Before this fix, lint complained:
> dist/lib/isc/queue.c(203): error: expected undefined [99]

https://gitlab.isc.org/isc-projects/bind9/-/issues/2601
2021-03-27 00:06:27 +00:00
rillig
13262e443a lint: add quotes around placeholder in message about undefined variable
Before: error: expected undefined [99]
After:  error: 'expected' undefined [99]

Seen in external/mpl/bind, which for Clang defines in stdatomic.h:
> #define atomic_exchange_explicit(obj, desired, order) \
>     __c11_atomic_exchange_explicit(obj, expected, order)
Note the mismatch between 'desired' and 'expected'.
2021-03-26 23:17:33 +00:00
rillig
c162536975 indent: don't claim that indent is "the nicest C pretty printer around"
That statement may have been true in 1993, but definitely is not true
anymore, as of 2021.

The part about "needs to be completely redone" is still true though
since indent cannot even format its own source code in an acceptable
way.
2021-03-26 22:33:54 +00:00
rillig
0554da173f indent: remove workaround for array initialization bug in lint
The bug has been fixed in init.c 1.133 from 2021-03-25.
2021-03-26 22:27:43 +00:00
rillig
f8d94ead78 indent: fix Clang build everywhere but on amd64
No idea why Clang didn't complain about this on amd64, only on all other
platforms.
2021-03-26 22:02:00 +00:00
pgoyette
4bf31dd43a The install-image has grown a bit recently, and at least amd64 has
outgrown the previous size specification when the system was built
with all of MKDEBUG, MKKDEBUG, and MKDEBUGLIB set to "yes" (and
also when in-tree X11 is included).

So, bump the size a bit.
2021-03-26 21:18:29 +00:00
rillig
e355d71d52 lint: improve output format for internal errors
The new format follows the common conventions for file locations and
allows quick navigation in IDEs.

To trigger an internal error, it suffices to have 2 tokens in lint1's
input, after preprocessing: 'void __pure'.
2021-03-26 21:05:27 +00:00
christos
2fe32f22d3 use __func__ 2021-03-26 20:51:34 +00:00
rillig
2e0a622386 lint: in malloc calls, use 'sizeof *ptr' instead of 'sizeof(type)'
No functional change.
2021-03-26 20:31:07 +00:00
rillig
48d931bdcb lint: rename members of struct control_statement to be more expressive
C99 does not define names for the head parts of the 'for' statements, it
just calls them clause-1, expression-2 and expression-3.  Therefore the
rather abstract name 'expr3'.

No functional change.
2021-03-26 19:17:58 +00:00