Can C++ have line numbers for std::vector index out of bounds acesses?

Правка en1, от AQZZ, 2020-06-16 21:58:40

Currently I compile with these flags: alias bd='g++ -std=c++17 -Wshadow -Wall -Wextra -o "a" -g -fsanitize=address -fsanitize=undefined'

Most of the time when I access an out of bounds index I get an error from the sanitizer that tells me the line number, which is good. But sometimes I just get an error that memory is leaked but I get no line number. Are there any flags/compilers which can print the line number consistently when this error occurs, similar to Java's index out of bounds exception?

Теги c++, c++ compilers

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский AQZZ 2020-06-16 21:58:40 576 Initial revision (published)