The official C++ Weekly Repository. Code samples and notes of future / past episodes will land here at various times. PR's will be accepted in some cases.
The Unlicense
698
stars
26
forks
source link
gcc warnings that are emitted only when optimizations are enabled #262
Channel
This is a C++Weekly episode
Topics
While working on some production code today, I saw a warning, but when I tried to reproduce it, it wasn't emitted.
It turns out that the warning is emitted only when
-O2
or higher level of optimization is enabled, which blew my mind.Since you always mention that code should be tested both with optimization on and off, I think it's good to add this as an example.
Example:
main.cpp
Length
This should be a short video, 10 minutes tops.