Skip to content

qual: Add pre-commit flow (cppcheck/cpplint still report pre-existing issues) - #1199

Closed
mdeweerd wants to merge 4 commits into
RsyncProject:masterfrom
mdeweerd:flow/pre-commit
Closed

mdeweerd wants to merge 4 commits into
RsyncProject:masterfrom
mdeweerd:flow/pre-commit

Conversation

@mdeweerd

@mdeweerd mdeweerd commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Adds the pre-commit flow (.pre-commit-config.yaml, .github/workflows/pre-commit.yml, uncrustify.cfg, .gitignore) together with the fixes integrated in this branch. Given these integrated fixes, most pre-commit hooks pass on this branch — the cppcheck and cpplint hooks still fail on pre-existing issues in the C code (summarized in a comment below with the full notice lists).

Integrated fixes:

  • .cache/cppcheck/.gitkeep: the cppcheck hook passes --cppcheck-build-dir=.cache/cppcheck/, and cppcheck refuses to run when that directory does not exist (cppcheck: error: Directory '...' specified by --cppcheck-build-dir argument has to be existent). Git does not track empty directories, so without .gitkeep a fresh clone has no .cache/cppcheck/ and the hook fails immediately. The placeholder file keeps the directory present in every checkout; the workflow cleans cached files but preserves .gitkeep (find .cache -type f ! -name .gitkeep -delete).
  • uncrustify skipped in CI: the workflow runs the hooks with SKIP: no-commit-to-branch,uncrustify — uncrustify.cfg is added by this flow, but uncrustify is not enforced until the formatting rules are clarified.
  • mdformat reformats markdown automatically: the hook rewrites the markdown files on commit (ATX headers, fenced code blocks, blank line before fences, table/list normalization, single space after periods) — about 7.6k lines changed across 10 files, mostly NEWS.md and rsync.1.md. This can be skipped, split into a separate PR, or ignored via PR rules (e.g. path-based ignores for the .md files) if you prefer to keep this PR focused on the pre-commit flow itself.
  • cppcheck -DHAVE_GETGROUPS: config.h is generated and gitignored, so cppcheck in CI never sees it and analyzed the fallback branch — producing the misleading notice behind qual: fix cppcheck notice(s) #1195 (suggesting const for the buffer that getgroups() writes into). Defining it makes cppcheck analyze the real code paths, so no source change is needed.
  • External modules excluded (popt/, zlib/, rsync-web/, params.c): vendored/external content is left untouched by the hooks and by this branch.
  • No check-shebang-scripts-are-executable hook: per qual: Executable bit for files with shebang #1189, scripts keep their shebangs without the executable bit (they are not invoked directly), so file modes are left unchanged.
  • No mode changes and no changes to the external files appear in any commit of this branch.
  • The earlier shellcheck-disable and cppcheck-const commits were dropped: upstream ci: run ShellCheck on all tracked shell scripts #1198 already rewrote those scripts to pass ShellCheck, and qual: fix cppcheck notice(s) #1195's const suggestion no longer occurs with HAVE_GETGROUPS defined.

The remaining updates included in this PR (trailing blank-line removals in TODO and packaging/solaris/build_pkg.sh, and the automated mdformat/beautysh fixes described above) can each be split into separate PRs if desired — or ignored via updates to the PR rules (e.g. path-based ignores for those files) if you prefer to keep this PR focused on the pre-commit flow itself.

End-of-file whitespace fixes in non-shell files from the pre-commit run.

The shell-script reformatting is grouped in 'qual: reformat shell scripts (beautysh)'; the .cache/cppcheck/.gitkeep addition and the .gitignore update are part of 'qual: Add pre-commit flow'.
@mdeweerd
mdeweerd marked this pull request as draft November 23, 2026 00:54
@mdeweerd

mdeweerd commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor Author

cppcheck / cpplint hook results on this branch

Running the pre-commit flow on this branch, the cppcheck and cpplint hooks still fail. These are pre-existing issues in the upstream C code, not introduced by this branch — the branch only adds the hooks and their configuration. shellcheck, beautysh, mdformat and the generic pre-commit-hooks pass.

  • cppcheck: 230 notices — 38 errors, 11 warnings, 2 portability, 168 style, 11 information. Most frequent: clarifyCalculation (50), constVariablePointer (30), unusedStructMember (28), shiftTooManyBits (26), knownConditionTrueFalse (20), compareValueOutOfTypeRangeError (16).
  • cpplint: 257 errors across the processed files. Most frequent categories: runtime/int (122), build/include_what_you_use (48), build/include_order (24), runtime/printf (15), runtime/threadsafe_fn (13), build/include (7).

I can undertake actions to ignore or fix multiple instances of these (e.g. add suppressions to the cppcheck/cpplint hook configuration, or fix the code in follow-up PRs), but I am waiting for feedback on the preferred direction before doing so.
Full notice lists below. These can be addressed in follow-up PRs (or ignored via PR rules / suppressions) — the hook configuration in this PR is what surfaces them.

cppcheck notices (230)
authenticate.c(187): style (knownConditionTrueFalse): Condition 'user' is always true
cleanup.c(206): style (constVariablePointer): Variable 'pidf' can be declared as pointer to const
clientname.c(64): style (constVariablePointer): Variable 'env_str' can be declared as pointer to const
clientname.c(427): style (constVariablePointer): Variable 'res' can be declared as pointer to const
clientname.c(183): style (unusedStructMember): union member 'Anonymous4::ip6' is never used.
clientname.c(187): style (unusedStructMember): union member 'Anonymous4::unx' is never used.
clientname.c(179): style (unusedStructMember): struct member 'Anonymous6::src_addr' is never used.
clientname.c(180): style (unusedStructMember): struct member 'Anonymous6::dst_addr' is never used.
clientname.c(181): style (unusedStructMember): struct member 'Anonymous6::src_port' is never used.
clientname.c(182): style (unusedStructMember): struct member 'Anonymous6::dst_port' is never used.
clientname.c(185): style (unusedStructMember): struct member 'Anonymous7::src_addr' is never used.
clientname.c(186): style (unusedStructMember): struct member 'Anonymous7::dst_addr' is never used.
clientserver.c(1394): style (compareValueOutOfTypeRangeError): Comparing expression of type 'unsigned long' against value 4294967295. Condition is always false.
fileio.c(275): style (knownConditionTrueFalse): Condition 'len' is always true
exclude.c(264): style (constVariablePointer): Variable 'mention_rule_suffix' can be declared as pointer to const
flist.c(25): information (missingInclude): Include file: "rounding.h" not found.
flist.c(628): warning (oppositeInnerCondition): Opposite inner 'if' condition leads to a dead code block.
flist.c(1112): style (redundantAssignment): Variable 'basename_len' is reassigned a value before the old one has been used.
flist.c(2677): style (shadowVariable): Local variable 'pathname' shadows outer variable
flist.c(823): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
flist.c(1521): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
flist.c(1608): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
flist.c(1615): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
flist.c(1944): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
flist.c(2211): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
flist.c(2236): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
flist.c(2556): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
flist.c(2559): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
flist.c(2611): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
flist.c(2692): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
flist.c(2706): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
flist.c(2751): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
flist.c(3774): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
flist.c(3994): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
flist.c(2678): style (constVariablePointer): Variable 'dp' can be declared as pointer to const
flist.c(916): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
flist.c(1015): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
flist.c(3795): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
flist.c(916): error (shiftTooManyBits): Shifting 32-bit value by 32 bits is undefined behaviour
flist.c(1015): error (shiftTooManyBits): Shifting 32-bit value by 32 bits is undefined behaviour
flist.c(3795): error (shiftTooManyBits): Shifting 32-bit value by 32 bits is undefined behaviour
flist.c(1442): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
flist.c(1907): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
flist.c(1442): error (shiftTooManyBits): Shifting 32-bit value by 32 bits is undefined behaviour
flist.c(1903): warning (constStatement): Redundant code: Found unused member access.
generator.c(1018): style (knownConditionTrueFalse): Condition 'fd_r>=0' is always false
generator.c(1195): style (knownConditionTrueFalse): Condition 'can_reuse_basis_parent()' is always false
generator.c(1297): style (knownConditionTrueFalse): Condition 'can_reuse_basis_parent()' is always false
generator.c(1515): style (knownConditionTrueFalse): Condition 'match_level==3' is always false
generator.c(1516): style (knownConditionTrueFalse): Condition 'match_level==3' is always false
generator.c(1527): style (knownConditionTrueFalse): Condition 'cannot_hardlink' is always false
generator.c(1729): style (knownConditionTrueFalse): Condition '!no_atfd_mknod_primitive(mode)' is always false
inums.h(28): style (shadowVariable): Local variable 'human_readable' shadows outer variable
inums.h(35): style (shadowVariable): Local variable 'human_readable' shadows outer variable
inums.h(48): style (shadowVariable): Local variable 'human_readable' shadows outer variable
inums.h(55): style (shadowVariable): Local variable 'human_readable' shadows outer variable
generator.c(682): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
generator.c(715): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
generator.c(2193): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
generator.c(2319): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
generator.c(3136): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
generator.c(230): style (constVariablePointer): Variable 'past_space' can be declared as pointer to const
generator.c(1516): style (constVariablePointer): Variable 'lp' can be declared as pointer to const
generator.c(1955): style (constVariablePointer): Variable 'f' can be declared as pointer to const
generator.c(129): style (unusedStructMember): struct member 'deferred_symlink::file' is never used.
generator.c(130): style (unusedStructMember): struct member 'deferred_symlink::ndx' is never used.
generator.c(131): style (unusedStructMember): struct member 'deferred_symlink::fname' is never used.
generator.c(132): style (unusedStructMember): struct member 'deferred_symlink::itemizing' is never used.
generator.c(133): style (unusedStructMember): struct member 'deferred_symlink::code' is never used.
generator.c(567): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
generator.c(674): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
generator.c(733): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
generator.c(911): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
generator.c(914): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
generator.c(939): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
generator.c(1569): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
generator.c(2396): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
generator.c(2404): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
generator.c(2490): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
generator.c(2546): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
generator.c(567): error (shiftTooManyBits): Shifting 32-bit value by 32 bits is undefined behaviour
generator.c(674): error (shiftTooManyBits): Shifting 32-bit value by 32 bits is undefined behaviour
generator.c(733): error (shiftTooManyBits): Shifting 32-bit value by 32 bits is undefined behaviour
generator.c(911): error (shiftTooManyBits): Shifting 32-bit value by 32 bits is undefined behaviour
generator.c(914): error (shiftTooManyBits): Shifting 32-bit value by 32 bits is undefined behaviour
generator.c(939): error (shiftTooManyBits): Shifting 32-bit value by 32 bits is undefined behaviour
generator.c(1569): error (shiftTooManyBits): Shifting 32-bit value by 32 bits is undefined behaviour
generator.c(2396): error (shiftTooManyBits): Shifting 32-bit value by 32 bits is undefined behaviour
generator.c(2404): error (shiftTooManyBits): Shifting 32-bit value by 32 bits is undefined behaviour
generator.c(2490): error (shiftTooManyBits): Shifting 32-bit value by 32 bits is undefined behaviour
generator.c(2546): error (shiftTooManyBits): Shifting 32-bit value by 32 bits is undefined behaviour
generator.c(949): style (compareValueOutOfTypeRangeError): Comparing expression of type 'unsigned short' against value 4294901760. Condition is always true.
hashtable.c(569): style (duplicateExpression): Same expression 'c' found multiple times in chain of '|' operators.
hashtable.c(615): style (duplicateExpression): Same expression 'c' found multiple times in chain of '|' operators.
hashtable.c(668): style (duplicateExpression): Same expression 'c' found multiple times in chain of '|' operators.
hashtable.c(673): style (duplicateExpression): Same expression 'c' found multiple times in chain of '|' operators.
hashtable.c(159): error (shiftTooManyBits): Shifting 32-bit value by 32 bits is undefined behaviour
hashtable.c(105): style (compareValueOutOfTypeRangeError): Comparing expression of type 'signed short' against value 1073741823. Condition is always false.
io.c(2426): style (compareValueOutOfTypeRangeError): Comparing expression of type 'signed long' against value 2147483647. Condition is always true.
io.c(2457): style (compareValueOutOfTypeRangeError): Comparing expression of type 'signed long' against value 2147483647. Condition is always true.
io.c(753): style (knownConditionTrueFalse): Condition 'iobuf.in_fd>max_fd' is always true
io.c(935): style (knownConditionTrueFalse): Condition 'io_timeout' is always true
io.c(680): warning (invalidPrintfArgType_sint): %zd in format string (no. 1) requires 'ssize_t' but the argument type is 'unsigned int'.
io.c(680): warning (invalidPrintfArgType_sint): %zd in format string (no. 2) requires 'ssize_t' but the argument type is 'unsigned int'.
io.c(698): warning (invalidPrintfArgType_sint): %zd in format string (no. 1) requires 'ssize_t' but the argument type is 'unsigned int'.
io.c(698): warning (invalidPrintfArgType_sint): %zd in format string (no. 2) requires 'ssize_t' but the argument type is 'unsigned int'.
io.c(1442): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
io.c(1574): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
io.c(1594): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
io.c(2695): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
io.c(544): style (constVariablePointer): Variable 'eob' can be declared as pointer to const
io.c(1047): style (constVariablePointer): Variable 'data' can be declared as pointer to const
io.c(1058): style (constVariablePointer): Variable 'data' can be declared as pointer to const
io.c(1422): style (constVariablePointer): Variable 'eob' can be declared as pointer to const
io.c(2054): error (overlappingWriteUnion): Overlapping read/write of union is undefined behavior
io.c(2097): error (overlappingWriteUnion): Overlapping read/write of union is undefined behavior
io.c(2457): style (compareValueOutOfTypeRangeError): Comparing expression of type 'signed int' against value 2147483647. Condition is always true.
io.c(2467): portability (shiftNegativeLHS): Shifting a negative value is technically undefined behaviour
io.c(1241): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
io.c(1385): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
io.c(2099): error (overlappingWriteUnion): Overlapping read/write of union is undefined behavior
io.c(1241): error (shiftTooManyBits): Shifting 32-bit value by 32 bits is undefined behaviour
io.c(1385): error (shiftTooManyBits): Shifting 32-bit value by 32 bits is undefined behaviour
io.c(2158): error (shiftTooManyBits): Shifting 32-bit value by 32 bits is undefined behaviour
io.c(2467): error (shiftTooManyBits): Shifting 32-bit value by 32 bits is undefined behaviour
io.c(2580): style (compareValueOutOfTypeRangeError): Comparing expression of type 'signed short' against value 32767. Condition is always false.
io.c(2627): style (compareValueOutOfTypeRangeError): Comparing expression of type 'unsigned short' against value 65535. Condition is always false.
lib/acl.h(33): style (unusedStructMember): struct member 'rsync_acl_ent::tag' is never used.
lib/acl.h(34): style (unusedStructMember): struct member 'rsync_acl_ent::perm' is never used.
lib/acl.h(35): style (unusedStructMember): struct member 'rsync_acl_ent::id' is never used.
lib/addrinfo.h(129): style (unusedStructMember): struct member 'addrinfo::ai_flags' is never used.
lib/addrinfo.h(130): style (unusedStructMember): struct member 'addrinfo::ai_family' is never used.
lib/addrinfo.h(131): style (unusedStructMember): struct member 'addrinfo::ai_socktype' is never used.
lib/addrinfo.h(132): style (unusedStructMember): struct member 'addrinfo::ai_protocol' is never used.
lib/addrinfo.h(133): style (unusedStructMember): struct member 'addrinfo::ai_addrlen' is never used.
lib/addrinfo.h(134): style (unusedStructMember): struct member 'addrinfo::ai_addr' is never used.
lib/addrinfo.h(135): style (unusedStructMember): struct member 'addrinfo::ai_canonname' is never used.
lib/addrinfo.h(136): style (unusedStructMember): struct member 'addrinfo::ai_next' is never used.
lib/addrinfo.h(142): style (unusedStructMember): struct member 'sockaddr_storage::ss_family' is never used.
lib/addrinfo.h(143): style (unusedStructMember): struct member 'sockaddr_storage::ss_align' is never used.
lib/addrinfo.h(144): style (unusedStructMember): struct member 'sockaddr_storage::ss_padding' is never used.
lib/getaddrinfo.c(187): style (compareValueOutOfTypeRangeError): Comparing expression of type 'unsigned short' against value 2130706433. Condition is always false.
lib/inet_pton.c(110): error (uninitvar): Uninitialized variable: tmp
lib/mdfour.c(92): style (duplicateExpression): Same expression on both sides of '|'.
lib/mdfour.c(93): style (duplicateExpression): Same expression on both sides of '|'.
lib/snprintf.c(106): information (missingInclude): Include file: "config.h" not found.
lib/snprintf.c(763): style (knownConditionTrueFalse): Condition 'maxlen>0' is always true
lib/snprintf.c(1049): style (knownConditionTrueFalse): Condition 'caps' is always false
lib/snprintf.c(1064): style (knownConditionTrueFalse): Condition 'caps' is always false
lib/snprintf.c(279): error (va_list_usedBeforeStarted): va_list 'args' used before va_start() was called.
lib/snprintf.c(1246): error (va_list_usedBeforeStarted): va_list 'ap2' used before va_start() was called.
lib/snprintf.c(1247): error (va_list_usedBeforeStarted): va_list 'ap2' used before va_start() was called.
lib/snprintf.c(1248): error (va_list_usedBeforeStarted): va_list 'ap2' used before va_start() was called.
lib/snprintf.c(1440): warning (invalidPrintfArgType_sint): %d in format string (no. 2) requires 'int' but the argument type is 'const char *'.
lib/snprintf.c(1440): warning (invalidPrintfArgType_s): %s in format string (no. 3) requires 'char *' but the argument type is 'double'.
lib/snprintf.c(1440): error (wrongPrintfScanfArgNum): sprintf format string requires 5 parameters but only 4 are given.
lib/snprintf.c(1450): warning (invalidPrintfArgType_sint): %d in format string (no. 2) requires 'int' but the argument type is 'const char *'.
lib/snprintf.c(1450): warning (invalidPrintfArgType_s): %s in format string (no. 3) requires 'char *' but the argument type is 'double'.
lib/snprintf.c(1450): error (wrongPrintfScanfArgNum): sprintf format string requires 5 parameters but only 4 are given.
loadparm.c(46): information (missingInclude): Include file: "default-dont-compress.h" not found.
loadparm.c(372): information (missingInclude): Include file: "daemon-parm.h" not found.
loadparm.c(76): style (unusedStructMember): struct member 'parm_struct::flags' is never used.
log.c(25): information (missingInclude): Include file: "rounding.h" not found.
log.c(995): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
log.c(1014): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
log.c(871): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
log.c(871): error (shiftTooManyBits): Shifting 32-bit value by 32 bits is undefined behaviour
main.c(1758): style (redundantAssignment): Variable 'errno' is assigned an expression that holds the same value.
niceness.c(242): style (constVariablePointer): Variable 'setting' can be declared as pointer to const
options.c(1908): style (knownConditionTrueFalse): Condition 'rate_max<=(unsigned long)(bytes_max-511)/1024' is always false
options.c(992): style (constVariablePointer): Variable 'matched_op' can be declared as pointer to const
lib/compat.c(266): style (constVariablePointer): Variable 'fract' can be declared as pointer to const
receiver.c(646): style (knownConditionTrueFalse): Condition 'mapbuf' is always true
receiver.c(307): style (unusedLabelConfiguration): Label 'failed' is not used. There is #if in function body so the label might be used in code that is removed by the preprocessor.
receiver.c(106): style (shadowVariable): Local variable 'am_daemon' shadows outer variable
receiver.c(551): style (shadowVariable): Local variable 'len' shadows outer variable
receiver.c(237): style (unreadVariable): Variable 'cfd' is assigned a value that is never used.
receiver.c(494): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
receiver.c(991): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
receiver.c(494): error (shiftTooManyBits): Shifting 32-bit value by 32 bits is undefined behaviour
receiver.c(991): error (shiftTooManyBits): Shifting 32-bit value by 32 bits is undefined behaviour
rsync.c(499): style (knownConditionTrueFalse): Return value 'f1_nsec==f2_nsec' is always true
sender.c(428): style (knownConditionTrueFalse): Condition 'dfd<0' is always true
sender.c(431): style (knownConditionTrueFalse): Condition 'dfd<0' is always true
sender.c(453): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
sender.c(645): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
sender.c(762): style (clarifyCalculation): Clarify calculation precedence for '&' and '?'.
sender.c(453): error (shiftTooManyBits): Shifting 32-bit value by 32 bits is undefined behaviour
sender.c(645): error (shiftTooManyBits): Shifting 32-bit value by 32 bits is undefined behaviour
sender.c(762): error (shiftTooManyBits): Shifting 32-bit value by 32 bits is undefined behaviour
byteorder.h(39): style (shadowVariable): Argument 'buf' shadows outer variable
byteorder.h(48): style (shadowVariable): Argument 'buf' shadows outer variable
byteorder.h(57): style (shadowVariable): Argument 'buf' shadows outer variable
byteorder.h(63): style (shadowVariable): Argument 'buf' shadows outer variable
byteorder.h(153): style (shadowVariable): Argument 'buf' shadows outer variable
byteorder.h(159): style (shadowVariable): Argument 'buf' shadows outer variable
syscall.c(3123): error (preprocessorErrorDirective): #error Need utimes or utime function.
syscall.c(0): information (noValidConfiguration): This file is not analyzed. No working configuration could be extracted. Use -v for more details.
t_chmod_secure.c(143): style (knownConditionTrueFalse): Condition 'leaf_chmod_nofollow_supported()' is always false
t_safe_arg.c(43): style (constVariablePointer): Variable 'r' can be declared as pointer to const
t_stub.c(134): style (duplicateExpressionTernary): Same expression in both branches of ternary operator.
testsuite/fixtures/progress-clock.c(5): error (syntaxError): failed to evaluate #if condition, undefined function-like macro invocation: __GLIBC_PREREQ( ... )
testsuite/tools/dirfd-probe.c(1): information (missingInclude): Include file: "config.h" not found.
testsuite/fixtures/stdio-error.c(119): style (constVariablePointer): Variable 'reader' can be declared as pointer to const
token.c(310): style (compareValueOutOfTypeRangeError): Comparing expression of type 'signed short' against value 32768. Condition is always false.
token.c(424): style (compareValueOutOfTypeRangeError): Comparing expression of type 'signed short' against value 32768. Condition is always true.
token.c(481): style (compareValueOutOfTypeRangeError): Comparing expression of type 'signed short' against value 65535. Condition is always false.
token.c(704): style (compareValueOutOfTypeRangeError): Comparing expression of type 'signed short' against value 65535. Condition is always false.
token.c(707): portability (shiftNegativeLHS): Shifting a negative value is technically undefined behaviour
uidlist.c(118): style (constVariablePointer): Variable 'pass' can be declared as pointer to const
uidlist.c(135): style (constVariablePointer): Variable 'grp' can be declared as pointer to const
uidlist.c(160): style (constVariablePointer): Variable 'pass' can be declared as pointer to const
uidlist.c(186): style (constVariablePointer): Variable 'grp' can be declared as pointer to const
uidlist.c(299): style (constVariablePointer): Variable 'last' can be declared as pointer to const
uidlist.c(342): style (constVariablePointer): Variable 'list' can be declared as pointer to const
uidlist.c(359): style (constVariablePointer): Variable 'list' can be declared as pointer to const
uidlist.c(390): style (constVariablePointer): Variable 'list' can be declared as pointer to const
uidlist.c(420): style (constVariablePointer): Variable 'node' can be declared as pointer to const
uidlist.c(440): style (constVariablePointer): Variable 'node' can be declared as pointer to const
usage.c(23): information (missingInclude): Include file: "git-version.h" not found.
usage.c(24): information (missingInclude): Include file: "default-cvsignore.h" not found.
usage.c(368): information (missingInclude): Include file: "help-rsync.h" not found.
usage.c(381): information (missingInclude): Include file: "help-rsyncd.h" not found.
usage.c(249): style (constVariablePointer): Variable 'tok' can be declared as pointer to const
util1.c(772): style (constVariablePointer): Variable 'dname' can be declared as pointer to const
util1.c(1245): style (constVariablePointer): Variable 'start' can be declared as pointer to const
match.c(87): style (compareValueOutOfTypeRangeError): Comparing expression of type 'unsigned short' against value 65536. Condition is always true.
match.c(98): style (compareValueOutOfTypeRangeError): Comparing expression of type 'unsigned short' against value 65536. Condition is always false.
match.c(219): style (compareValueOutOfTypeRangeError): Comparing expression of type 'unsigned short' against value 65536. Condition is always false.
match.c(92): warning (sizeofwithnumericparameter): Suspicious usage of 'sizeof' with a numeric constant as parameter.
cpplint notices (257 lines, 257 total errors)
cleanup.c:133:  Add #include <cstdio> for fputc  [build/include_what_you_use] [4]
getfsdev.c:18:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
getfsdev.c:18:  Add #include <cstdio> for printf  [build/include_what_you_use] [4]
hashtable.c:62:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
hashtable.c:72:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
hashtable.c:117:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
hashtable.c:58:  Add #include <cstdio> for snprintf  [build/include_what_you_use] [4]
lib/md5.c:285:  Never use sprintf. Use snprintf instead.  [runtime/printf] [5]
lib/pool_alloc.c:16:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
lib/pool_alloc.c:17:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
lib/pool_alloc.c:381:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
lib/pool_alloc.c:397:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
lib/pool_alloc.c:398:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
lib/pool_alloc.c:380:  Add #include <cstdio> for snprintf  [build/include_what_you_use] [4]
lib/pool_alloc.c:1:  lib/pool_alloc.c should include its header file lib/pool_alloc.h  [build/include] [5]
lib/snprintf.c:158:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
lib/snprintf.c:160:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
lib/snprintf.c:585:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
lib/snprintf.c:604:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
lib/snprintf.c:656:  Use int16_t/int64_t/etc, rather than the C type short  [runtime/int] [4]
lib/snprintf.c:658:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
lib/snprintf.c:732:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
lib/snprintf.c:739:  Use int16_t/int64_t/etc, rather than the C type short  [runtime/int] [4]
lib/snprintf.c:741:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
lib/snprintf.c:798:  Empty loop bodies should use {} or continue  [whitespace/empty_loop_body] [5]
lib/snprintf.c:948:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
lib/snprintf.c:1280:  Never use sprintf. Use snprintf instead.  [runtime/printf] [5]
lib/snprintf.c:1323:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
lib/snprintf.c:1364:  Never use sprintf. Use snprintf instead.  [runtime/printf] [5]
lib/snprintf.c:1379:  Never use sprintf. Use snprintf instead.  [runtime/printf] [5]
lib/snprintf.c:1394:  Never use sprintf. Use snprintf instead.  [runtime/printf] [5]
lib/snprintf.c:1410:  Never use sprintf. Use snprintf instead.  [runtime/printf] [5]
lib/snprintf.c:1439:  %N$ formats are unconventional.  Try rewriting to avoid them.  [runtime/printf_format] [2]
lib/snprintf.c:1440:  Never use sprintf. Use snprintf instead.  [runtime/printf] [5]
lib/snprintf.c:1440:  %N$ formats are unconventional.  Try rewriting to avoid them.  [runtime/printf_format] [2]
lib/snprintf.c:1449:  %N$ formats are unconventional.  Try rewriting to avoid them.  [runtime/printf_format] [2]
lib/snprintf.c:1450:  Never use sprintf. Use snprintf instead.  [runtime/printf] [5]
lib/snprintf.c:1450:  %N$ formats are unconventional.  Try rewriting to avoid them.  [runtime/printf_format] [2]
lib/snprintf.c:1462:  Never use sprintf. Use snprintf instead.  [runtime/printf] [5]
lib/snprintf.c:1475:  Never use sprintf. Use snprintf instead.  [runtime/printf] [5]
lib/snprintf.c:1485:  Never use sprintf. Use snprintf instead.  [runtime/printf] [5]
lib/snprintf.c:1502:  Never use sprintf. Use snprintf instead.  [runtime/printf] [5]
lib/sysacls.h:227:  Use int16_t/int64_t/etc, rather than the C type short  [runtime/int] [4]
lib/sysacls.h:228:  Use int16_t/int64_t/etc, rather than the C type short  [runtime/int] [4]
lib/sysacls.h:236:  Use int16_t/int64_t/etc, rather than the C type short  [runtime/int] [4]
loadparm.c:577:  Add #include <cstdio> for sscanf  [build/include_what_you_use] [4]
match.c:137:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
match.c:184:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
match.c:195:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
match.c:203:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
match.c:274:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
niceness.c:104:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
niceness.c:251:  Add #include <cstdio> for snprintf  [build/include_what_you_use] [4]
options.c:25:  Found C system header after other header. Should be: options.h, c system, c++ system, other.  [build/include_order] [4]
options.c:268:  Use int16_t/int64_t/etc, rather than the C type short  [runtime/int] [4]
options.c:365:  Use int16_t/int64_t/etc, rather than the C type short  [runtime/int] [4]
options.c:448:  Use int16_t/int64_t/etc, rather than the C type short  [runtime/int] [4]
options.c:500:  Use int16_t/int64_t/etc, rather than the C type short  [runtime/int] [4]
options.c:554:  Use int16_t/int64_t/etc, rather than the C type short  [runtime/int] [4]
options.c:2083:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
options.c:2086:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
options.c:3382:  At least two spaces is best between code and comments  [whitespace/comments] [2]
options.c:3336:  Add #include <cstdio> for snprintf  [build/include_what_you_use] [4]
options.c:3382:  Add #include <string> for string  [build/include_what_you_use] [4]
simd-checksum-x86_64.cpp:71:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
simd-checksum-x86_64.cpp:72:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
simd-checksum-x86_64.cpp:504:  At least two spaces is best between code and comments  [whitespace/comments] [2]
simd-checksum-x86_64.cpp:624:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
simd-checksum-x86_64.cpp:742:  Add #include <cstdio> for printf  [build/include_what_you_use] [4]
t_chmod_secure.c:18:  Found C system header after other header. Should be: t_chmod_secure.h, c system, c++ system, other.  [build/include_order] [4]
t_chmod_secure.c:29:  Use int16_t/int64_t/etc, rather than the C type short  [runtime/int] [4]
t_chmod_secure.c:154:  Add #include <cstdio> for fprintf  [build/include_what_you_use] [4]
t_clean_fname.c:10:  Found C system header after other header. Should be: t_clean_fname.h, c system, c++ system, other.  [build/include_order] [4]
t_clean_fname.c:15:  Use int16_t/int64_t/etc, rather than the C type short  [runtime/int] [4]
t_safe_arg.c:12:  Found C system header after other header. Should be: t_safe_arg.h, c system, c++ system, other.  [build/include_order] [4]
t_symlink_secure.c:12:  Found C system header after other header. Should be: t_symlink_secure.h, c system, c++ system, other.  [build/include_order] [4]
t_symlink_secure.c:30:  Use int16_t/int64_t/etc, rather than the C type short  [runtime/int] [4]
t_symlink_secure.c:157:  Add #include <cstdio> for fprintf  [build/include_what_you_use] [4]
testsuite/tools/dirfd-probe.c:3:  Found C system header after other header. Should be: dirfd-probe.h, c system, c++ system, other.  [build/include_order] [4]
testsuite/tools/dirfd-probe.c:4:  Found C system header after other header. Should be: dirfd-probe.h, c system, c++ system, other.  [build/include_order] [4]
testsuite/tools/dirfd-probe.c:5:  Found C system header after other header. Should be: dirfd-probe.h, c system, c++ system, other.  [build/include_order] [4]
testsuite/tools/dirfd-probe.c:6:  Found C system header after other header. Should be: dirfd-probe.h, c system, c++ system, other.  [build/include_order] [4]
testsuite/tools/dirfd-probe.c:7:  Found C system header after other header. Should be: dirfd-probe.h, c system, c++ system, other.  [build/include_order] [4]
testsuite/tools/dirfd-probe.c:8:  Found C system header after other header. Should be: dirfd-probe.h, c system, c++ system, other.  [build/include_order] [4]
testsuite/tools/dirfd-probe.c:9:  Found C system header after other header. Should be: dirfd-probe.h, c system, c++ system, other.  [build/include_order] [4]
testsuite/tools/dirfd-probe.c:10:  Found C system header after other header. Should be: dirfd-probe.h, c system, c++ system, other.  [build/include_order] [4]
testsuite/tools/dirfd-probe.c:11:  Found C system header after other header. Should be: dirfd-probe.h, c system, c++ system, other.  [build/include_order] [4]
token.c:24:  Found C system header after other header. Should be: token.h, c system, c++ system, other.  [build/include_order] [4]
usage.c:271:  Consider using strtok_r(...) instead of strtok(...) for improved thread safety.  [runtime/threadsafe_fn] [2]
usage.c:272:  Consider using strtok_r(...) instead of strtok(...) for improved thread safety.  [runtime/threadsafe_fn] [2]
usage.c:325:  Add #include <cstdio> for fflush  [build/include_what_you_use] [4]
wildtest.c:23:  Do not include .c files from other packages  [build/include] [4]
wildtest.c:207:  Add #include <string> for string  [build/include_what_you_use] [4]
wildtest.c:223:  Add #include <cstdio> for printf  [build/include_what_you_use] [4]
xattrs.c:228:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
xattrs.c:233:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
xattrs.c:770:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
xattrs.c:1346:  Add #include <cstdio> for snprintf  [build/include_what_you_use] [4]
exclude.c:1837:  Add #include <cstdio> for fclose  [build/include_what_you_use] [4]
flist.c:148:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
flist.c:843:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
flist.c:845:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
flist.c:1596:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
flist.c:1598:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
flist.c:3780:  Add #include <cstdio> for snprintf  [build/include_what_you_use] [4]
generator.c:820:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
generator.c:872:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
generator.c:873:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
generator.c:2367:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
generator.c:272:  Add #include <cstdio> for sscanf  [build/include_what_you_use] [4]
getgroups.c:51:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
getgroups.c:57:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
getgroups.c:58:  Add #include <cstdio> for printf  [build/include_what_you_use] [4]
lib/getaddrinfo.c:173:  Use int16_t/int64_t/etc, rather than the C type short  [runtime/int] [4]
lib/getaddrinfo.c:221:  Use int16_t/int64_t/etc, rather than the C type short  [runtime/int] [4]
lib/getaddrinfo.c:408:  Are you taking an address of a cast?  This is dangerous: could be a temp var.  Take the address before doing the cast, rather than after  [runtime/casting] [4]
lib/getaddrinfo.c:464:  Add #include <cstdio> for snprintf  [build/include_what_you_use] [4]
lib/inet_ntop.c:166:  If you can, use sizeof(tp) instead of 5 as the 2nd arg to snprintf.  [runtime/printf] [3]
lib/inet_ntop.c:166:  Add #include <cstdio> for snprintf  [build/include_what_you_use] [4]
progress.c:56:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
progress.c:76:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
progress.c:116:  Add #include <cstdio> for snprintf  [build/include_what_you_use] [4]
rsync.h:353:  Found C system header after other header. Should be: rsync.h, c system, c++ system, other.  [build/include_order] [4]
rsync.h:506:  "grp.h" already included at rsync.h:446  [build/include] [4]
rsync.h:604:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
rsync.h:628:  Use int16_t/int64_t/etc, rather than the C type short  [runtime/int] [4]
rsync.h:659:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
rsync.h:662:  Use int16_t/int64_t/etc, rather than the C type short  [runtime/int] [4]
rsync.h:668:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
rsync.h:706:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
rsync.h:712:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
rsync.h:724:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
rsync.h:727:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
rsync.h:744:  Use int16_t/int64_t/etc, rather than the C type short  [runtime/int] [4]
rsync.h:842:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
rsync.h:1020:  Use int16_t/int64_t/etc, rather than the C type short  [runtime/int] [4]
rsync.h:1494:  Use int16_t/int64_t/etc, rather than the C type short  [runtime/int] [4]
sender.c:361:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
sender.c:674:  Add #include <cstdio> for snprintf  [build/include_what_you_use] [4]
support/savetransfer.c:144:  Add #include <cstdio> for fprintf  [build/include_what_you_use] [4]
t_rename_secure.c:9:  Found C system header after other header. Should be: t_rename_secure.h, c system, c++ system, other.  [build/include_order] [4]
t_rename_secure.c:20:  Use int16_t/int64_t/etc, rather than the C type short  [runtime/int] [4]
t_rename_secure.c:203:  Add #include <cstdio> for fprintf  [build/include_what_you_use] [4]
t_secure_relpath.c:29:  Found C system header after other header. Should be: t_secure_relpath.h, c system, c++ system, other.  [build/include_order] [4]
t_secure_relpath.c:40:  Use int16_t/int64_t/etc, rather than the C type short  [runtime/int] [4]
t_secure_relpath.c:50:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
t_secure_relpath.c:51:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
t_secure_relpath.c:55:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
t_secure_relpath.c:252:  Add #include <cstdio> for fprintf  [build/include_what_you_use] [4]
testrun.c:51:  Add #include <cstdio> for fprintf  [build/include_what_you_use] [4]
util1.c:132:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
util1.c:133:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
util1.c:1051:  Consider using strtok_r(...) instead of strtok(...) for improved thread safety.  [runtime/threadsafe_fn] [2]
util1.c:1752:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
util1.c:1741:  Add #include <cstdio> for snprintf  [build/include_what_you_use] [4]
access.c:96:  Are you taking an address of a cast?  This is dangerous: could be a temp var.  Take the address before doing the cast, rather than after  [runtime/casting] [4]
access.c:101:  Are you taking an address of a cast?  This is dangerous: could be a temp var.  Take the address before doing the cast, rather than after  [runtime/casting] [4]
access.c:118:  Are you taking an address of a cast?  This is dangerous: could be a temp var.  Take the address before doing the cast, rather than after  [runtime/casting] [4]
access.c:191:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
access.c:242:  Are you taking an address of a cast?  This is dangerous: could be a temp var.  Take the address before doing the cast, rather than after  [runtime/casting] [4]
access.c:243:  Are you taking an address of a cast?  This is dangerous: could be a temp var.  Take the address before doing the cast, rather than after  [runtime/casting] [4]
access.c:334:  Consider using strtok_r(...) instead of strtok(...) for improved thread safety.  [runtime/threadsafe_fn] [2]
authenticate.c:188:  Consider using strtok_r(...) instead of strtok(...) for improved thread safety.  [runtime/threadsafe_fn] [2]
authenticate.c:230:  Add #include <cstdio> for fgets  [build/include_what_you_use] [4]
batch.c:23:  Found C system header after other header. Should be: batch.h, c system, c++ system, other.  [build/include_order] [4]
batch.c:24:  Found C system header after other header. Should be: batch.h, c system, c++ system, other.  [build/include_order] [4]
byteorder.h:75:  At least two spaces is best between code and comments  [whitespace/comments] [2]
byteorder.h:75:  Should have a space between // and comment  [whitespace/comments] [4]
compat.c:792:  Add #include <cstdio> for fprintf  [build/include_what_you_use] [4]
lib/addrinfo.h:142:  Use int16_t/int64_t/etc, rather than the C type short  [runtime/int] [4]
lib/addrinfo.h:143:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
lib/addrinfo.h:144:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
lib/addrinfo.h:144:  Do not use variable-length arrays.  Use an appropriately named ('k' followed by CamelCase) compile-time constant for the size.  [runtime/arrays] [1]
log.c:1069:  Add #include <cstdio> for snprintf  [build/include_what_you_use] [4]
socket.c:28:  Found C system header after other header. Should be: socket.h, c system, c++ system, other.  [build/include_order] [4]
socket.c:846:  Consider using strtok_r(...) instead of strtok(...) for improved thread safety.  [runtime/threadsafe_fn] [2]
socket.c:1076:  Add #include <cstdio> for fprintf  [build/include_what_you_use] [4]
t_acl.c:22:  Found C system header after other header. Should be: t_acl.h, c system, c++ system, other.  [build/include_order] [4]
testsuite/fixtures/stdio-error.c:14:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
tls.c:38:  Found C system header after other header. Should be: tls.h, c system, c++ system, other.  [build/include_order] [4]
tls.c:224:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
tls.c:229:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
tls.c:283:  Add #include <cstdio> for fprintf  [build/include_what_you_use] [4]
trimslash.c:44:  Add #include <cstdio> for printf  [build/include_what_you_use] [4]
clientname.c:331:  Are you taking an address of a cast?  This is dangerous: could be a temp var.  Take the address before doing the cast, rather than after  [runtime/casting] [4]
clientname.c:526:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
clientserver.c:564:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
clientserver.c:765:  Consider using getpwuid_r(...) instead of getpwuid(...) for improved thread safety.  [runtime/threadsafe_fn] [2]
clientserver.c:1000:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
clientserver.c:1135:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
clientserver.c:1164:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
clientserver.c:1364:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
clientserver.c:1385:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
clientserver.c:1394:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
clientserver.c:1557:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
clientserver.c:1570:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
clientserver.c:1867:  Add #include <cstdio> for fprintf  [build/include_what_you_use] [4]
fileio.c:347:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
fileio.c:385:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
io.c:34:  Found C system header after other header. Should be: io.h, c system, c++ system, other.  [build/include_order] [4]
io.c:1842:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
io.c:1881:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
io.c:2003:  Use int16_t/int64_t/etc, rather than the C type short  [runtime/int] [4]
io.c:2112:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
io.c:2124:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
io.c:2137:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
io.c:2246:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
io.c:2256:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
io.c:2261:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
io.c:2267:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
io.c:2294:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
io.c:2333:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
io.c:2335:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
io.c:2379:  Use int16_t/int64_t/etc, rather than the C type short  [runtime/int] [4]
io.c:2629:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
io.c:2672:  Add #include <cstdio> for vsnprintf  [build/include_what_you_use] [4]
io.c:30:  io.c should include its header file io.h  [build/include] [5]
lib/acl.c:416:  Add #include <cstdio> for snprintf  [build/include_what_you_use] [4]
lib/compat.c:279:  Add #include <cstdio> for snprintf  [build/include_what_you_use] [4]
lib/mdfour.c:238:  Add #include <cstdio> for printf  [build/include_what_you_use] [4]
lib/permstring.c:23:  lib/permstring.c should include its header file lib/permstring.h  [build/include] [5]
lib/sysacls.c:1445:  Multi-line string ("...") found.  This lint script doesn't do well with such strings, and may give bogus warnings.  Use C++11 raw strings or concatenation instead.  [readability/multiline_string] [5]
lib/sysacls.c:1445:  Use operator || instead of or  [readability/alt_tokens] [2]
lib/sysacls.c:1446:  Multi-line string ("...") found.  This lint script doesn't do well with such strings, and may give bogus warnings.  Use C++11 raw strings or concatenation instead.  [readability/multiline_string] [5]
lib/sysacls.c:1446:  Use operator || instead of or  [readability/alt_tokens] [2]
lib/sysacls.c:1446:  Use operator || instead of or  [readability/alt_tokens] [2]
lib/sysacls.c:1446:  Use operator || instead of or  [readability/alt_tokens] [2]
lib/sysacls.c:1455:  Multi-line string ("...") found.  This lint script doesn't do well with such strings, and may give bogus warnings.  Use C++11 raw strings or concatenation instead.  [readability/multiline_string] [5]
lib/sysacls.c:1456:  Multi-line string ("...") found.  This lint script doesn't do well with such strings, and may give bogus warnings.  Use C++11 raw strings or concatenation instead.  [readability/multiline_string] [5]
lib/sysacls.c:1456:  Use operator || instead of or  [readability/alt_tokens] [2]
lib/sysacls.c:1456:  Use operator || instead of or  [readability/alt_tokens] [2]
lib/sysacls.c:1916:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
lib/wildmatch.c:369:  Add #include <string> for string  [build/include_what_you_use] [4]
lib/wildmatch.c:12:  lib/wildmatch.c should include its header file lib/wildmatch.h  [build/include] [5]
lib/wildmatch.h:6:  Add #include <string> for string  [build/include_what_you_use] [4]
main.c:281:  Consider using getpwuid_r(...) instead of getpwuid(...) for improved thread safety.  [runtime/threadsafe_fn] [2]
main.c:1816:  Add #include <cstdio> for snprintf  [build/include_what_you_use] [4]
receiver.c:601:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
receiver.c:642:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
receiver.c:410:  Add #include <cstdio> for snprintf  [build/include_what_you_use] [4]
rounding.c:23:  Use int16_t/int64_t/etc, rather than the C type long  [runtime/int] [4]
syscall.c:47:  "sys/syscall.h" already included at syscall.c:43  [build/include] [4]
syscall.c:3792:  At least two spaces is best between code and comments  [whitespace/comments] [2]
syscall.c:3697:  Add #include <cstdio> for snprintf  [build/include_what_you_use] [4]
t_hashtable_overflow.c:25:  Use int16_t/int64_t/etc, rather than the C type short  [runtime/int] [4]
t_hashtable_overflow.c:48:  Add #include <cstdio> for fprintf  [build/include_what_you_use] [4]
t_stub.c:79:  Add #include <cstdio> for fprintf  [build/include_what_you_use] [4]
t_unsafe.c:34:  Use int16_t/int64_t/etc, rather than the C type short  [runtime/int] [4]
t_unsafe.c:44:  Add #include <cstdio> for printf  [build/include_what_you_use] [4]
uidlist.c:118:  Consider using getpwuid_r(...) instead of getpwuid(...) for improved thread safety.  [runtime/threadsafe_fn] [2]
uidlist.c:135:  Consider using getgrgid_r(...) instead of getgrgid(...) for improved thread safety.  [runtime/threadsafe_fn] [2]
uidlist.c:160:  Consider using getpwnam_r(...) instead of getpwnam(...) for improved thread safety.  [runtime/threadsafe_fn] [2]
uidlist.c:186:  Consider using getgrnam_r(...) instead of getgrnam(...) for improved thread safety.  [runtime/threadsafe_fn] [2]
uidlist.c:221:  If you can, use sizeof(gidbuf) instead of 32 as the 2nd arg to snprintf.  [runtime/printf] [3]
uidlist.c:223:  If you can, use sizeof(gidbuf+pos) instead of 21 as the 2nd arg to snprintf.  [runtime/printf] [3]
uidlist.c:584:  Consider using getpwuid_r(...) instead of getpwuid(...) for improved thread safety.  [runtime/threadsafe_fn] [2]
uidlist.c:223:  Add #include <cstdio> for snprintf  [build/include_what_you_use] [4]

@mdeweerd mdeweerd changed the title qual: Add pre-commit flow (hooks pass with integrated fixes) qual: Add pre-commit flow (cppcheck/cpplint still report pre-existing issues) Nov 23, 2026
@mdeweerd
mdeweerd force-pushed the flow/pre-commit branch 2 times, most recently from 907a660 to 882d878 Compare November 23, 2026 02:12
@steadytao

Copy link
Copy Markdown
Member

As mentioned previously. pre-commit is not a fit. cpplint is also Google's C++ linter, also not needed. Superseded by #1201

@steadytao steadytao closed this Nov 23, 2026
@mdeweerd

Copy link
Copy Markdown
Contributor Author

As mentioned previously. pre-commit is not a fit. cpplint is also Google's C++ linter, also not needed. Superseded by #1201

If you mentioned it, I overlooked it or misunderstood - the only comment I know (#982 (comment)) - was for an old PR with conflicts.

Through the hooks, pre-commit also helps maintain a consistent style.

Anyway, not proposing again & will remove my fork.

@mdeweerd

Copy link
Copy Markdown
Contributor Author

Also note that several of the cppcheck notices reported through the pre-commit workflow merit attention. For instance, I know that "(shiftTooManyBits): Shifting 32-bit value by 32 bits is undefined behaviour" is real (I had an intel processor not honoring a 32-bit shift, the value stayed the same), and others are at least suspicious/fixable.

@steadytao

Copy link
Copy Markdown
Member

If you mentioned it, I overlooked it or misunderstood

Ah, no. Sorry. That is my fault. That is what I mentioned in 982 however.

@steadytao

Copy link
Copy Markdown
Member

Also note that several of the cppcheck notices reported through the pre-commit workflow merit attention. For instance, I know that "(shiftTooManyBits): Shifting 32-bit value by 32 bits is undefined behaviour" is real (I had an intel processor not honoring a 32-bit shift, the value stayed the same), and others are at least suspicious/fixable.

Mixed fixes between #1188 and #1201 -- If there are more I missed, please do feel free to submit 🙇‍♂️

@mdeweerd

Copy link
Copy Markdown
Contributor Author

If the same issues are not captured by your integration of cppcheck in a workflow, than the latter needs to change as catching the issues is more important than "fixing" them. Fixing is a an implicit side-effect when the checks are in ci.

@steadytao

Copy link
Copy Markdown
Member

CI can be updated. Just pre-commit isn't really a fit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants