<?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: Compiler warnings when SDK_DEBUGCONSOLE == DEBUGCONSOLE_DISABLE in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Compiler-warnings-when-SDK-DEBUGCONSOLE-DEBUGCONSOLE-DISABLE/m-p/1007073#M39518</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Roger,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, you are correct. You could redefine PRINTF like that to bypass the warnings. Thanks a lot for your report and feedback. We will take this into consideration for future releases.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Felipe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Feb 2020 21:19:52 GMT</pubDate>
    <dc:creator>FelipeGarcia</dc:creator>
    <dc:date>2020-02-13T21:19:52Z</dc:date>
    <item>
      <title>Compiler warnings when SDK_DEBUGCONSOLE == DEBUGCONSOLE_DISABLE</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Compiler-warnings-when-SDK-DEBUGCONSOLE-DEBUGCONSOLE-DISABLE/m-p/1007070#M39515</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the SDK for the LPC55S69 you get compiler warnings if SDK_DEBUGCONSOLE is defined as DEBUGCONSOLE_DISABLE. This is because in fsl_debug_console.h the PRINTF macro (as well as SCANF, etc.) is defined as an empty string in that case, leaving the arguments standing for the compiler to interpret. In order to prevent this, the macros need to be defined as callable, e.g.&lt;/P&gt;&lt;P&gt;#define PRINTF(format, ...)&lt;/P&gt;&lt;P&gt;etc.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Feb 2020 12:38:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Compiler-warnings-when-SDK-DEBUGCONSOLE-DEBUGCONSOLE-DISABLE/m-p/1007070#M39515</guid>
      <dc:creator>r_strassburg</dc:creator>
      <dc:date>2020-02-10T12:38:34Z</dc:date>
    </item>
    <item>
      <title>Re: Compiler warnings when SDK_DEBUGCONSOLE == DEBUGCONSOLE_DISABLE</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Compiler-warnings-when-SDK-DEBUGCONSOLE-DEBUGCONSOLE-DISABLE/m-p/1007071#M39516</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Roger,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You are correct, when you select &lt;STRONG&gt;SDK_DEBUGCONSOLE = 2&lt;/STRONG&gt;, it represents disable debugconsole function. Please keep in mind that if you want to enable debug console you can do it from the &lt;EM&gt;Quickstart Panel&lt;/EM&gt; in &lt;EM&gt;Quick Settings &amp;gt; SDK Debug Console&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Felipe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Feb 2020 16:51:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Compiler-warnings-when-SDK-DEBUGCONSOLE-DEBUGCONSOLE-DISABLE/m-p/1007071#M39516</guid>
      <dc:creator>FelipeGarcia</dc:creator>
      <dc:date>2020-02-13T16:51:54Z</dc:date>
    </item>
    <item>
      <title>Re: Compiler warnings when SDK_DEBUGCONSOLE == DEBUGCONSOLE_DISABLE</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Compiler-warnings-when-SDK-DEBUGCONSOLE-DEBUGCONSOLE-DISABLE/m-p/1007072#M39517</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Felipe,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I understand that. The problem is that when you do that, PRINTF() calls &lt;/P&gt;&lt;P&gt;will cause compiler warnings because disabling console output redefines &lt;/P&gt;&lt;P&gt;PRINTF to be an empty string, but the arguments passed to it remain in &lt;/P&gt;&lt;P&gt;the source file to get compiled, resulting in the warning. For example, &lt;/P&gt;&lt;P&gt;code containing this PRINTF call:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PRINTF("this is a format string to&amp;nbsp; print out an integer\n", 1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;will expand to either&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DbgConsole_Printf("this is a format string to&amp;nbsp; print out an integer\n", 1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if SDK_DEBUGCONSOLE == DEBUGCONSOLE_REDIRECT_TO_SDK,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;printf("this is a format string to&amp;nbsp; print out an integer\n", 1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if SDK_DEBUGCONSOLE == DEBUGCONSOLE_REDIRECT_TO_TOOLCHAIN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when you set SDK_DEBUGCONSOLE to DEBUGCONSOLE_DISABLE, it expands to &lt;/P&gt;&lt;P&gt;this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;("this is a format string to&amp;nbsp; print out an integer\n", 1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which causes a compiler warning. What it should compile to is this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To get rid of the warnings in this case, instead of defining printf as &lt;/P&gt;&lt;P&gt;an empty string:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#define PRINTF&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in which case the above example expands to the orphan argument list in &lt;/P&gt;&lt;P&gt;the example above&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it needs to be defined as a macro with variadic arguments:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#define PRINTF(format, ...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will cause the entire PRINTF call, including arguments to be &lt;/P&gt;&lt;P&gt;replaced with a null string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Roger&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Feb 2020 17:28:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Compiler-warnings-when-SDK-DEBUGCONSOLE-DEBUGCONSOLE-DISABLE/m-p/1007072#M39517</guid>
      <dc:creator>r_strassburg</dc:creator>
      <dc:date>2020-02-13T17:28:49Z</dc:date>
    </item>
    <item>
      <title>Re: Compiler warnings when SDK_DEBUGCONSOLE == DEBUGCONSOLE_DISABLE</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Compiler-warnings-when-SDK-DEBUGCONSOLE-DEBUGCONSOLE-DISABLE/m-p/1007073#M39518</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Roger,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, you are correct. You could redefine PRINTF like that to bypass the warnings. Thanks a lot for your report and feedback. We will take this into consideration for future releases.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Felipe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Feb 2020 21:19:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Compiler-warnings-when-SDK-DEBUGCONSOLE-DEBUGCONSOLE-DISABLE/m-p/1007073#M39518</guid>
      <dc:creator>FelipeGarcia</dc:creator>
      <dc:date>2020-02-13T21:19:52Z</dc:date>
    </item>
  </channel>
</rss>

