sprintf() in pic16 port

  • Weston T. Schmidt


    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?


    • Weston T. Schmidt

      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.


    • Weston T. Schmidt

      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.



Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks