Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion to avoid C style casting #77

Open
nuang-ee opened this issue Nov 11, 2021 · 1 comment
Open

Suggestion to avoid C style casting #77

nuang-ee opened this issue Nov 11, 2021 · 1 comment

Comments

@nuang-ee
Copy link

nuang-ee commented Nov 11, 2021

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.
@hns10109
Copy link
Collaborator

의견 주셔서 감사합니다.
의견 주신대로 캐스팅 코딩 스타일을 C++로 변경/개선하는 것으로 검토하겠습니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants