gcc ver is 5.4.0
I want to use it like :-fsanitize=address,leak
OK?
Just pass both -fsanitize=address and -fsanitize=leak (as separate program arguments) to gcc. Read the chapter on Invoking GCC and the section on Instrumentation Options.
-fsanitize=address
-fsanitize=leak
gcc
Consider also using the valgrind program.
Don't forget to compile all your code with -Wall -Wextra -g (and perhaps even -g3).
-Wall -Wextra -g
-g3
Just pass both
-fsanitize=address
and-fsanitize=leak
(as separate program arguments) togcc
. Read the chapter on Invoking GCC and the section on Instrumentation Options.Consider also using the valgrind program.
Don't forget to compile all your code with
-Wall -Wextra -g
(and perhaps even-g3
).