[all-commits] [llvm/llvm-project] 0f6110: No longer diagnose (functionally) empty structures...

Aaron Ballman via All-commits all-commits at lists.llvm.org
Thu Jun 15 04:46:12 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0f6110a4a4250f3d684e166b2d3279fbe4a1f239
      https://github.com/llvm/llvm-project/commit/0f6110a4a4250f3d684e166b2d3279fbe4a1f239
  Author: Aaron Ballman <aaron at aaronballman.com>
  Date:   2023-06-15 (Thu, 15 Jun 2023)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/Analysis/UninitializedValues.cpp
    M clang/test/Sema/uninit-variables.c

  Log Message:
  -----------
  No longer diagnose (functionally) empty structures under -Wuninitialized

An empty structure in C has no way to be initialized, so triggering a
-Wuninitialized warning for a variable of empty structure type is not
actionable for users. This silences the false positive warning, which
matches the behavior of GCC as well.

We no longer diagnose if the structure has no members, or has only
zero-sized members (unnamed bit-fields, zero-sized bit-fields, empty
structure types).

Fixes: https://github.com/llvm/llvm-project/issues/26842




More information about the All-commits mailing list