<?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>CodeWarrior for MCU中的主题 How can I suppress the compiler warning: multiply-defined: 'printf'  in libc_E200z760_VLE_SPFP_Only.a in the file D:\workspace\EPPC\workspace_codegen\ewl\EWL_C\EWL_C.PA_CmdLineData\libc_E200z7 60_VLE_SPFP_Only\obj\printf.o Previously defined in printf.obj</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/How-can-I-suppress-the-compiler-warning-multiply-defined-printf/m-p/483435#M12510</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How can I suppress the following compiler warnings when I already have user defined functions for printf() and sprintf():&lt;/P&gt;&lt;P&gt;multiply-defined: 'printf'&amp;nbsp; in libc_E200z760_VLE_SPFP_Only.a in the file D:\workspace\EPPC\workspace_codegen\ewl\EWL_C\EWL_C.PA_CmdLineData\libc_E200z7 60_VLE_SPFP_Only\obj\printf.o Previously defined in printf.obj ignored: 'printf'&amp;nbsp; in libc_E200z760_VLE_SPFP_Only.a from the file D:\workspace\EPPC\workspace_codegen\ewl\EWL_C\EWL_C.PA_CmdLineData\libc_E200z7 60_VLE_SPFP_Only\obj\printf.o&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;multiply-defined: 'sprintf'&amp;nbsp; in libc_E200z760_VLE_SPFP_Only.a in the file D:\workspace\EPPC\workspace_codegen\ewl\EWL_C\EWL_C.PA_CmdLineData\libc_E200z7 60_VLE_SPFP_Only\obj\printf.o Previously defined in printf.obj ignored: 'sprintf'&amp;nbsp; in libc_E200z760_VLE_SPFP_Only.a from the file D:\workspace\EPPC\workspace_codegen\ewl\EWL_C\EWL_C.PA_CmdLineData\libc_E200z7 60_VLE_SPFP_Only\obj\printf.o&lt;/P&gt;&lt;P&gt;Description&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;Resource&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;Path&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;Location&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;Typemultiply-defined: 'printf'&amp;nbsp; in libc_E200z760_VLE_SPFP_Only.a in the file D:\workspace\EPPC\workspace_codegen\ewl\EWL_C\EWL_C.PA_CmdLineData\libc_E200z7 60_VLE_SPFP_Only\obj\printf.o Previously defined in printf.obj ignored: 'printf'&amp;nbsp; in libc_E200z760_VLE_SPFP_Only.a from the file D:\workspace\EPPC\workspace_codegen\ewl\EWL_C\EWL_C.PA_CmdLineData\libc_E200z7 60_VLE_SPFP_Only\obj\printf.o&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;PCM&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt; &lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;C/C++ Problem&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 14 Dec 2015 15:55:19 GMT</pubDate>
    <dc:creator>thomasl1</dc:creator>
    <dc:date>2015-12-14T15:55:19Z</dc:date>
    <item>
      <title>How can I suppress the compiler warning: multiply-defined: 'printf'  in libc_E200z760_VLE_SPFP_Only.a in the file D:\workspace\EPPC\workspace_codegen\ewl\EWL_C\EWL_C.PA_CmdLineData\libc_E200z7 60_VLE_SPFP_Only\obj\printf.o Previously defined in printf.obj</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/How-can-I-suppress-the-compiler-warning-multiply-defined-printf/m-p/483435#M12510</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How can I suppress the following compiler warnings when I already have user defined functions for printf() and sprintf():&lt;/P&gt;&lt;P&gt;multiply-defined: 'printf'&amp;nbsp; in libc_E200z760_VLE_SPFP_Only.a in the file D:\workspace\EPPC\workspace_codegen\ewl\EWL_C\EWL_C.PA_CmdLineData\libc_E200z7 60_VLE_SPFP_Only\obj\printf.o Previously defined in printf.obj ignored: 'printf'&amp;nbsp; in libc_E200z760_VLE_SPFP_Only.a from the file D:\workspace\EPPC\workspace_codegen\ewl\EWL_C\EWL_C.PA_CmdLineData\libc_E200z7 60_VLE_SPFP_Only\obj\printf.o&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;multiply-defined: 'sprintf'&amp;nbsp; in libc_E200z760_VLE_SPFP_Only.a in the file D:\workspace\EPPC\workspace_codegen\ewl\EWL_C\EWL_C.PA_CmdLineData\libc_E200z7 60_VLE_SPFP_Only\obj\printf.o Previously defined in printf.obj ignored: 'sprintf'&amp;nbsp; in libc_E200z760_VLE_SPFP_Only.a from the file D:\workspace\EPPC\workspace_codegen\ewl\EWL_C\EWL_C.PA_CmdLineData\libc_E200z7 60_VLE_SPFP_Only\obj\printf.o&lt;/P&gt;&lt;P&gt;Description&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;Resource&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;Path&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;Location&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;Typemultiply-defined: 'printf'&amp;nbsp; in libc_E200z760_VLE_SPFP_Only.a in the file D:\workspace\EPPC\workspace_codegen\ewl\EWL_C\EWL_C.PA_CmdLineData\libc_E200z7 60_VLE_SPFP_Only\obj\printf.o Previously defined in printf.obj ignored: 'printf'&amp;nbsp; in libc_E200z760_VLE_SPFP_Only.a from the file D:\workspace\EPPC\workspace_codegen\ewl\EWL_C\EWL_C.PA_CmdLineData\libc_E200z7 60_VLE_SPFP_Only\obj\printf.o&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;PCM&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt; &lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;C/C++ Problem&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Dec 2015 15:55:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/How-can-I-suppress-the-compiler-warning-multiply-defined-printf/m-p/483435#M12510</guid>
      <dc:creator>thomasl1</dc:creator>
      <dc:date>2015-12-14T15:55:19Z</dc:date>
    </item>
    <item>
      <title>Re: How can I suppress the compiler warning: multiply-defined: 'printf'  in libc_E200z760_VLE_SPFP_Only.a in the file D:\workspace\EPPC\workspace_codegen\ewl\EWL_C\EWL_C.PA_CmdLineData\libc_E200z7 60_VLE_SPFP_Only\obj\printf.o Previously defined in printf</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/How-can-I-suppress-the-compiler-warning-multiply-defined-printf/m-p/483436#M12511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Having the same problem in the past with CW for S12(X), IIRC warning happens when single CW lib source module provides several functions and you are providing your own functions not for all of these functions. Say lib file contains src.o, which was made compiling src.c and defines foo1(), foo2() and foo3(). If you define your own foo1(), and keep using foo2() or foo3() from CW library, then you will get this warning about ignoring one or mode functions. If your code defines just foo1() and doesn't use foo2() and foo3(), you should not see that warning. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Dec 2015 08:27:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/How-can-I-suppress-the-compiler-warning-multiply-defined-printf/m-p/483436#M12511</guid>
      <dc:creator>kef2</dc:creator>
      <dc:date>2015-12-15T08:27:59Z</dc:date>
    </item>
    <item>
      <title>Re: How can I suppress the compiler warning: multiply-defined: 'printf'  in libc_E200z760_VLE_SPFP_Only.a in the file D:\workspace\EPPC\workspace_codegen\ewl\EWL_C\EWL_C.PA_CmdLineData\libc_E200z7 60_VLE_SPFP_Only\obj\printf.o Previously defined in printf</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/How-can-I-suppress-the-compiler-warning-multiply-defined-printf/m-p/483437#M12512</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello LV &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Arial','sans-serif';"&gt;User can use&amp;nbsp; &amp;lt;#pragma suppress_warnings off&amp;gt; to disable the warning message.&amp;nbsp;&amp;nbsp; And can also use the&amp;nbsp; &amp;lt;#pragma warning off (num [, ...]) &amp;gt; to disable a specific warning message.&amp;nbsp; ( To get to know the warning number, please use the &amp;lt;#pragma showmessagenumber&amp;gt; to display warning messages with their warning numbers.)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Arial','sans-serif';"&gt;However, I do not think this is good solution for this problem of multiply-defination. &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Arial','sans-serif';"&gt;The functions 'printf' and 'sprintf'&amp;nbsp; are contained in MSL C library libc_E200z760_VLE_SPFP_Only.a. You should have already included this lib in your project.&amp;nbsp; When user defines the user functions with the same name, linker will prompt such message. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Arial','sans-serif';"&gt;So it is better to rename your user functions to avoid such conflict. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Arial','sans-serif';"&gt;Or you can just ignore this warning, because by default, the the linker always processes source code files before it processes relocatable ( .o ) files or archive ( .a ) files. This policy means that the linker prefers using a symbol definition from a source file rather than a library file definition for the same symbol.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Arial','sans-serif';"&gt;Best Regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Arial','sans-serif';"&gt;Fiona Kuang&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Arial','sans-serif';"&gt;Technical Information &amp;amp; Commercial Support&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Arial','sans-serif';"&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Arial','sans-serif';"&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Arial','sans-serif';"&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Dec 2015 07:25:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/How-can-I-suppress-the-compiler-warning-multiply-defined-printf/m-p/483437#M12512</guid>
      <dc:creator>TICS_Fiona</dc:creator>
      <dc:date>2015-12-16T07:25:28Z</dc:date>
    </item>
    <item>
      <title>Re: How can I suppress the compiler warning: multiply-defined: 'printf'  in libc_E200z760_VLE_SPFP_Only.a in the file D:\workspace\EPPC\workspace_codegen\ewl\EWL_C\EWL_C.PA_CmdLineData\libc_E200z7 60_VLE_SPFP_Only\obj\printf.o Previously defined in printf</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/How-can-I-suppress-the-compiler-warning-multiply-defined-printf/m-p/483438#M12513</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Fiona,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the input and info of #pragma use below to show and suppress the warnings.&amp;nbsp; I can now switch the warnings on, off, or suppress them as needed per source code file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#&lt;SPAN style="text-decoration: underline;"&gt;pragma&lt;/SPAN&gt; &lt;SPAN style="text-decoration: underline;"&gt;showmessagenumber&lt;/SPAN&gt; on&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#&lt;SPAN style="text-decoration: underline;"&gt;pragma&lt;/SPAN&gt; warning off (number)&lt;/P&gt;&lt;P&gt;#&lt;SPAN style="text-decoration: underline;"&gt;pragma&lt;/SPAN&gt; suppress_warnings on&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LV Thomas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Dec 2015 16:36:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/How-can-I-suppress-the-compiler-warning-multiply-defined-printf/m-p/483438#M12513</guid>
      <dc:creator>thomasl1</dc:creator>
      <dc:date>2015-12-16T16:36:32Z</dc:date>
    </item>
  </channel>
</rss>

