Skip to content

[Issue]: Compiler Warnings #432

@jrmadsen

Description

@jrmadsen

Problem Description

If this project is compiled with the same flags used in rocprofiler-sdk and rocprofiler-systems: -Wall -Wextra -Wshadow -Wvla the build produces at least 2,500 warnings. Compiler warnings should not be dismissed, ignoring them can lead to extremely difficult to diagnose bugs and a plethora of warnings can mask the introduction of more critical warnings + make locating errors far more difficult. I highly suggest always compiling with warnings enabled and adding a CMake flag to turn on -Werror — and this option should be enabled during CI. The longer these warnings are ignored, the more time it will take to fix them.

Furthermore, I suggest supporting the builtin CMake support for clang-tidy and using the clang-tidy --warning-as-errors=* flag as seen here in rocprofiler_linting.cmake. Quite a bit of the CMake infrastructure from rocprofiler-sdk can be copied over and adapt to this project with some simple find+replace, such as the support for building with various sanitizers and simplifying formatting by providing a format build target.

I am happy to provide various recommendations regarding your existing CMake implementation too. It appears to be written in CMake 2.x style instead of the more reliable and robust target-based CMake 3.x style. When people “hate” CMake, it is almost always because they are using the CMake 2.x style.

Operating System

N/A

CPU

N/A

GPU

N/A

ROCm Version

N/A

ROCm Component

No response

Steps to Reproduce

No response

(Optional for Linux users) Output of /opt/rocm/bin/rocminfo --support

No response

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions