Author Topic: Nspire printf syscall is not ANSI compliant  (Read 3014 times)

0 Members and 1 Guest are viewing this topic.

Offline fb39ca4

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1749
  • Rating: +60/-3
    • View Profile
Nspire printf syscall is not ANSI compliant
« on: August 07, 2011, 01:42:37 am »
I was trying to debug a program I was writing with printf, and realized it was giving me incorrect results when I tried doing printf("%f", 2.0); and it printed 0.000000. This means TI is being lazy and has not provided a full implementation of printf. Some other things I discovered were that the flag %Lf does not work (it just prints Lf), and that sprintf has the same issues. Could any other C developers help look into this and experiment so we can figure out the extent of these limitations?

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: Nspire printf syscall is not ANSI compliant
« Reply #1 on: August 07, 2011, 01:57:15 am »
It's not compliant either on the TI-68k/AMS platform :)
Quote
This means TI is being lazy and has not provided a full implementation of printf.
Another possibility (which is not mutually exclusive with TI not providing a full implementation of printf, as shown by %Lf not being supported) is that floats have a non-standard calling convention, just like on the TI-68k/AMS platform, where float = double for most practical purposes.
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.