cpp_weekly
cpp_weekly copied to clipboard
Finding memory bugs at compile time
https://compiler-explorer.com/z/jvPPTdsfK
Requires gcc with -O3 and Sanitizers enabled to find this at compile-time.
Hi Jason,
Strange, adding undefined to fsanitize option silences the warning: https://compiler-explorer.com/z/fesP7Kjxq
Regards
This kind of warning is being emitted from the backend (optimizer). Turning on the sanitizers disables certain optimizations so that the runtime can catch them, so the optimizer no longer sees the issue.