Skip to content

Fix GCC compiler warnings - #250

Merged
zfergus merged 2 commits into
mainfrom
fix/gcc-warnings
Sep 3, 2026
Merged

Fix GCC compiler warnings#250
zfergus merged 2 commits into
mainfrom
fix/gcc-warnings

Conversation

@zfergus

@zfergus zfergus commented Sep 3, 2026

Copy link
Copy Markdown
Member

Summary

  • Fix -Wfloat-conversion, -Wunknown-pragmas, -Wmaybe-uninitialized, -Wcomment, and -Wunused-but-set-variable warnings surfaced by a clean rebuild.
  • Disable -Wnull-dereference on GCC (keeping it for Clang): GCC has a long-standing history of false positives on inlined Eigen expression-template code (PR94867, seen from GCC 8 through at least GCC 14), which produced several of the null-deref warnings this branch originally worked around per-callsite before consolidating into this single flag change.

Test plan

  • make -j$(nproc) -B in build/release: 0 warnings, 0 errors
  • ipc_toolkit_tests and ipctk (python bindings) both build successfully

🤖 Generated with Claude Code

zfergus and others added 2 commits September 3, 2026 11:13
…s, maybe-uninitialized, comment, unused-but-set-variable)

- barrier.cpp, edge_edge_mollifier.hpp, normal.cpp: qualify log/fma as
  std:: (unqualified calls were resolving to the double-only C overload,
  narrowing when T=float) and template chain_rule as T instead of double.
- lbvh.cpp: guard #pragma unroll behind __clang__/__GNUC__ so GCC uses
  #pragma GCC unroll instead of ignoring an unrecognized pragma.
- test_angle.cpp: initialize expected_angle to silence a false positive
  across Catch2 SECTIONs.
- test_trust_region.cpp: fix a stray backslash that spliced an ASCII-art
  comment across lines, and drop unused ci/xi/dxi locals.
- utils.cpp: simplify a redundant double() cast in a tolerance calc.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
GCC has a long-standing history of false positives on inlined Eigen
expression-template code (gcc.gnu.org/PR94867, seen from GCC 8 through
at least GCC 14), which is what produced several of the null-deref
warnings fixed earlier on this branch. Rather than suppress each
callsite individually, only request the flag when the compiler isn't
GCC.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.41%. Comparing base (5e5ac39) to head (45b00f2).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #250   +/-   ##
=======================================
  Coverage   96.41%   96.41%           
=======================================
  Files         179      179           
  Lines       16808    16808           
  Branches      962      962           
=======================================
  Hits        16205    16205           
  Misses        603      603           
Flag Coverage Δ
unittests 96.41% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@zfergus
zfergus merged commit af52a2e into main Sep 3, 2026
21 checks passed
@zfergus
zfergus deleted the fix/gcc-warnings branch September 3, 2026 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant