GCC
No gcc ( man gcc
) as verificações são ativadas por
-fstack-protector Emit extra code to check for buffer overflows, such as stack smashing attacks. >This is done by adding a guard variable to functions with vulnerable objects. This includes functions that call alloca, and functions with >buffers larger than 8 bytes. The guards are initialized when a function is entered and then checked when the function exits. If a guard check >fails, an error message is printed and the program exits. -fstack-protector-all Like -fstack-protector except that all functions are protected.
Você pode desativar ambos, inserindo no-
no nome da opção
-fno-stack-protector -fno-stack-protector-all
LLVM / Clang
Em LLVM / Clang ( link ) para ativar / desativar o AdressSanitizer:
-f[no-]address-sanitizer: Turn on AddressSanitizer, a memory error detector.
e SAFECode ( link )
-f[no-]memsafety