Hi Alexandre, > Please look in the manual under "Library Routines". It explains why > floating point support is disabled in printf by default and how to turn > it on.
Unfortunately this is not (yet) true for the pic16 targets to which you were referring. Outputting float values was just not implemented in the pic16-printf() routines, so recompiling would not have helped. I just (svn r5371 and a fix in r5373) added support for float output to pic16-printf(), but disabled it by default as with most other targets to keep code size down for the majority of users (not using floats). You can enable it by adding --enable-floats to the ./configure-call in the device/lib/pic16/ directory when building sdcc from source. The sdccman.lyx file is also updated with instructions to enable float support when building the libraries. Please try tomorrow's snapshot or the current svn revision and report any problems occurring in the process (it works for me both with and without float support, but who knows...). >> void main (void) >> { >> ... >> float fl1 = 18.725; >> int INT = 18725; >> char str[10] = "bla"; >> char ch = 'C'; >> >> ... >> >> sprintf(buff,"KEY released. %f %d %c %s \r\n",fl1, INT, ch, str); >> >> ... >> } >> >> same result: KEY released. <NO FLOAT> ? C bla. Wow, you were able to use sprintf from the pic16 library?!? I also just committed some fixes to the way stringbuffers are handled: Prior to these, the pointer passed into sprintf would be modified by the strmputchar()-routine to always point to the terminating 0 byte... Maybe using a global buffer instead of a local pointer saved your day so far... Again, any feedback on success or failure with sprintf/fprintf/... is highly appreciated, especially before the upcoming release! Thanks for reporting your problems. Best regards, Raphael ------------------------------------------------------------------------------ Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM) software. With Adobe AIR, Ajax developers can use existing skills and code to build responsive, highly engaging applications that combine the power of local resources and data with the reach of the web. Download the Adobe AIR SDK and Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com _______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user