<?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>Kinetis Software Development Kit中的主题 Re: 64-bit type support</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/64-bit-type-support/m-p/468137#M3687</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have used the following code based on KDS3.0, I can pass the compiling and generate the *.elf file.&lt;/P&gt;&lt;P&gt;#include "MKM34Z7.h"&lt;/P&gt;&lt;P&gt;#include "stdio.h"&lt;/P&gt;&lt;P&gt;#include "inttypes.h"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;static int i = 0;&lt;/P&gt;&lt;P&gt;char sarray[50];&lt;/P&gt;&lt;P&gt;long long jdata;&lt;/P&gt;&lt;P&gt;int main(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Write your code here */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("std=%d", i);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; jdata=0x1234567812345678;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; snprintf(sarray,40, "stdlib=%"PRId64"",jdata);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; __asm("nop");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* This for loop should be replaced. By default this loop allows a single stepping. */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (;;) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; __asm("nop");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Never leave main */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 0;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 02 Aug 2016 06:25:42 GMT</pubDate>
    <dc:creator>xiangjun_rong</dc:creator>
    <dc:date>2016-08-02T06:25:42Z</dc:date>
    <item>
      <title>64-bit type support</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/64-bit-type-support/m-p/468136#M3686</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm working on the K64F freedom board trying to port some code and running into an issue when trying to work with 64-bit types. The following snippet&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN style="font-family: 'andale mono', times;"&gt;&lt;SPAN class="s1"&gt;snprintf&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;(text, idx, &lt;/SPAN&gt;&lt;SPAN class="s3"&gt;"%"&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;PRId64&lt;/SPAN&gt;&lt;SPAN class="s3"&gt;""&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;, val);&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1" style="min-height: 8pt; padding: 0px;"&gt;&lt;SPAN class="s2"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s2"&gt;produces the following warning&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1" style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN style="font-family: 'andale mono', times;"&gt;warning: format '%d' expects argument of type 'int', but argument 4 has type 'int64_t' [-Wformat=]&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1" style="min-height: 8pt; padding: 0px;"&gt;&lt;SPAN class="s2"&gt; &lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s2"&gt;at compile time. Digging into inttypes.h which defines PRId64 I found that it's dependant on the define &lt;/SPAN&gt;&lt;SPAN style="font-family: 'andale mono', times;"&gt;__have_longlong64&lt;/SPAN&gt; to correctly set PRId64 to the expected value of &lt;SPAN style="font-family: 'andale mono', times;"&gt;lld&lt;/SPAN&gt; as expected by snprintf. When I look at &lt;/P&gt;&lt;P class="p1" style="min-height: 8pt; padding: 0px;"&gt;&lt;SPAN class="s2"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1" style="min-height: 8pt; padding: 0px;"&gt;&lt;SPAN class="s2"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s2"&gt; I see that there are a few different versions of the stdint.h header, specifically I see the following&lt;/SPAN&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN class="s2"&gt;toolchain/arm-none-eabi/include/stdint.h&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="s2"&gt;&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;toolchain/lib/gcc/arm-none-eabi/4.8.4/include/stdint.h&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="s2"&gt;toolchain/lib/gcc/arm-none-eabi/4.8.4/include/sdtint-gcc.h&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&lt;SPAN class="s2"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="s2"&gt;File #2 essentially wraps #3. They don't define __have_longlong64, even though the code completion shows that an int64_t expands to long long int. It also seems that trying to print an int64_t by manually specifying %lld doesn't work and just results ld being printed.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jan 2016 16:27:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/64-bit-type-support/m-p/468136#M3686</guid>
      <dc:creator>mmbds</dc:creator>
      <dc:date>2016-01-27T16:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: 64-bit type support</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/64-bit-type-support/m-p/468137#M3687</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have used the following code based on KDS3.0, I can pass the compiling and generate the *.elf file.&lt;/P&gt;&lt;P&gt;#include "MKM34Z7.h"&lt;/P&gt;&lt;P&gt;#include "stdio.h"&lt;/P&gt;&lt;P&gt;#include "inttypes.h"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;static int i = 0;&lt;/P&gt;&lt;P&gt;char sarray[50];&lt;/P&gt;&lt;P&gt;long long jdata;&lt;/P&gt;&lt;P&gt;int main(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Write your code here */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("std=%d", i);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; jdata=0x1234567812345678;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; snprintf(sarray,40, "stdlib=%"PRId64"",jdata);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; __asm("nop");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* This for loop should be replaced. By default this loop allows a single stepping. */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (;;) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; __asm("nop");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Never leave main */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 0;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Aug 2016 06:25:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/64-bit-type-support/m-p/468137#M3687</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2016-08-02T06:25:42Z</dc:date>
    </item>
  </channel>
</rss>

