clang-tidy warnings #584
Labels
No labels
Area/build-packaging
Area/cli
Area/evaluator
Area/fetching
Area/flakes
Area/language
Area/profiles
Area/protocol
Area/releng
Area/remote-builds
Area/repl
Area/store
bug
crash 💥
Cross Compilation
devx
docs
Downstream Dependents
E/easy
E/hard
E/help wanted
E/reproducible
E/requires rearchitecture
imported
Needs Langver
OS/Linux
OS/macOS
performance
regression
release-blocker
RFD
stability
Status
blocked
Status
invalid
Status
postponed
Status
wontfix
testing
testing/flakey
ux
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lix-project/lix#584
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Describe the bug
When upgrading to clang 18 a large number of new clang-tidy warnings appear. Many are nuisance warnings, but some may be hiding actual errors.
A few that seemed like they might be important:
Path canon = path == "" ? "" : canonPath(path);
canonicalizes the path then completely ignores its canonicalized path
Path logFile = openLogFile();
opens a log file then ignores the path
auto name2 = hiliteMatches(name.name, nameMatches, ANSI_GREEN, "\e[0;2m");
highlights a name then doesn't do anything with it
A large number of places also dereference a
std::optional
then pass it to a function taking astd::optional
. This is undefined behavior if the optional is empty. From tests in compiler explorer, clang and gcc will both silently mark the optional as having a value but leave the memory uninitialized.Steps To Reproduce
Run
clang-tidy
, either withjust tidy
ornix build .#hydraJobs.tests.clang-tidy
, after upgrading to nixpkgs 24.11 with clang 18. The warnings are also shown in a buildbot log.Expected behavior
No warnings appear
nix --version
outputN/A
This issue was mentioned on Gerrit on the following CLs: