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

Replace C-style casts #531

Merged
merged 6 commits into from
Mar 18, 2020
Merged

Replace C-style casts #531

merged 6 commits into from
Mar 18, 2020

Conversation

DanRStevens
Copy link
Collaborator

Reference: #528 (-Wold-style-cast)

Replaces old C-style casts with static_cast or reinterpret_cast.

@DanRStevens DanRStevens requested a review from cugone March 18, 2020 11:39
Copy link
Contributor

@cugone cugone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Core Guidelines suggest avoiding casts unless absolutely necessary.

We should consider all uses of casting to see if there can be a better solution such as T{e} construction, functions, safe wide-conversions (passing in a float to a double argument, etc), among other things.

@DanRStevens
Copy link
Collaborator Author

Agreed. At least using the newer X_cast syntax allows you to search for casts, so they can be found and fixed easier.

@DanRStevens DanRStevens merged commit d1b86e2 into master Mar 18, 2020
@DanRStevens DanRStevens deleted the updateOldStyleCasts branch March 18, 2020 18:59
@cugone
Copy link
Contributor

cugone commented Mar 18, 2020

In particular, any non-pointer reinterpret_cast is suspect.

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

Successfully merging this pull request may close these issues.

2 participants