mirror of
https://git.proxmox.com/git/mirror_zfs
synced 2025-04-28 11:40:17 +00:00
cstyle: ignore old non-POSIX types in macro invocations
In code generation macros, we often use names like `uint` when constructing handler functions. These are not being used as types, so exclude them from the admonishment to use POSIX type names. Sponsored-by: https://despairlabs.com/sponsor/ Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rob Norris <robn@despairlabs.com> Closes #16840
This commit is contained in:
parent
ba00a6f9a3
commit
0de8ae56f7
@ -695,10 +695,13 @@ line: while (<$filehandle>) {
|
||||
err("unary * followed by space");
|
||||
}
|
||||
}
|
||||
if ($check_posix_types) {
|
||||
if ($check_posix_types && !$in_macro_call) {
|
||||
# try to detect old non-POSIX types.
|
||||
# POSIX requires all non-standard typedefs to end in _t,
|
||||
# but historically these have been used.
|
||||
#
|
||||
# We don't check inside macro invocations because macros have
|
||||
# legitmate uses for these names in function generators.
|
||||
if (/\b(unchar|ushort|uint|ulong|u_int|u_short|u_long|u_char|quad)\b/) {
|
||||
err("non-POSIX typedef $1 used: use $old2posix{$1} instead");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user