Skip to content

Compiler warnings audit: 4,100+ warnings across ROCm components (gfx94X build) #5085

@talumbau

Description

@talumbau

Summary

An audit of compiler warnings from the CI build run #25360331898 (Linux gfx94X-dcgpu, 2026-05-05) found 4,139 compiler warnings across ROCm-owned components. Some of these indicate potential real bugs (use of uninitialized memory, delete on non-heap objects, dead NULL checks).

Build logs were obtained from the TheRock S3 log archive:
https://therock-ci-artifacts-external.s3.amazonaws.com/ROCm-rocm-libraries/25360331898-linux/logs/gfx94X-dcgpu/index.html

Warning Counts by Component

Component Owner Area Warning Count Top Warning Category
hip-tests HIP 2,744 -Wc++17-extensions (inline vars) — 2,604 instances
hip-clr HIP Runtime 427 -Winconsistent-missing-override — ~300+ instances
ROCR-Runtime ROCr 250 -Wunused-variable, -Winconsistent-missing-override, -Wtypedef-redefinition
amdsmi SMI 236 -Wsign-conversion — ~150+ instances
aqlprofile Profiler 182 -Winconsistent-missing-override — 180 instances
amd-llvm Compiler 163 -Wunused-but-set-parameter — 56 instances
rocprofiler-sdk Profiler 90 -Winconsistent-missing-override, -Wuninitialized
rocprofiler-compute Profiler 30 -Wunused-value (ignored nodiscard on hipError_t)
rocm_smi_lib SMI 8 -Waddress (comparing stack variable address to NULL)
roctracer Profiler 8 -Wunused-value (ignored nodiscard on hipError_t)
therock-flatbuffers Third-party 2 -Wstringop-overflow
hipBLASLt BLAS 0 Clean
rocBLAS BLAS 0 Clean
rocRoller BLAS 0 Clean
hipBLAS BLAS 0 Clean

Third-party generated code (not actionable by ROCm teams):

  • therock-host-blas64: 17,858 warnings (generated LAPACK/BLAS f2c code)
  • therock-host-blas: 17,826 warnings (same, 32-bit variant)

Potential Bugs (High Priority)

amd-llvm: -Wfree-nonheap-object (4 instances)

Calling operator delete[] on a pointer to a non-heap object. This is likely a real bug that could cause crashes or memory corruption.

rocprofiler-sdk: -Wuninitialized (5 instances)

base class 'MemoryManager' is uninitialized when used here to access 'MemoryManager::agent' — accessing an uninitialized base class member during construction.

rocm_smi_lib: -Waddress (8 instances)

Comparing the address of stack/local variables (originalMemoryPartition, originalComputePartition, memory_partition, current_compute_partition) to NULL. These checks are always true — likely a logic error or dead code.

amdsmi: -Wsign-conversion (150+ instances)

Implicit signedness conversions between int/uint32_t/uint64_t/size_type. Potential truncation or sign-extension bugs.

Code Quality (Medium Priority)

Missing override keyword (~800 warnings across 4 components)

  • hip-clr (427): ~30 virtual methods missing override, each appearing ~12 times
  • aqlprofile (182): WaitIdle, Enable, Disable, BuildWriteConfigRegPacket, etc.
  • rocprofiler-sdk (90): Same aqlprofile pattern (likely shared code)
  • ROCR-Runtime (part of 250): PopulateMipmapSrd, PopulateImageSrd, SubmitCommand, etc.

This is a mechanical fix — add override to all virtual method overrides.

Ignored nodiscard return values (38 warnings)

  • rocprofiler-compute (30): Ignoring hipError_t return values
  • roctracer (8): Same issue

Should either check the return value or explicitly cast to (void).

Low Priority / Noisy

hip-tests: C++17 extension warnings (2,604)

Test code uses inline variables but appears to compile with a pre-C++17 standard. Either bump -std=c++17 or remove inline specifiers.

amd-llvm: Unused parameters/variables (80+)

Likely in upstream LLVM code or OpenMP runtime. May not be actionable in the ROCm fork.

ROCR-Runtime: Miscellaneous (remaining ~100)

Unused variables, typedef redefinitions, const-correctness issues, mismatched struct/class tags.

Detailed Per-Component Breakdowns

hip-tests (2,744 warnings)
Count Warning Flag
2,604 inline variables are a C++17 extension -Wc++17-extensions
56 variable 'expected_value' used uninitialized whenever switch default taken -Wsometimes-uninitialized
28 variable 'src' used uninitialized whenever switch default taken -Wsometimes-uninitialized
28 variable 'dst' used uninitialized whenever switch default taken -Wsometimes-uninitialized
28 unused function 'test_hipMallocFromPoolAsync_MThread' -Wunused-function
hip-clr (427 warnings)

Dominated by -Winconsistent-missing-override. ~30+ virtual method overrides missing the override keyword, each appearing ~12 times across translation units.

Top methods missing override: submitWriteMemory, submitVirtualMap, submitUnmapMemory, submitThreadTrace, submitThreadTraceMemObjects, submitSvmUnmapMemory, SubmitSvmPrefetchBatchAsync, submitSvmPrefetchAsync, submitSvmMapMemory, submitSvmFreeMemory, and many more.

ROCR-Runtime (250 warnings)
Count Warning Flag
24 unused variable 'err' -Wunused-variable
18 redefinition of typedef 'HsaKFDContext' -Wtypedef-redefinition
12 'PopulateMipmapSrd' missing override -Winconsistent-missing-override
12 'PopulateImageSrd' missing override -Winconsistent-missing-override
9 unused variable 'status' -Wunused-variable
8 struct previously declared as class -Wmismatched-tags
8 cast drops const qualifier -Wcast-qual
6 'SubmitCommand' missing override -Winconsistent-missing-override
6 'printSwizzleMode' missing override -Winconsistent-missing-override
6 'printSRDDetailed' missing override -Winconsistent-missing-override
amdsmi (236 warnings)
Count Warning Flag
63 private field 'm_current_offset' not used -Wunused-private-field
32 implicit conversion: 'int' to 'uint32_t' -Wsign-conversion
10 implicit conversion: 'int' to 'uint64_t' -Wsign-conversion
8 implicit conversion: 'unsigned int' to 'int' -Wsign-conversion
8 implicit conversion: 'rsmi_status_t' to 'int32_t' -Wsign-conversion
8 implicit conversion: 'int' to 'size_type' -Wsign-conversion
7 implicit conversion: 'int64_t' to 'uint64_t' -Wsign-conversion
6 implicit conversion: 'streamsize' to 'size_t' -Wsign-conversion
6 implicit conversion: 'long' to 'uint64_t' -Wsign-conversion
aqlprofile (182 warnings)

All -Winconsistent-missing-override:

Count Method
20 WaitIdle
20 Enable
20 Disable
16 BuildWriteConfigRegPacket
16 BuildThreadTraceEventFinish
16 BuildNopPacket
16 BuildIndirectBufferCmd
14 GetSpmSampleDelayMax
14 BuildWriteWaitIdlePacket
8 BuildWriteShRegPacket
amd-llvm (163 warnings)
Count Warning Flag
56 parameter 'P' set but not used -Wunused-but-set-parameter
23 private field 'OmptInitialized' not used -Wunused-private-field
9 field designators not in declaration order -Wreorder-init-list
5 enumerated and non-enumerated type in conditional -Wextra
4 operator delete[] called on non-heap object -Wfree-nonheap-object
4 std::scoped_lock may not support CTAD -Wctad-maybe-unsupported
3 comparison of integers of different signs -Wsign-compare
rocprofiler-sdk (90 warnings)

Primarily -Winconsistent-missing-override (same aqlprofile pattern, likely shared code) plus:

  • 5 instances of -Wuninitialized (base class 'MemoryManager' uninitialized when accessed)

Methodology

All *_build.log files were downloaded from the TheRock S3 log archive for the gfx94X-dcgpu build job. Warnings were extracted by matching warning: in each log file, then deduplicated and counted. Only compiler warnings (not CMake, pip, or git warnings) are included in the component counts.


Reference: ROCM-24273

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    TODO

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions