Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions clang/docs/analyzer/checkers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2932,18 +2932,6 @@ the locking/unlocking of ``mtx_t`` mutexes.
mtx_lock(&mtx1); // warn: This lock has already been acquired
}
.. _alpha-core-CastSize:
alpha.core.CastSize (C)
"""""""""""""""""""""""
Check when casting a malloc'ed type ``T``, whether the size is a multiple of the size of ``T``.
.. code-block:: c
void test() {
int *x = (int *) malloc(11); // warn
}
.. _alpha-core-CastToStruct:
alpha.core.CastToStruct (C, C++)
Expand Down
5 changes: 0 additions & 5 deletions clang/include/clang/StaticAnalyzer/Checkers/Checkers.td
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,6 @@ def BoolAssignmentChecker : Checker<"BoolAssignment">,
HelpText<"Warn about assigning non-{0,1} values to Boolean variables">,
Documentation<HasDocumentation>;

def CastSizeChecker : Checker<"CastSize">,
HelpText<"Check when casting a malloc'ed type T, whether the size is a "
"multiple of the size of T">,
Documentation<HasDocumentation>;

def CastToStructChecker : Checker<"CastToStruct">,
HelpText<"Check for cast from non-struct pointer to struct pointer">,
Documentation<HasDocumentation>;
Expand Down
1 change: 0 additions & 1 deletion clang/lib/StaticAnalyzer/Checkers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ add_clang_library(clangStaticAnalyzerCheckers
CStringChecker.cpp
CStringSyntaxChecker.cpp
CallAndMessageChecker.cpp
CastSizeChecker.cpp
CastToStructChecker.cpp
CastValueChecker.cpp
CheckObjCDealloc.cpp
Expand Down
155 changes: 0 additions & 155 deletions clang/lib/StaticAnalyzer/Checkers/CastSizeChecker.cpp

This file was deleted.

26 changes: 0 additions & 26 deletions clang/test/Analysis/castsize.c

This file was deleted.

10 changes: 0 additions & 10 deletions clang/test/Analysis/malloc-annotations.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// RUN: -Wno-alloc-size \
// RUN: -analyzer-checker=core \
// RUN: -analyzer-checker=alpha.deadcode.UnreachableCode \
// RUN: -analyzer-checker=alpha.core.CastSize \
// RUN: -analyzer-checker=unix.Malloc \
// RUN: -analyzer-checker=debug.ExprInspection \
// RUN: -analyzer-config unix.DynamicMemoryModeling:Optimistic=true %s
Expand Down Expand Up @@ -221,15 +220,6 @@ void f7_realloc(void) {
x[0] = 'a'; // expected-warning{{Use of memory after it is released}}
}

void PR6123(void) {
int *x = malloc(11); // expected-warning{{Cast a region whose size is not a multiple of the destination type size}}
}

void PR7217(void) {
int *buf = malloc(2); // expected-warning{{Cast a region whose size is not a multiple of the destination type size}}
buf[1] = 'c'; // not crash
}

void mallocCastToVoid(void) {
void *p = malloc(2);
const void *cp = p; // not crash
Expand Down
1 change: 0 additions & 1 deletion clang/test/Analysis/malloc-annotations.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// RUN: %clang_analyze_cc1 -verify \
// RUN: -analyzer-checker=core \
// RUN: -analyzer-checker=alpha.deadcode.UnreachableCode \
// RUN: -analyzer-checker=alpha.core.CastSize \
// RUN: -analyzer-checker=unix.Malloc \
// RUN: -analyzer-config unix.DynamicMemoryModeling:Optimistic=true %s

Expand Down
Loading
Loading