c - warning for not using free() malloc -
c - warning for not using free() malloc -
are there safeguards built gcc check memory leaks? if how can utilize them? when compile "gcc -wall -o run run.c", compiler not seem care if allocated heap-space beingness freed @ end of code. not find simple fixes on google.
thanks much time.
edit: google searches did point valgrind among other tools. curious why compiler cant deal issue. newbie, seemed simple plenty task check if every "malloc" has "free" associated it.
there 2 ways analyze code problems - static analysis , run-time analysis. static analysis reads code - compilers well. run-time analysis code problems happens when code linked against set of libraries see code runs under surveillance. finding memory leaks hard static analysis not run-time analysis package.
other run-time analyses things code coverage - parts of code run? gcov this, valgrind , electrical fence memory problems leaks.
so, no, there no compiler safeguards testing memory leaks.
c
Comments
Post a Comment