History log of /netbsd-current/usr.bin/xlint/lint1/ckctype.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.12 19-Mar-2024 rillig

lint: keep invalid arguments in function calls

Previously, arguments of incomplete type or 'void' cleared all arguments
of the function call expression, requiring extra checks in later checks.

Invalid function calls are now exported to the .ln files, but that's
irrelevant in practice as these invalid function calls make lint1 fail,
after which xlint removes the .ln file.


# 1.11 09-Mar-2024 rillig

lint: inline accessor macros for tnode_t


# 1.10 05-Feb-2024 rillig

lint: make function call arguments directly accessible

Previously, the arguments of a function call expression were arranged in
a linear tree structure, from right to left. To allow easier access to
the arguments, store them in an array instead.


# 1.9 03-Dec-2023 rillig

lint: re-wrap comments

No functional change.


# 1.8 03-Dec-2023 rillig

lint: indent statement continuations consistently

No binary change.


# 1.7 13-Sep-2023 rillig

lint: prevent invalid memory access when checking an expression

In check_expr_misc, the left and right operands of an expression were
accessed even in the case of CON (constant), STRING (string literal) and
NAME (identifier), which led to invalid values in pointer variables.
These invalid values were not used though, but technically they invoked
undefined behavior.

Precede each access to the operands with a check that the expression
indeed has operands, except in those cases where the operand is known to
have operands by only looking at the code of the current function.


# 1.6 02-Aug-2023 rillig

lint: distinguish between arguments and parameters


Revision tags: netbsd-10-0-RC6 netbsd-10-0-RC5 netbsd-10-0-RC4 netbsd-10-0-RC3 netbsd-10-0-RC2 netbsd-10-0-RC1 netbsd-10-base
# 1.5 20-May-2022 rillig

lint: use __RCSID in lint mode as well

Since 1995-10-02, lint supports __asm statements and __asm modifiers.

No binary change.


# 1.4 19-Mar-2022 rillig

lint: be more specific in comment about <ctype.h> check

No binary change.


# 1.3 25-Jul-2021 rillig

lint: split is_ctype_function into separate parts

This reduces the number of string comparisons for function names that
start with 'is' or 'to'.

The tests now cover function names that start with 'is' or 'to' but are
not one of the well-known functions from ctype.h. This removes the '*'
in the output from gcov.

No functional change.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.2 05-Apr-2021 rillig

lint: inline macro in check for <ctype.h> functions

No functional change.


# 1.1 05-Apr-2021 rillig

lint: warn about for wrong type cast in argument to ctype.h functions

The argument to most of the functions from <ctype.h> "shall either be
representable as an 'unsigned char' or shall equal the value of the
macro EOF".

When confronted with the infamous warning 'array subscript has type
char', there are enough programmers who don't know the background of
that warning and thus fix it in a wrong way. Neither GCC nor Clang
explain its warning to target these programmers.

Both GCC and Clang warn about 'array subscript has type char', but they
ignore the other requirements of the <ctype.h> functions, even though
these are in the C standard library.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94182
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95177
https://stackoverflow.com/a/60696378


# 1.11 09-Mar-2024 rillig

lint: inline accessor macros for tnode_t


# 1.10 05-Feb-2024 rillig

lint: make function call arguments directly accessible

Previously, the arguments of a function call expression were arranged in
a linear tree structure, from right to left. To allow easier access to
the arguments, store them in an array instead.


# 1.9 03-Dec-2023 rillig

lint: re-wrap comments

No functional change.


# 1.8 03-Dec-2023 rillig

lint: indent statement continuations consistently

No binary change.


# 1.7 13-Sep-2023 rillig

lint: prevent invalid memory access when checking an expression

In check_expr_misc, the left and right operands of an expression were
accessed even in the case of CON (constant), STRING (string literal) and
NAME (identifier), which led to invalid values in pointer variables.
These invalid values were not used though, but technically they invoked
undefined behavior.

Precede each access to the operands with a check that the expression
indeed has operands, except in those cases where the operand is known to
have operands by only looking at the code of the current function.


# 1.6 02-Aug-2023 rillig

lint: distinguish between arguments and parameters


Revision tags: netbsd-10-0-RC5 netbsd-10-0-RC4 netbsd-10-0-RC3 netbsd-10-0-RC2 netbsd-10-0-RC1 netbsd-10-base
# 1.5 20-May-2022 rillig

lint: use __RCSID in lint mode as well

Since 1995-10-02, lint supports __asm statements and __asm modifiers.

No binary change.


# 1.4 19-Mar-2022 rillig

lint: be more specific in comment about <ctype.h> check

No binary change.


# 1.3 25-Jul-2021 rillig

lint: split is_ctype_function into separate parts

This reduces the number of string comparisons for function names that
start with 'is' or 'to'.

The tests now cover function names that start with 'is' or 'to' but are
not one of the well-known functions from ctype.h. This removes the '*'
in the output from gcov.

No functional change.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.2 05-Apr-2021 rillig

lint: inline macro in check for <ctype.h> functions

No functional change.


# 1.1 05-Apr-2021 rillig

lint: warn about for wrong type cast in argument to ctype.h functions

The argument to most of the functions from <ctype.h> "shall either be
representable as an 'unsigned char' or shall equal the value of the
macro EOF".

When confronted with the infamous warning 'array subscript has type
char', there are enough programmers who don't know the background of
that warning and thus fix it in a wrong way. Neither GCC nor Clang
explain its warning to target these programmers.

Both GCC and Clang warn about 'array subscript has type char', but they
ignore the other requirements of the <ctype.h> functions, even though
these are in the C standard library.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94182
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95177
https://stackoverflow.com/a/60696378


# 1.10 05-Feb-2024 rillig

lint: make function call arguments directly accessible

Previously, the arguments of a function call expression were arranged in
a linear tree structure, from right to left. To allow easier access to
the arguments, store them in an array instead.


# 1.9 03-Dec-2023 rillig

lint: re-wrap comments

No functional change.


# 1.8 03-Dec-2023 rillig

lint: indent statement continuations consistently

No binary change.


# 1.7 13-Sep-2023 rillig

lint: prevent invalid memory access when checking an expression

In check_expr_misc, the left and right operands of an expression were
accessed even in the case of CON (constant), STRING (string literal) and
NAME (identifier), which led to invalid values in pointer variables.
These invalid values were not used though, but technically they invoked
undefined behavior.

Precede each access to the operands with a check that the expression
indeed has operands, except in those cases where the operand is known to
have operands by only looking at the code of the current function.


# 1.6 02-Aug-2023 rillig

lint: distinguish between arguments and parameters


Revision tags: netbsd-10-0-RC4 netbsd-10-0-RC3 netbsd-10-0-RC2 netbsd-10-0-RC1 netbsd-10-base
# 1.5 20-May-2022 rillig

lint: use __RCSID in lint mode as well

Since 1995-10-02, lint supports __asm statements and __asm modifiers.

No binary change.


# 1.4 19-Mar-2022 rillig

lint: be more specific in comment about <ctype.h> check

No binary change.


# 1.3 25-Jul-2021 rillig

lint: split is_ctype_function into separate parts

This reduces the number of string comparisons for function names that
start with 'is' or 'to'.

The tests now cover function names that start with 'is' or 'to' but are
not one of the well-known functions from ctype.h. This removes the '*'
in the output from gcov.

No functional change.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.2 05-Apr-2021 rillig

lint: inline macro in check for <ctype.h> functions

No functional change.


# 1.1 05-Apr-2021 rillig

lint: warn about for wrong type cast in argument to ctype.h functions

The argument to most of the functions from <ctype.h> "shall either be
representable as an 'unsigned char' or shall equal the value of the
macro EOF".

When confronted with the infamous warning 'array subscript has type
char', there are enough programmers who don't know the background of
that warning and thus fix it in a wrong way. Neither GCC nor Clang
explain its warning to target these programmers.

Both GCC and Clang warn about 'array subscript has type char', but they
ignore the other requirements of the <ctype.h> functions, even though
these are in the C standard library.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94182
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95177
https://stackoverflow.com/a/60696378


# 1.9 03-Dec-2023 rillig

lint: re-wrap comments

No functional change.


# 1.8 03-Dec-2023 rillig

lint: indent statement continuations consistently

No binary change.


# 1.7 13-Sep-2023 rillig

lint: prevent invalid memory access when checking an expression

In check_expr_misc, the left and right operands of an expression were
accessed even in the case of CON (constant), STRING (string literal) and
NAME (identifier), which led to invalid values in pointer variables.
These invalid values were not used though, but technically they invoked
undefined behavior.

Precede each access to the operands with a check that the expression
indeed has operands, except in those cases where the operand is known to
have operands by only looking at the code of the current function.


# 1.6 02-Aug-2023 rillig

lint: distinguish between arguments and parameters


Revision tags: netbsd-10-0-RC1 netbsd-10-base
# 1.5 20-May-2022 rillig

lint: use __RCSID in lint mode as well

Since 1995-10-02, lint supports __asm statements and __asm modifiers.

No binary change.


# 1.4 19-Mar-2022 rillig

lint: be more specific in comment about <ctype.h> check

No binary change.


# 1.3 25-Jul-2021 rillig

lint: split is_ctype_function into separate parts

This reduces the number of string comparisons for function names that
start with 'is' or 'to'.

The tests now cover function names that start with 'is' or 'to' but are
not one of the well-known functions from ctype.h. This removes the '*'
in the output from gcov.

No functional change.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.2 05-Apr-2021 rillig

lint: inline macro in check for <ctype.h> functions

No functional change.


# 1.1 05-Apr-2021 rillig

lint: warn about for wrong type cast in argument to ctype.h functions

The argument to most of the functions from <ctype.h> "shall either be
representable as an 'unsigned char' or shall equal the value of the
macro EOF".

When confronted with the infamous warning 'array subscript has type
char', there are enough programmers who don't know the background of
that warning and thus fix it in a wrong way. Neither GCC nor Clang
explain its warning to target these programmers.

Both GCC and Clang warn about 'array subscript has type char', but they
ignore the other requirements of the <ctype.h> functions, even though
these are in the C standard library.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94182
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95177
https://stackoverflow.com/a/60696378


# 1.7 13-Sep-2023 rillig

lint: prevent invalid memory access when checking an expression

In check_expr_misc, the left and right operands of an expression were
accessed even in the case of CON (constant), STRING (string literal) and
NAME (identifier), which led to invalid values in pointer variables.
These invalid values were not used though, but technically they invoked
undefined behavior.

Precede each access to the operands with a check that the expression
indeed has operands, except in those cases where the operand is known to
have operands by only looking at the code of the current function.


# 1.6 02-Aug-2023 rillig

lint: distinguish between arguments and parameters


Revision tags: netbsd-10-base
# 1.5 20-May-2022 rillig

lint: use __RCSID in lint mode as well

Since 1995-10-02, lint supports __asm statements and __asm modifiers.

No binary change.


# 1.4 19-Mar-2022 rillig

lint: be more specific in comment about <ctype.h> check

No binary change.


# 1.3 25-Jul-2021 rillig

lint: split is_ctype_function into separate parts

This reduces the number of string comparisons for function names that
start with 'is' or 'to'.

The tests now cover function names that start with 'is' or 'to' but are
not one of the well-known functions from ctype.h. This removes the '*'
in the output from gcov.

No functional change.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.2 05-Apr-2021 rillig

lint: inline macro in check for <ctype.h> functions

No functional change.


# 1.1 05-Apr-2021 rillig

lint: warn about for wrong type cast in argument to ctype.h functions

The argument to most of the functions from <ctype.h> "shall either be
representable as an 'unsigned char' or shall equal the value of the
macro EOF".

When confronted with the infamous warning 'array subscript has type
char', there are enough programmers who don't know the background of
that warning and thus fix it in a wrong way. Neither GCC nor Clang
explain its warning to target these programmers.

Both GCC and Clang warn about 'array subscript has type char', but they
ignore the other requirements of the <ctype.h> functions, even though
these are in the C standard library.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94182
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95177
https://stackoverflow.com/a/60696378


# 1.6 02-Aug-2023 rillig

lint: distinguish between arguments and parameters


Revision tags: netbsd-10-base
# 1.5 20-May-2022 rillig

lint: use __RCSID in lint mode as well

Since 1995-10-02, lint supports __asm statements and __asm modifiers.

No binary change.


# 1.4 19-Mar-2022 rillig

lint: be more specific in comment about <ctype.h> check

No binary change.


# 1.3 25-Jul-2021 rillig

lint: split is_ctype_function into separate parts

This reduces the number of string comparisons for function names that
start with 'is' or 'to'.

The tests now cover function names that start with 'is' or 'to' but are
not one of the well-known functions from ctype.h. This removes the '*'
in the output from gcov.

No functional change.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.2 05-Apr-2021 rillig

lint: inline macro in check for <ctype.h> functions

No functional change.


# 1.1 05-Apr-2021 rillig

lint: warn about for wrong type cast in argument to ctype.h functions

The argument to most of the functions from <ctype.h> "shall either be
representable as an 'unsigned char' or shall equal the value of the
macro EOF".

When confronted with the infamous warning 'array subscript has type
char', there are enough programmers who don't know the background of
that warning and thus fix it in a wrong way. Neither GCC nor Clang
explain its warning to target these programmers.

Both GCC and Clang warn about 'array subscript has type char', but they
ignore the other requirements of the <ctype.h> functions, even though
these are in the C standard library.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94182
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95177
https://stackoverflow.com/a/60696378


# 1.5 20-May-2022 rillig

lint: use __RCSID in lint mode as well

Since 1995-10-02, lint supports __asm statements and __asm modifiers.

No binary change.


# 1.4 19-Mar-2022 rillig

lint: be more specific in comment about <ctype.h> check

No binary change.


# 1.3 25-Jul-2021 rillig

lint: split is_ctype_function into separate parts

This reduces the number of string comparisons for function names that
start with 'is' or 'to'.

The tests now cover function names that start with 'is' or 'to' but are
not one of the well-known functions from ctype.h. This removes the '*'
in the output from gcov.

No functional change.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.2 05-Apr-2021 rillig

lint: inline macro in check for <ctype.h> functions

No functional change.


# 1.1 05-Apr-2021 rillig

lint: warn about for wrong type cast in argument to ctype.h functions

The argument to most of the functions from <ctype.h> "shall either be
representable as an 'unsigned char' or shall equal the value of the
macro EOF".

When confronted with the infamous warning 'array subscript has type
char', there are enough programmers who don't know the background of
that warning and thus fix it in a wrong way. Neither GCC nor Clang
explain its warning to target these programmers.

Both GCC and Clang warn about 'array subscript has type char', but they
ignore the other requirements of the <ctype.h> functions, even though
these are in the C standard library.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94182
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95177
https://stackoverflow.com/a/60696378


# 1.4 19-Mar-2022 rillig

lint: be more specific in comment about <ctype.h> check

No binary change.


# 1.3 25-Jul-2021 rillig

lint: split is_ctype_function into separate parts

This reduces the number of string comparisons for function names that
start with 'is' or 'to'.

The tests now cover function names that start with 'is' or 'to' but are
not one of the well-known functions from ctype.h. This removes the '*'
in the output from gcov.

No functional change.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.2 05-Apr-2021 rillig

lint: inline macro in check for <ctype.h> functions

No functional change.


# 1.1 05-Apr-2021 rillig

lint: warn about for wrong type cast in argument to ctype.h functions

The argument to most of the functions from <ctype.h> "shall either be
representable as an 'unsigned char' or shall equal the value of the
macro EOF".

When confronted with the infamous warning 'array subscript has type
char', there are enough programmers who don't know the background of
that warning and thus fix it in a wrong way. Neither GCC nor Clang
explain its warning to target these programmers.

Both GCC and Clang warn about 'array subscript has type char', but they
ignore the other requirements of the <ctype.h> functions, even though
these are in the C standard library.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94182
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95177
https://stackoverflow.com/a/60696378


# 1.3 25-Jul-2021 rillig

lint: split is_ctype_function into separate parts

This reduces the number of string comparisons for function names that
start with 'is' or 'to'.

The tests now cover function names that start with 'is' or 'to' but are
not one of the well-known functions from ctype.h. This removes the '*'
in the output from gcov.

No functional change.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.2 05-Apr-2021 rillig

lint: inline macro in check for <ctype.h> functions

No functional change.


# 1.1 05-Apr-2021 rillig

lint: warn about for wrong type cast in argument to ctype.h functions

The argument to most of the functions from <ctype.h> "shall either be
representable as an 'unsigned char' or shall equal the value of the
macro EOF".

When confronted with the infamous warning 'array subscript has type
char', there are enough programmers who don't know the background of
that warning and thus fix it in a wrong way. Neither GCC nor Clang
explain its warning to target these programmers.

Both GCC and Clang warn about 'array subscript has type char', but they
ignore the other requirements of the <ctype.h> functions, even though
these are in the C standard library.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94182
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95177
https://stackoverflow.com/a/60696378


# 1.2 05-Apr-2021 rillig

lint: inline macro in check for <ctype.h> functions

No functional change.


# 1.1 05-Apr-2021 rillig

lint: warn about for wrong type cast in argument to ctype.h functions

The argument to most of the functions from <ctype.h> "shall either be
representable as an 'unsigned char' or shall equal the value of the
macro EOF".

When confronted with the infamous warning 'array subscript has type
char', there are enough programmers who don't know the background of
that warning and thus fix it in a wrong way. Neither GCC nor Clang
explain its warning to target these programmers.

Both GCC and Clang warn about 'array subscript has type char', but they
ignore the other requirements of the <ctype.h> functions, even though
these are in the C standard library.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94182
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95177
https://stackoverflow.com/a/60696378