Skip to content

Suggestion to avoid C style casting #77

@nuang-ee

Description

@nuang-ee

For more efficient code maintenance, I recommend to avoid C style casting (such as (struct struct_name *) void_ptr)

There are several reasons why C++ style casting should be used instead of C style casting. (Also mentioned in #56 too)

  • C style castings are not checked at compile time and therefore causes some problem on runtime (And they are usually hard to debug)
  • C++ style castings enhance the readability of the entire code by enabling searching code snippets by the common postfix _cast.
  • C++ style castings support more precise casting, based on the context.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions