Miscellaneous-NoNewWithArraysΒΆ
Do not use new with arrays
Required inputs: IR
new with arrays should be avoided, as there is a lot of potential for error:
- Buffer overflows are more likely as the size of the array needs to be handled separately from the array
- Operator
deletewill not properly free the array, and operatordelete[]needs to be used instead.
std::vector to manage heap-allocated arrays.Possible Messages
Key |
Text |
Severity |
Disabled |
|---|---|---|---|
new_on_array |
Use of new operator on array type. |
None |
False |
Options
This rule shares the following common options: exclude_in_macros, exclude_messages_in_system_headers, excludes, extend_exclude_to_macro_invocations, includes, justification_checker, languages, post_processing, provider, report_at, severity
The following places define options that affect this rule: Stylechecks, Analysis-GlobalOptions
This rule has no individual options.