avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] problem with malloc() in avr-libc 1.6.1


From: John Regehr
Subject: Re: [avr-gcc-list] problem with malloc() in avr-libc 1.6.1
Date: Tue, 29 Jan 2008 10:45:22 -0700 (MST)
User-agent: Alpine 1.00 (DEB 882 2007-12-20)

If you must use malloc() on an AVR, you should strongly consider writing some stub functions that permit your C code to compile on a PC platform where you can stress test it under observation of serious tools like Valgrind.

My observation (from watching a few hundred students) is that debugging on an MCU is so hard that once you have added a few nasty pointer bugs into your code base, your chances of getting back to a totally reliable piece of software are not that good.

Also in the code you sent, you did not check the return value from malloc() for null. On a small-memory platform this kind of check is not optional.

John Regehr




reply via email to

[Prev in Thread] Current Thread [Next in Thread]