Sanitizers (AddressSanitizer)
Në shqip përdoret i njëjti emër.
ShpjegimiSQ
Sanitizer-at janë kontrolle që kompajleri i fut në program: AddressSanitizer gjen leximin jashtë kufijve dhe përdorimin pas free(), UndefinedBehaviorSanitizer gjen sjelljet e papërcaktuara. I ndez me -fsanitize=address dhe të tregojnë rreshtin e saktë të gabimit.
EnglishEN
Sanitizers are checks the compiler builds into your program: AddressSanitizer finds out-of-bounds reads and use after free(), UndefinedBehaviorSanitizer finds undefined behaviour. Turn them on with -fsanitize=address and they point to the exact line of the bug.
Si ta mendosh
Si alarmi i tymit në kuzhinë: bie menjëherë sapo diçka nis të digjet, jo kur është djegur gjithë shtëpia.
Lexoje në anglisht
Like a kitchen smoke alarm: it goes off the moment something starts burning, not when the whole house has burned.
Shembull kodibash
g++ -g -fsanitize=address,undefined main.cpp -o programi
./programi