# suppressing clang-tidy warnings from macros

**URL:** <https://discourse.vtk.org/t/suppressing-clang-tidy-warnings-from-macros/7807>\
**Category:** Development\
**Tags:** proposal\
**Created:** [February 10, 2022, 11:02am UTC](https://discourse.vtk.org/t/suppressing-clang-tidy-warnings-from-macros/7807 "2022-02-10T11:02:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![andreasbuykx](https://discourse.vtk.org/user_avatar/discourse.vtk.org/andreasbuykx/32/8137_2.png) [@andreasbuykx](https://discourse.vtk.org/u/andreasbuykx)\
**Post date:** [February 10, 2022, 11:02am UTC](https://discourse.vtk.org/t/suppressing-clang-tidy-warnings-from-macros/7807/1 "2022-02-10T11:02:12Z")

</div>

Some VTK warnings cause clang-tidy warnings in our code. For example, the  
SafeDownCast method implemented by the vtkTypeMacro causes a warning suggesting to use dynamic\_cast instead of static\_cast. This warning is unnecessary but it is not possible to suppress it from the invocating code.

Clang-tidy has a [mechanism to suppress these warnings](https://clang.llvm.org/extra/clang-tidy/#suppressing-undesired-diagnostics) which requires to add a NOLINT comment. Is it OK to add this comments for vtkTypeMacro?

---

<div class="post-metadata">

**Author:** ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)\
**Post date:** [February 10, 2022, 11:05am UTC](https://discourse.vtk.org/t/suppressing-clang-tidy-warnings-from-macros/7807/2 "2022-02-10T11:05:51Z")

</div>

@ben.boeckel
