|
From: Philippe W. <phi...@sk...> - 2015-01-02 10:13:15
|
On Fri, 2015-01-02 at 00:44 +0000, "João M. S. Silva" wrote: > On 01/02/2015 12:05 AM, Tom Hughes wrote: > > No. Stack overruns are not detected because there is no guard space > > between stack variables like there is between heap variables. > > OK, I didn't know that. Now I'm a bit worried :P I thought my code was > 99% clean :) > > Is there a way to check for stack memory errors? If it was not for the > %s in the command string it could be caught with cppcheck, but with the > %s only a runtime check would do, I guess. You can try with valgrind --tool=exp-sgcheck (sg = stack and global). This is an experimental tool, so not as polished as the others (e.g. might have a lot of false positive). But it detects (some of) the problems with stack and global variables. No idea if it works on ARM, however. Philippe |