Open PastaPastaPasta opened 2 years ago
I don't really see the point of using C++ style casts for integer types, as C-style casts are equivalent for those anyway.
I don't really see the point of using C++ style casts for integer types, as C-style casts are equivalent for those anyway.
Yeah, if we could use C style casts for only integer types I'd be totally happy. The problem comes when using C style casts with more complex (and potentially dangerous) types.
The main reason for this PR, is that it allows us to use tooling (see -Wold-style-cast
) to prevent, in Bitcoin Core or other libraries that use minisketch, the dangerous usage of C style casts. If you look at the bitcoin PR, I replaced a LOT of C style casts that were acting as a reinterpret_cast as opposed to a normal static_cast.
I speak more about the benefits of this change / enforcement of no C style casts in the bitcoin PR
I know nothing about the build system, but I think it is possible to disable warnings for subtrees?
Please see latest @sipa
I have replaced non-narrowing static_casts (I introduced) with c++11 braced init instead
@sipa can you please review the current state of this PR?
Thanks
All done, will squash if requested
@sipa how does that look?
Hi going through my old open PRs. Any chance we can get this merged?
A part of https://github.com/bitcoin/bitcoin/pull/23810