6 ms·
O3 is a bad idea if the package is important. While that’s a dated opinion based on older experiences (Gentoo, various server software, etc), I suspect it’s sti
by ergonaught 2y ago
O3 is a bad idea if the package is important. While that’s a dated opinion based on older experiences (Gentoo, various server software, etc), I suspect it’s still the easiest way to get exposed to compiler bugs.
- motoboi 2y agoIs a bad ideia if you shove that into people expecting stability. But for self compiling is ok because you'll have a clear culprit in case of failure.
- jeffbee 2y agoIf you're going to offer unsupported FUD, I would prefer you direct the FUD at NDEBUG and the fear that it could have disabled a load-bearing assertion.
- wombatpm 2y agoLoad bearing assertions. Even Design by Contract in Eiffel turns off assertions in production.
- groby_b 2y agoJust because it's turned off by default doesn't mean it isn't load bearing. If you didn't ever encounter an ASSERT with side effects that were crucial to proper functioning, you just haven't seen enough ASSERT statements. Rule #1 of programming: If it can go wrong, it will.
- eru 2y agoAlso, you might just run into a new bug, and the assert might caught it, and at least told you about the bug.
- fc417fc802 2y agoThat's before we even consider instances where assert was used to check a condition that should always be verified. In my personal projects I define a "require" macro that I use liberally.
- ergonaught 2y agoIf acknowledging my opinion was dated based on older experiences constitutes “unsupported FUD”, well, have fun with the life experiences that attitude produces for you.
- ac130kz 2y agoFirst and foremost, an easy way to grab a bunch of undefined behavior.
- eru 2y agoThat's a bit sloppy. The undefined behaviour is already in the C standard. But you are right that enabling -O3 is generally going to make your compiler more aggressive about exploiting the undefined behaviour in the pursuit of speed. In general, if you want to avoid being the guy to run into new and exciting bugs, you want to run with options that are as close as possible to what everyone else is using.