Using Clang's -Wunused-variable to Detect Unused Declarations
Enable Clang's -Wunused-variable to catch declared‑but‑never‑read variables, see how Sema emits the diagnostic, and learn limits and silencing techniques.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Enable Clang's -Wunused-variable to catch declared‑but‑never‑read variables, see how Sema emits the diagnostic, and learn limits and silencing techniques.
Nullable Reference Types in C# 8.0 move null safety from runtime to compile time, but require careful adoption at API boundaries and trust edges.
OCaml's pattern matching catches missing cases at compile time, preventing runtime Match_failure exceptions. Use -warn-error +8 to elevate warnings to errors.
GCC's -Wmaybe-uninitialized only fires under optimization and mixes real bugs with false positives. A diagnostic guide to triaging, fixing, and knowing when to restructure.
A diagnostic workflow for GCC's -Wmaybe-uninitialized: how to tell real uninitialized-use bugs from optimization-level artifacts, fix the actual path, and know when to escalate.
In C# 8 and later, an unconstrained generic type parameter annotated as T? produces a deferred nullability contract that the compiler cannot resolve until the type is substituted. The annotation carries different meanings depending on whether T becomes a reference type or a value type, yet the generic method body receives limited static guidance about which
The Challenge When enabling nullable reference types on an existing codebase, the compiler treats unannotated legacy libraries as 'oblivious'—assuming T? for all reference types. This suppresses warnings but erases static safety guarantees at the call boundary between annotated and unannotated code. The four-state nullable context model (annotation context a
Symptom A module compiled with the -export_all attribute makes every function publicly callable, even those meant to stay internal. The compiler emits no warning, so the exposure can go unnoticed until another module or an external caller invokes a private function via erlang:apply/3 . Constraints and uncertainty Current OTP releases (26, 27) still support -
Context Svelte's compiler performs static accessibility analysis during compilation, emitting warnings for issues like missing alt attributes on images, invalid ARIA usage, and keyboard navigation gaps. These warnings appear in the build output without any external linting setup, and individual cases can be suppressed with svelte-ignore comments. The decisio