llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.03k stars 11.58k forks source link

[clang-tidy] lint issues found on arm32 not found on amd64 #58694

Open igagis opened 1 year ago

igagis commented 1 year ago

It looks strange, but I observe that clang-tidy ran on arm32 architecture finds more issues than when run on amd64 architecture.

Here is the Github Actions runs of one of my repos: https://github.com/cppfw/utki/actions/runs/3353311467

look for jobs named sanitizer: sanitizer - debian:bullseye - job run on amd64, passes, no issues found. sanitizer - arm32v7/debian:bullseye - job run on arm32 architecture, some issues found by clang-tidy.

And this is not specific to only one clang-tidy check, there are other CI runs showing the same thing for different checks: https://github.com/cppfw/utki/actions/runs/3353259128 https://github.com/cppfw/utki/actions/runs/3353224810 https://github.com/cppfw/utki/actions/runs/3353165186

Version of clang-tidy installed is:

Get:17 http://deb.debian.org/debian bullseye/main armhf clang-tidy-11 armhf 1:11.0.1-2 [954 kB]

and

Get:21 https://apt.llvm.org/bullseye llvm-toolchain-bullseye/main amd64 clang-tidy-16 amd64 1:16~++20221029072052+efae1a7cf06b-1~exp1~20221029072202.437 [4088 kB]

i.e. on arm32 the version is older, but finds more issues. Regression?

llvmbot commented 1 year ago

@llvm/issue-subscribers-clang-tidy

EugeneZelenko commented 1 year ago

Could you please try 15 or main branch? 11 is too old.

njames93 commented 1 year ago

Given that you are using 2 different versions of clang-tidy and checking different architectures it's not surprising that the outputs differ. To work on this we'd need a minimal reproducer on the latest release would be needed.

igagis commented 1 year ago

Some more examples:

https://github.com/cppfw/morda/actions/runs/5106008866

consider succeeded job linux - debian:bullseye and failed job linux - arm32v7/debian:bullseye. For example this finding: https://github.com/cppfw/morda/actions/runs/5106008866/jobs/9177945777#step:17:65

it is pretty obvious one:

/home/cppfw/.config/github-act-runner/runners/xu4r3/src/morda/widgets/button/drop_down_box.hpp:50:3: error: use '= default' to define a trivial default constructor [modernize-use-equals-default,-warnings-as-errors]
                provider() {}
                ^          ~~
                           = default;

but on amd64 build it is not found, only found on arm32v7 build. Maybe there are different versions of clang-tidy, though I install them from the same debian repo:

deb https://apt.llvm.org/bullseye llvm-toolchain-bullseye main

If arm version of clang-tidy is older than amd64 one, but it finds issues not found by the new one, then it is a regression.

P.S. sorry, I have no time for making minimal reproducer. Just wanted to let you know about the issue.