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.


.



Relevant Pages

  • Re: Why do i get error "error: expression must have a constant value"
    ... I have the following code, which I am using in an Embedded systems, ... However I see the same problem with GCC too.. ... In general this is and only can be determined at link time. ... When I compile this code I get the ...
    (comp.lang.c)
  • Re: Delay Routine: Fully-portable C89 if possible
    ... embedded systems). ... Secondly, if I *do* use printf, 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. ... I've come a cropper using gcc for ARM by passing an integer to a sprintf that was expecting float. ...
    (comp.arch.embedded)
  • Re: Opinions on Rowley CrossWorks for ARM
    ... in GCC is a big plus for embedded systems if you are doing low level ... Hardly I would not recommend GCC for embedded use. ... Paul Curtis, Rowley Associates Ltd. ... You have been dismissing gcc out of hand, without giving any reasoning or evidence, or indication that you have even tried it, and without directly stating your commercial bias. ...
    (comp.arch.embedded)
  • Re: Opinions on Rowley CrossWorks for ARM
    ... Specially the good integration for inline assembler ... in GCC is a big plus for embedded systems if you are doing low level ... Hardly I would not recommend GCC for embedded use. ... Paul Curtis, Rowley Associates Ltd. ...
    (comp.arch.embedded)
  • Re: Why does this work? (rot13 function)
    ... > (and any other source files in the project). ... > are only there to catch mistakes in your code; ... My biggest complaint about gcc -W -Wall is that it barks at unused ... int bar ...
    (comp.lang.c)