connectedhomeip icon indicating copy to clipboard operation
connectedhomeip copied to clipboard

[BUG] Bug found by bugprone-casting-through-void check in .clang-tidy

Open jlatusek opened this issue 1 year ago • 3 comments

Reproduction steps

  1. Add bugprone-casting-through-void to .clang-tidy
  2. Open latest build container based on ubuntu:24.04
  3. Run Clang-tidy validation and previous step from build.yaml

Bug prevalence

always

GitHub hash of the SDK that was being used

4cdce52a5fa25542d4fbeb3cdff6e75b3aa1c379

Platform

other

Platform Version(s)

No response

Anything else?

Log file with clang-tidy error: 1_Build on Linux (fake, gcc_release, clang, simulated).txt

jlatusek avatar Jun 19 '24 08:06 jlatusek

@jlatusek Those are all from using the GLib API macros, right? Sounds like we need to add suppressions for those cases or something. That's not code we control.

bzbarsky-apple avatar Jun 20 '24 14:06 bzbarsky-apple

@bzbarsky-apple This error is caused by using glib macros to do the casting. We can try to do the casting another way, but glib macros also check that the object being casted is of the correct type.

jlatusek avatar Jun 26 '24 20:06 jlatusek

Right, so it sounds like we need to suppress the clang-tidy check for these known-safe cases....

bzbarsky-apple avatar Jun 26 '24 20:06 bzbarsky-apple

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] avatar Sep 08 '24 01:09 github-actions[bot]

We should add supression comments or fix the code. At the same time, I believe we updated to ubuntu 24.04 and evetyhing should be updated now.

Closing as likely stale - we support ubuntu 24.04 today.

andy31415 avatar Oct 21 '24 15:10 andy31415