https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105950 --- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> --- Line numbers in the source code aren't relevant here, you need to add the -fsanitize=undefined flag to your link command to solve those undefined references.