[all-commits] [llvm/llvm-project] 6dc188: [clang] Implement -Walloc-size diagnostic option (...

Vladimir Vuksanovic via All-commits all-commits at lists.llvm.org
Mon Aug 25 07:46:31 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6dc188d4eb15cbe9bdece3d940f03d93b926328c
      https://github.com/llvm/llvm-project/commit/6dc188d4eb15cbe9bdece3d940f03d93b926328c
  Author: Vladimir Vuksanovic <109677816+vvuksanovic at users.noreply.github.com>
  Date:   2025-08-25 (Mon, 25 Aug 2025)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/AST/Expr.h
    M clang/include/clang/Basic/AttrDocs.td
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/lib/AST/Expr.cpp
    M clang/lib/AST/ExprConstant.cpp
    M clang/lib/Sema/SemaExpr.cpp
    M clang/test/Analysis/Malloc+MismatchedDeallocator+NewDelete.cpp
    M clang/test/Analysis/Malloc+MismatchedDeallocator_intersections.cpp
    M clang/test/Analysis/MismatchedDeallocator-checker-test.mm
    M clang/test/Analysis/NewDelete-checker-test.cpp
    M clang/test/Analysis/NewDelete-intersections.mm
    M clang/test/Analysis/castsize.c
    M clang/test/Analysis/malloc-annotations.c
    M clang/test/Analysis/malloc-sizeof.c
    M clang/test/Analysis/malloc.c
    M clang/test/Analysis/unix-fns.c
    M clang/test/Sema/implicit-void-ptr-cast.c
    A clang/test/Sema/warn-alloc-size.c

  Log Message:
  -----------
  [clang] Implement -Walloc-size diagnostic option (#150028)

Warns about calls to functions decorated with attribute `alloc_size`
that specify insufficient size for the type they are cast to. Matches
the behavior of the GCC option of the same name.

Closes #138973

---------

Co-authored-by: Vladimir Vuksanovic <vvuksano at cisco.com>



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