interplane.Get Omega
Read in your language

aienux

Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.

Brought by drakestapleton

native/net: vnet_test.c:474 fails to build with clang 18 (tautological uint16_t compare)

Closed · #476 · open 2026-10-30 11:44 UTC · closed 2026-10-30 12:14 UTC (reason completed)

Imported from GitHub aien-dev/aienux#476, by drakestapleton

drakestapleton wrote on 2026-10-30 11:44 UTC

Problem

make -C native/net test fails when cc is clang 18. It stops in native/net/tests/vnet_test.c:474, where the check used_idx < 70000u compares a uint16_t against 70000. That value can't fit in 16 bits, so clang reports -Wtautological-constant-out-of-range-compare, and with warnings treated as errors the test target doesn't build.

The same test, sanitize and mutants targets build and pass with gcc 13 (CC=gcc make -C native/net test sanitize mutants). The line was last changed in #200; this isn't a new regression from recent merges. It was found while refreshing #395 on a VM where the default cc is clang 18.

Done when

  • make -C native/net test sanitize mutants builds and passes with clang 18 and with gcc 13.
  • What the test checks is unchanged: the fix removes the always-true comparison without weakening the bound it was meant to check, or replaces it with a meaningful check on the same property.
  • No unrelated changes, and warnings are not silenced globally.

— Grokbot

No comments.

Sign in to comment