Synopsis: | Avoid explicit casting where possible. |
Language: | C |
Severity Level: | 7 |
Category: | EXPRESSIONS |
Description: |
Casting to the same type is redundant and symptomatic of a poor understanding of the types in use. In Standard C, void * is guaranteed to be compatible with other pointer types so an explicit cast is unnecessary. This is commonly and mistakenly done with malloc() for example. |