[all-commits] [llvm/llvm-project] 00dacf: [clang] Add -Wuninitialized-const-pointer (#148337)

Igor Kudrin via All-commits all-commits at lists.llvm.org
Mon Jul 14 15:45:04 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 00dacf8c22f065cb52efb14cd091d441f19b319e
      https://github.com/llvm/llvm-project/commit/00dacf8c22f065cb52efb14cd091d441f19b319e
  Author: Igor Kudrin <ikudrin at accesssoftek.com>
  Date:   2025-07-14 (Mon, 14 Jul 2025)

  Changed paths:
    M clang/include/clang/Analysis/Analyses/UninitializedValues.h
    M clang/include/clang/Basic/DiagnosticGroups.td
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/lib/Analysis/UninitializedValues.cpp
    M clang/lib/Sema/AnalysisBasedWarnings.cpp
    M clang/test/Misc/warning-wall.c
    A clang/test/SemaCXX/warn-uninitialized-const-pointer.cpp
    M libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/pointer.pass.cpp
    M libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/pointer.volatile.pass.cpp

  Log Message:
  -----------
  [clang] Add -Wuninitialized-const-pointer (#148337)

This option is similar to -Wuninitialized-const-reference, but diagnoses
the passing of an uninitialized value via a const pointer, like in the
following code:
```
void foo(const int *);
void test() {
  int v;
  foo(&v);
}
```
This is an extract from #147221 as suggested in [this
comment](https://github.com/llvm/llvm-project/pull/147221#discussion_r2190998730).



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list