Skip to content

[hipDNN] Fix -Werror=unused-variable errors breaking superbuild#7907

Closed
AnaghaRaoAMD wants to merge 1 commit into
developfrom
user/anarao/fix-hipdnn-unused-variable
Closed

[hipDNN] Fix -Werror=unused-variable errors breaking superbuild#7907
AnaghaRaoAMD wants to merge 1 commit into
developfrom
user/anarao/fix-hipdnn-unused-variable

Conversation

@AnaghaRaoAMD
Copy link
Copy Markdown
Contributor

@AnaghaRaoAMD AnaghaRaoAMD commented May 29, 2026

Motivation

Replace auto _ = expr() with (void)expr() to properly discard return values without triggering unused variable warnings under -Werror.

The auto _ pattern was introduced in PR #7279 (commit 9da9c82) to clarify that the dlerror() return value is intentionally discarded. However, GCC treats _ as a regular variable and raises -Wunused-variable, which becomes a build failure under -Werror. Clang treats _ as a conventional discard name and does not warn, which is why CI (using ROCm clang) did not catch this.

The (void) cast is the standard, portable C/C++ idiom for intentionally discarding a return value and works under both GCC and Clang.

Technical Details

Test Plan

Test Result

Submission Checklist

Replace `auto _ = expr()` with `(void)expr()` to properly discard
return values without triggering unused variable warnings under -Werror.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@AnaghaRaoAMD AnaghaRaoAMD requested a review from a team as a code owner May 29, 2026 23:49
@AnaghaRaoAMD AnaghaRaoAMD changed the title Fix -Werror=unused-variable errors breaking superbuild [hipDNN] Fix -Werror=unused-variable errors breaking superbuild May 29, 2026
@AnaghaRaoAMD AnaghaRaoAMD deleted the user/anarao/fix-hipdnn-unused-variable branch May 30, 2026 00:24
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

❌ Your project status has failed because the head coverage (77.83%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #7907   +/-   ##
========================================
  Coverage    62.06%   62.06%           
========================================
  Files         2088     2088           
  Lines       358353   358353           
  Branches     54207    54207           
========================================
  Hits        222379   222379           
  Misses      117148   117148           
  Partials     18826    18826           
Flag Coverage Δ *Carryforward flag
TensileLite 27.43% <ø> (ø) Carriedforward from 7418015
hipBLAS 90.65% <ø> (ø) Carriedforward from 7418015
hipBLASLt 41.23% <ø> (ø) Carriedforward from 7418015
hipCUB 82.21% <ø> (ø) Carriedforward from 7418015
hipDNN 86.59% <100.00%> (ø)
hipFFT 50.00% <ø> (ø) Carriedforward from 7418015
hipRAND 76.12% <ø> (ø) Carriedforward from 7418015
hipSOLVER 69.24% <ø> (ø) Carriedforward from 7418015
hipSPARSE 85.42% <ø> (ø) Carriedforward from 7418015
rocBLAS 48.09% <ø> (ø) Carriedforward from 7418015
rocFFT 52.07% <ø> (ø) Carriedforward from 7418015
rocRAND 57.03% <ø> (ø) Carriedforward from 7418015
rocSOLVER 77.83% <ø> (ø) Carriedforward from 7418015
rocSPARSE 72.68% <ø> (ø) Carriedforward from 7418015

*This pull request uses carry forward flags. Click here to find out more.

Files with missing lines Coverage Δ
projects/hipdnn/backend/src/HipdnnBackend.cpp 70.70% <100.00%> (ø)
.../hipdnn_data_sdk/utilities/PlatformUtils.linux.hpp 89.58% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants