sprintf() in pic16 port

2005-01-30
2013-03-12
  • Hello,

    I have been trying to get sprintf() to work in the pic16 port and haven't had any luck.  It looks like there are header files for this, but I'm not sure where to find the library to link against.

    Has anyone had any luck with this, or is this still work in progress?

    Thanks,
    Wes

     
    • I have "solved" my problem by implementing snprintf() - a buffer bound variant of sprintf() in C that is basically stand alone.  It can be found in the patches.

      I have (at great pain) tested this on my 18f452 pic and it seems to work pretty well.

      Hope this saves someone some time.

      Wes

       
    • I just figured out that there is some sort of stack leak in my implementation.  Something about va_arg() as it looks.

      Be warned that too many calles to this snprintf() function will cause your program to go off into space.

      --Wes