Skip to content

Fix simple clang-tidy warnings#13490

Merged
Mic92 merged 4 commits intoNixOS:masterfrom
Mic92:clang-tidy-simple-warnings
Aug 11, 2025
Merged

Fix simple clang-tidy warnings#13490
Mic92 merged 4 commits intoNixOS:masterfrom
Mic92:clang-tidy-simple-warnings

Conversation

@Mic92
Copy link
Copy Markdown
Member

@Mic92 Mic92 commented Jul 17, 2025

Summary

This PR fixes several simple clang-tidy warnings:

  • Fix SIZE_MAX undefined warning in fchmodat2-compat.hh
  • Fix NIX_WITH_S3_SUPPORT undefined warning in s3.hh
  • Fix clang-tidy uninitialized value warning in derivation-options.cc
  • Fix uninitialized field in Attr constructor
  • Make widechar_wcwidth inline to fix unused function warning

Mic92 added 4 commits July 17, 2025 17:08
Include <cstdint> to ensure SIZE_MAX is defined
The s3.hh public header was incorrectly including store-config-private.hh
instead of the public config.hh. Since NIX_WITH_S3_SUPPORT is defined in
the public config, this caused clang-tidy to report it as undefined.
Make lambda capture explicit to avoid clang-analyzer-core.CallAndMessage warning
The default constructor for Attr was not initializing the value pointer,
which could lead to undefined behavior when the uninitialized pointer is
accessed. This was caught by clang-tidy's UninitializedObject check.

This fixes the warning:
  1 uninitialized field at the end of the constructor call
  [clang-analyzer-optin.cplusplus.UninitializedObject]
@Mic92 Mic92 force-pushed the clang-tidy-simple-warnings branch 2 times, most recently from 42a7d8d to 3c0cd73 Compare July 17, 2025 17:18
@Mic92 Mic92 requested a review from xokdvium August 11, 2025 09:37
@Mic92 Mic92 merged commit b2fb421 into NixOS:master Aug 11, 2025
12 checks passed
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.

4 participants