Skip to content

Latest commit

 

History

History
15 lines (9 loc) · 836 Bytes

File metadata and controls

15 lines (9 loc) · 836 Bytes

Iec042 - unsafe blocks are only allowed when pointers are used inside

Severity: Warning Warning

Blocks and methods should only have the unsafe keyword when pointers are used inside. Pointer usage is detected when a Pointer-Type(TYPE*), the pointer indirection operator (*variable), an address operator (&variable) or the member access operator (->) is used. Pointer usage is also detected when calling a method that was declared with the unsafe modifier. Pointer usage is also detected when calling a method/ using a property/field of an object and the result will be a pointer type.

Solution

You can also use the provided automatic Code Fix to remove the unsafe keyword. ( Press Alt + Enter on the Error line to find the Code Fix in the context menu)

Remove the unsafe keyword.