summaryrefslogtreecommitdiff
path: root/usr.bin
AgeCommit message (Collapse)Author
2023-07-09lint: remove redundant '#' after 'argument' in diagnosticsHEADtrunkrillig
2023-07-08lint: warn about pointer casts between different kinds of typesrillig
Pointer casts from an integer type to a floating-point type and vice versa get a 'maybe troublesome' warning now. The previous assumption that all types of the same bit-size are convertible may have been valid from a technical point of view, but still such code should get more attention. The rules for struct and union types could be made more fine-grained later, if the need arises. To suppress this warning, it's always possible to cast to an intermediate 'void *'.
2023-07-08lint: do not use portable type sizes in integer constraintsrillig
This reverts the change from tree.c 1.547 from 2023-07-03. Back then, I didn't know that the actual value from a type's 'portable size in bits' was not supposed to be used.
2023-07-08lint: warn about conversion from 128-bit to smaller integer typesrillig
2023-07-08lint: clean uprillig
PUSH nodes are not marked as binary, yet they have a left and a right operand. If none of the queries is enabled, omit the query from the debug log.
2023-07-08lint: enable more lint warnings for its own source coderillig
2023-07-08lint: fix handling of 'long double' in cross-compiled moderillig
When lint is compiled on x86-64 (where 'long double' has a 64-bit mantissa) and targets arm (where 'long double' has a 53-bit mantissa), warn if a constant cannot fit in the 'long double' of the target platform, not of the host platform.
2023-07-08lint: clarify the meaning of 'portable size in bits' of a typerillig
No functional change.
2023-07-08lint: use consistent conditional compilation guardsrillig
2023-07-07lint: only warn about traditional/C90 differences in migration moderillig
In C99 mode, there is no point warning about traditional C. No change in the tests, as a complete test suite would require several new test files, and migration mode is not used intensively.
2023-07-07lint: warn about function definitions without header declarationrillig
The existing warning was only issued for function declarations, not for function definitions. The interesting change in the tests is in msg_351.c. Many other tests use non-static functions due to their syntactic brevity. In these tests, the warning is disabled individually, to allow new functions to be added without generating warning 351.
2023-07-07lint: only skip 'unused' warnings after errors, not other warningsrillig
Previously, in -w mode, any warning suppressed further 'unused' warnings, even though there was no need to do that. This can be seen in the test gcc_attribute_var.c, where only the last unused variable from a function was marked as unused, the others slipped through. Fixed by counting the errors and the warnings separately and only combining them if actually desired.
2023-07-06lint: add type safety for accessing properties of basic typesrillig
No functional change.
2023-07-05tests/lint: spell platform identifiers for 'long double' consistentlyrillig
The test file names don't have a hyphen, so the identifiers shouldn't have one either.
2023-07-03lint: consistently use portable type size in integer constraintsrillig
Since tree.c 1.546 from 2023-07-03, lint no longer warned about possible loss of accuracy when converting from 'long' to 'int' on an ILP32 platform that uses 'unsigned long' for size_t, when run in portable mode (-p), which is enabled by default in the NetBSD build. The integer constraints avoid false-positive warnings by looking at the actual values an expression can take. The function can_represent is guarded by a condition that uses the portable_size_in_bits, but then internally used the opposite size_in_bits, which led to inconsistent results. The warning looks confusing though, as on an ILP32 platform, 'int' and 'long' have the same size and representation, therefore there cannot be an actual loss of accuracy. The warning may need to be reworded to explicitly mention the portability mode, in which sizeof(int) is assumed to be 3 instead of 4, to catch possible loss of accuracy on other platforms.
2023-07-03lint: sync usage messages with realityrillig
2023-07-03lint: invert the -u, -v and -z flagsrillig
Now they behave the same as in the manual page. No functional change.
2023-07-03lint: remove redundant comments for command line flagsrillig
2023-07-03lint: fix C11 mode to not allow C23 features (since yesterday)rillig
2023-07-03lint: clean up redundant castsrillig
2023-07-03lint: rename uppercase QUAD to LLONGrillig
No binary change.
2023-07-02lint: add initial support for C23rillig
Required by xsrc/external/mit/MesaLib.old, brw_eu_validate.c, which initializes a struct using empty braces: 'return (struct string){};'.
2023-07-02lint: allow empty statements in GCC statement expressionsrillig
2023-07-02lint: eliminate redundant conditionsrillig
2023-07-02lint: clean up variable names relating to structure paddingrillig
2023-07-02lint: rename 'quad' to 'signed int' or 'unsigned int'rillig
No functional change.
2023-07-02lint: use unsigned int for struct alignmentrillig
This gets rid of 'unsigned short', which saved a few bytes of memory but was inconvenient to deal with. No functional change.
2023-07-02lint: extend debug logging for declaration levelsrillig
Indent the debug logging according to the declaration level. Since there are a few cases where the enclosing declaration levels are modified, log the whole declaration level stack whenever a level begins or ends.
2023-07-02Fix HTTPS through Proxy.mlelstv
While a regular HTTP Proxy, requires the absolute URL with protocol and host part, yyou must only send the relative URL through a CONNECT tunnel (you are talking to the target server).
2023-07-02lint: initialize unnamed member like an unnamed bit-fieldrillig
See set_bit_field_width.
2023-07-02lint: clean up variable namesrillig
2023-07-01Use ENVIRONMENT sectionnia
2023-07-01lint: constify, reduce indentationrillig
No functional change.
2023-07-01lint: clean up comments in lint1.hrillig
2023-07-01lint: clean up duplicate and dead code for integer constantsrillig
No functional change.
2023-07-01lint: clean up typosrillig
2023-07-01tests/make: show how to use indirect conditions in the '?:' modifierrillig
2023-07-01lint: fix initialization of unnamed union memberrillig
2023-06-30audioplay.1: fix sentence punctuationgutteridge
2023-06-30lint: clean up names related to declaration levelsrillig
The previous prefix 'DK_' (declaration level kind) had a conflict with the 'DK_' (designator kind) in init.c, so change the prefix to 'DLK_'. The new name for dinfo_t is decl_level, which is more expressive. No functional change.
2023-06-30lint: fix handling of unnamed struct/union membersrillig
The support for unnamed struct/union members that was added in decl.c 1.60 from 2015-10-13 was simple but wrong. It didn't cover initializers of these structures and computed wrong sizes for structures containing anonymous unions. At that time, the handling of initializers was broken as well, it was fixed 6 years later in init.c 1.229 from 2021-12-22. Real-life examples for code that lint couldn't handle are: * external/bsd/jemalloc/dist/src/jemalloc.c * external/mit/xorg/lib/dri.old/Makefile
2023-06-30lint: replace macro for unique identifiers with functionrillig
No functional change.
2023-06-30lint: clean up handling of declarationsrillig
No functional change.
2023-06-30lint: fix computation of bit-field widthrillig
When bit-fields in packed structs were added on 2009-10-02, lint assumed that they would only use 'signed int' or 'unsigned int' as storage unit, even though C99 also allows _Bool. The cleanup commit for decl.c 1.225 from 2021-08-28 accidentally changed the rounding mode for bit-field storage units from round-up to round-down.
2023-06-30lint: clean up packing of structs and unionsrillig
No functional change outside debug mode.
2023-06-30lint: clean up tree.crillig
No functional change.
2023-06-30lint: make alignof(incomplete enum) an errorrillig
2023-06-30lint: use NULL for null pointer constantsrillig
No binary change.
2023-06-30lint: add query for assigning an integer 0 to a pointerrillig
2023-06-30tests/lint: extend test for sizeof and offsetofrillig