Module Name: src Committed By: rillig Date: Fri Jul 8 21:19:07 UTC 2022
Modified Files: src/tests/usr.bin/xlint/lint1: queries.c src/usr.bin/xlint/common: inittyp.c src/usr.bin/xlint/lint1: tree.c Log Message: lint: fix edge cases in the query for redundant cast before assignment Casting from and to _Bool is only allowed outside strict bool mode. Outside strict bool mode, _Bool is an integer type, therefore return early if any of the operands has type _Bool. In strict bool mode, even casting from _Bool to _Bool is not allowed, as it is not needed in practice. Handle _Complex types before real floating-point types. Return early for _Complex types, as these are floating-point types as well. For pointer casts, not only flag casts to or from 'pointer to void', but also casts between the same types. In debug mode, when constructing the type '_Complex float', the type name of '_Complex' occurs in the debug log. Outside of debug mode, printing this type name is an error since this type keyword only occurs internally, when constructing a type. At that point, it is not supposed to occur in any user-visible message. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/queries.c cvs rdiff -u -r1.31 -r1.32 src/usr.bin/xlint/common/inittyp.c cvs rdiff -u -r1.473 -r1.474 src/usr.bin/xlint/lint1/tree.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.