Re: Delay Routine: Fully-portable C89 if possible



"David Brown" <david@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:470ccdb0$0$3218$8404b019@xxxxxxxxxxxxxxxxxx
John Devereux wrote:
David Brown <david@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx> writes:

<snip>
First off, I don't use printf or friends very often (I write small
embedded systems). Secondly, if I *do* use printf (more likely
snprintf), I use gcc which will type-check the parameters against the
format so that any mistakes are caught - although with any variable
parameter function, you've lost much of C's already limited type
checking. Thirdly, I occasionally have to cast the parameters
explicitly so that I can be sure there are no mistakes.

Doesn't that imply a whole new set of things to worry about?


I would not say so, no.

I've come a cropper using gcc for ARM by passing an integer to a sprintf
that was expecting float. Caused my system to reset and took quite a
long time to find.


.