Skip to content

Commit 32be773

Browse files
committed
Add complete docstring to NarrowedHeadAllocationFunctionCall
1 parent 8435f3c commit 32be773

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

cpp/misra/src/rules/RULE-8-7-1/PointerArithmeticFormsAnInvalidPointer.ql

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,13 @@ class ReallocFunctionCall extends HeapAllocationFunctionCall {
7272
}
7373

7474
/**
75-
* The
75+
* A cast that converts the pointer to an allocated byte array to that of a specialized type.
76+
* e.g.
77+
*
78+
* ``` C++
79+
* int *x = (int*)malloc(SIZE * sizeof(int));
80+
* ```
81+
* This class captures the cast `(int*)malloc(SIZE * sizeof(int))` above.
7682
*/
7783
class NarrowedHeapAllocationFunctionCall extends Cast {
7884
HeapAllocationFunctionCall alloc;

0 commit comments

Comments
 (0)