Repository navigation
fix(build): clean up Clang compiler warnings - #1458
Conversation
|
Closing and reopening only to make CI build against current |
|
Thanks for checking this and for confirming the UCRT64 failure was base-side. The fresh runs against current dev are now both green: |
…tVugg#1458's cleanup holds JustVugg#1458 silenced -Wmissing-field-initializers on the three expert_mats initialisers by naming the `vk` field. JustVugg#1462 landed alongside it and gave Mat two more trailing fields, `resident` and `metal`, so the warning did not go away, it moved: glm53.c:1411:11: warning: missing initializer for field 'resident' of 'Mat' The zero the compiler was already supplying is the right value -- a streamed expert slot is not resident and has no Metal tensor -- so this only says so explicitly. glm53 now builds clean under -Wextra again.
Clean up Clang compiler warnings
Branch and commit
fix/clang-compiler-warningse79aee8fix(build): clean up Clang compiler warningsfd93c41aa6ae2c7d1cc1a1e2d6b79dbe6d341708(v1.10.2)Summary
This change removes Apple Clang compiler warnings from the portable CPU/test build without globally suppressing warning classes.
The cleanup covers GLM-5.3, Qwen3.8 Edge adapter initialization, the expert-store registry/test initialization, and DeepSeek V4 CPU/GPU conditional compilation. The changes are intended to be warning cleanup only; no performance claim is made.
Changes
GLM-5.3
Mat.vkfield toNULLin the three affected matrix initializers.hc_multdeclarations only in code paths where the value is actually used, avoiding unused-variable diagnostics in alternate/Segment builds.Qwen3.8
ColiEdgeAdapterinitializer to designated initialization.reserved_fnarray explicitly.Expert store
ColiExpertStorefield intest_expert_store_ops.c.COLI_ESR_EXPORTfeature-detectexternally_visibleinstead of unconditionally applying an attribute unsupported by Apple Clang.usedattribute on GCC/Clang builds.DeepSeek V4
gpu_batch,cols, andgpu_computestate to GPU-tier compilation where those values are consumed.scales/qdqscratch allocations and their size accounting.Compiler diagnostics addressed
The original Apple Clang build/test output contained warnings in these groups:
glm53.cmissing field 'vk' initializerdiagnostics.unused variable 'H'diagnostic.braces around scalar initializer.missing field 'reserved_fn' initializer.missing field 'gpu' initializer.expert_store_registry.cunknown attribute 'externally_visible' ignoreddiagnostics.unused variable 'gpu_batch'.unused variable 'cols'.unused variable 'scales'.unused variable 'qdq'.variable 'gpu_compute' set but not used.Expected runtime/test diagnostics containing the word
warningwere not treated as compiler warnings.Validation
Final validation on macOS/Apple Clang:
The compiler-warning check matched source-location compiler diagnostics separately from expected runtime/test messages.
git diff --checkalso passed.Scope
Files changed:
c/deepseek_v4.cc/expert_store_registry.cc/glm53.cc/qwen38.cc/tests/test_expert_store_ops.cFinal commit diff:
Notes
externally_visiblewhile compilers supporting it retain the attribute.