#include <SDL.h> //SDL2, installed via Synaptic, on Linux Mint 19.2, 64 bits:
int main (const int argc, char argv[]) {
if (SDL_Init (SDL_INIT_TIMER | SDL_INIT_VIDEO) < 0) return EXIT_FAILURE; //AddressSanitizer: 192 byte(s) leaked in 5 allocation(s).
atexit (SDL_Quit);
return EXIT_SUCCESS;
}
/* ==10228==ERROR: LeakSanitizer: detected memory leaks (I suppressed details):
Direct leak of 72 byte(s) in 2 object(s) allocated from:
Direct leak of 1 byte(s) in 1 object(s) allocated from:
Indirect leak of 720 byte(s) in 9 object(s) allocated from:
Indirect leak of 32 byte(s) in 1 object(s) allocated from:
Indirect leak of 32 byte(s) in 1 object(s) allocated from:
Indirect leak of 16 byte(s) in 2 object(s) allocated from:
Indirect leak of 16 byte(s) in 1 object(s) allocated from:
Indirect leak of 16 byte(s) in 2 object(s) allocated from:
Indirect leak of 8 byte(s) in 1 object(s) allocated from:
Indirect leak of 8 byte(s) in 1 object(s) allocated from:
SUMMARY: AddressSanitizer: 921 byte(s) leaked in 21 allocation(s).
Process returned 1 (0x1) execution time : 0.240 s
Press ENTER to continue.
Comand line (flags):
clang+±10 -fsanitize=address -ftrapv -fsanitize=undefined-trap -fsanitize-undefined-trap-on-error -fomit-frame-pointer -fno-exceptions -fno-rtti -Wnon-virtual-dtor -Wbind-to-temporary-copy -Wambiguous-member-template -Wextra-tokens -pedantic -std=c++20 -m64…
*/
I have tons of code that are OK to sanitizer, but projects that depend on SDL2.
PS: I didn’t post this on “bug tracker”, because I’m still trying to get my GitHub account back.