<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Bug in sprintf library function? in MCUXpresso General</title>
    <link>https://community.nxp.com/t5/MCUXpresso-General/Bug-in-sprintf-library-function/m-p/1379108#M4437</link>
    <description>&lt;P&gt;just for the sake of clarity: what library are you using?&lt;/P&gt;&lt;P&gt;RedLib, Newlib or newlib-nano (which I would recommend)?&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;</description>
    <pubDate>Tue, 30 Nov 2021 16:53:16 GMT</pubDate>
    <dc:creator>ErichStyger</dc:creator>
    <dc:date>2021-11-30T16:53:16Z</dc:date>
    <item>
      <title>Bug in sprintf library function?</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/Bug-in-sprintf-library-function/m-p/1379088#M4436</link>
      <description>&lt;P&gt;If I run the following code:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;int len;
char buf[10];

len = sprintf(buf, "%d", -1));  // len = 2: correct
len = sprintf(buf, "%.15g", (double)-1)); // len = 2: correct
len = sprintf(buf, "%1.15g", (double)-1)); // len = 1: incorrect
len = sprintf(buf, "%.15g", (double)1000)); // len = 4: correct
len = sprintf(buf, "%1.15g", (double)1000)); // len = 4 correct&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Why is len 1 if %1.15g format is given? This should be 2. Other compilers like VS gives 2 as well.&lt;/P&gt;&lt;P&gt;I run this code on an i.MX RT1064, MCUxPressoIDE v11.4.0 Build 6237&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 16:35:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/Bug-in-sprintf-library-function/m-p/1379088#M4436</guid>
      <dc:creator>Daan</dc:creator>
      <dc:date>2021-11-30T16:35:30Z</dc:date>
    </item>
    <item>
      <title>Re: Bug in sprintf library function?</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/Bug-in-sprintf-library-function/m-p/1379108#M4437</link>
      <description>&lt;P&gt;just for the sake of clarity: what library are you using?&lt;/P&gt;&lt;P&gt;RedLib, Newlib or newlib-nano (which I would recommend)?&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 16:53:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/Bug-in-sprintf-library-function/m-p/1379108#M4437</guid>
      <dc:creator>ErichStyger</dc:creator>
      <dc:date>2021-11-30T16:53:16Z</dc:date>
    </item>
    <item>
      <title>Re: Bug in sprintf library function?</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/Bug-in-sprintf-library-function/m-p/1379141#M4438</link>
      <description>&lt;P&gt;FYI, I ran your examples with newlib-nano, with float in printf/scanf enabled, and it gave the expected results for me. I suggest you check your library settings. But I have used 11.4.1 in case this makes a difference.&lt;/P&gt;&lt;P&gt;I hope this helps,&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 18:16:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/Bug-in-sprintf-library-function/m-p/1379141#M4438</guid>
      <dc:creator>ErichStyger</dc:creator>
      <dc:date>2021-11-30T18:16:20Z</dc:date>
    </item>
    <item>
      <title>Re: Bug in sprintf library function?</title>
      <link>https://community.nxp.com/t5/MCUXpresso-General/Bug-in-sprintf-library-function/m-p/1379449#M4439</link>
      <description>&lt;P&gt;Thanks for your reply Erich! I run newlib-nano as well. I will check the changes in the new version&lt;/P&gt;</description>
      <pubDate>Wed, 01 Dec 2021 07:12:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-General/Bug-in-sprintf-library-function/m-p/1379449#M4439</guid>
      <dc:creator>Daan</dc:creator>
      <dc:date>2021-12-01T07:12:31Z</dc:date>
    </item>
  </channel>
</rss>

