logoalt Hacker News

accelbred • today at 4:41 PM • 1 reply • view on HN

I was just dealing with this: https://bugs.gentoo.org/show_bug.cgi?id=974323.

Also std::start_lifetime_at is a hack and ive seen nobody using it in all the placed where it aught to be used.

If optimizing based on object lifetimes could be turned off, itd be turned off everywhere for hardening like strict aliasing is.


Replies

jeffbee • today at 4:52 PM

In my personal opinion, the fix[1] for that issue clearly implicates C-style habits polluting a C++ code base. No right-thinking knower of C++ initializes objects with memset! Also I believe that -Wall would have flagged that, and I know for certain that cppcoreguidelines-init-variables + cppcoreguidelines-pro-type-member-init would have flagged it.

1: https://github.com/llvm/llvm-project/commit/905a88b923433eb8...

➕ show 1 reply