3 ms·
does anyone know, how hard it would be to have a compiler flag -Wundefined that tells me when i write code with undefined behaviour? this way i can fix these is
by infimum 9y ago
does anyone know, how hard it would be to have a compiler flag -Wundefined that tells me when i write code with undefined behaviour?
this way i can fix these issues myself and don't have to rely on the compiler inferring my intentions.
- kutkloon7 9y agoGCC has -fsanitize=undefined. I don't think it detects all kinds of undefined behavior (I haven't tried it myself). You should be able to find more information if you please. Edit: mannykannot noted somewhere else that clang has the same flag.
- staticassertion 9y agoThese are runtime sanitizers designed to aid testing and fuzzing, not meant for running in production software. It involves instrumentation.