ci: Replace codeql PotentiallyDangerousFunction query with clang-tidy

The strerror() calls in test-errno-util.c are intentional so silence
clang-tidy there.
This commit is contained in:
Daan De Meyer
2026-03-20 23:31:51 +01:00
parent 84d51e252d
commit e6f1d9a5e5
3 changed files with 22 additions and 71 deletions
+18
View File
@@ -15,6 +15,7 @@ Checks: '
bugprone-suspicious-string-compare,
bugprone-swapped-arguments,
bugprone-tautological-type-limits,
bugprone-unsafe-functions,
bugprone-unused-return-value,
misc-header-include-cycle,
misc-include-cleaner,
@@ -50,6 +51,23 @@ CheckOptions:
varlink-io\.systemd\..*;
varlink-idl-common\.h;
unistd\.h
'
bugprone-unsafe-functions.ReportDefaultFunctions: false
bugprone-unsafe-functions.CustomFunctions: '
^fgets$,read_line(),is potentially dangerous;
^strtok$,extract_first_word(),is potentially dangerous;
^strsep$,extract_first_word(),is potentially dangerous;
^dup$,fcntl() with F_DUPFD_CLOEXEC,is potentially dangerous;
^htonl$,htobe32(),is confusing;
^htons$,htobe16(),is confusing;
^ntohl$,be32toh(),is confusing;
^ntohs$,be16toh(),is confusing;
^strerror$,STRERROR() or printf %m,is not thread-safe;
^accept$,accept4(),is not O_CLOEXEC-safe;
^dirname$,path_extract_directory(),is icky;
^basename$,path_extract_filename(),is icky;
^setmntent$,libmount_parse_fstab(),libmount parser should be used instead;
^getmntent$,mnt_table_next_fs(),libmount parser should be used instead
'
misc-header-include-cycle.IgnoredFilesList: 'glib-2.0'
WarningsAsErrors: '*'