<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated on Wed, 25 Nov 2009 05:36:46 -0800 -->
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <atom:link href="http://software.intel.com/en-us/articles/intel-c-compiler-for-linux-kb/type/errors-diagnostics/feed/" rel="self" type="application/rss+xml" />
    <title>Intel Software Network articles feed</title>
    <link>http://software.intel.com/en-us/articles/intel-c-compiler-for-linux-kb/errors-diagnostics/</link>
    <description></description>
    <language>en-us</language>
    <item>
      <title>Diagnostic 269: invalid format string conversion</title>
      <description><![CDATA[ <br />
<div id="art_pre_template"><b>Casue: </b><br /><br />This warning is triggered by a printf or scanf format specifier that is not appropriate for the type of the variable being printed.<br /><br /><b>Example: </b><br /><br />
<p>#include &lt;stdio.h&gt;</p>
<p>int main() {<br />   long int li = 0;<br />   printf("%l\n",li);     // %l is the size specifier; the type specifer is missing<br />   printf("%ld\n",li);  // OK<br />   return 0;<br />}</p>
<p><br />&gt; icl -c /W4 diag269.cpp<br />Intel(R) C++ Compiler Professional for applications running on IA-32, Version 11.1    Build 20090511 Package ID: w_cproc_p_11.1.035<br />Copyright (C) 1985-2009 Intel Corporation.  All rights reserved.</p>
<p>diag269.cpp<br />diag269.cpp(5): warning #269: invalid format string conversion<br />     printf("%l\n",li);<br />                   ^</p>
<br /><b>Resolution : </b><br /><br />Use proper type specifier.<br /></div> ]]></description>
      <link>http://software.intel.com/en-us/articles/cdiag269</link>
      <pubDate>Wed, 18 Nov 2009 16:36:31 -0800</pubDate>
      <comments>http://software.intel.com/en-us/articles/cdiag269#comments</comments>
      <guid isPermaLink="true">http://software.intel.com/en-us/articles/cdiag269</guid>
      <category>Intel® C++ Compiler for Linux* Knowledge Base</category>
      <category>Intel® C++ Compiler for Mac OS X* Knowledge Base</category>
      <category>Intel® C++ Compiler for Windows* Knowledge Base</category>
      <category>Intel® Parallel Composer Knowledge Base</category>
    </item>
    <item>
      <title>Diagnostic 181: argument is incompatible with corresponding format string conversion</title>
      <description><![CDATA[ <br />
<div id="art_pre_template"><b>Cause: </b><br /><br />This warning is triggered by a printf or scanf format specifier that is not appropriate for the type of the variable being printed. <br /><br /><b>Example: </b><br /><br />
<p>#include &lt;stdio.h&gt;</p>
<p>int main() {<br />   unsigned int ui = 0;<br />   printf("%f\n",ui);  // %f is for a double type, not an unsigned integer type<br />   printf("%u\n",ui); // OK<br />   return 0;<br />}<br />&gt; icl -c /W4 diag181.cpp<br />Intel(R) C++ Compiler Professional for applications running on IA-32, Version 11.1    Build 20090511 Package ID: w_cproc_p_11.1.035<br />Copyright (C) 1985-2009 Intel Corporation.  All rights reserved.</p>
<p>diag181.cpp<br />diag181.cpp(5): warning #181: argument is incompatible with corresponding format string conversion<br />     printf("%f\n",ui);<br />                   ^</p>
<b>Resolution : </b><br /><br />Use the proper type specifier.<br /></div> ]]></description>
      <link>http://software.intel.com/en-us/articles/cdiag181</link>
      <pubDate>Wed, 18 Nov 2009 16:23:47 -0800</pubDate>
      <comments>http://software.intel.com/en-us/articles/cdiag181#comments</comments>
      <guid isPermaLink="true">http://software.intel.com/en-us/articles/cdiag181</guid>
      <category>Intel® C++ Compiler for Linux* Knowledge Base</category>
      <category>Intel® C++ Compiler for Mac OS X* Knowledge Base</category>
      <category>Intel® C++ Compiler for Windows* Knowledge Base</category>
      <category>Intel® Parallel Composer Knowledge Base</category>
    </item>
    <item>
      <title>Diagnostic 319: name followed by &amp;#34;::&amp;#34; must be a class or namespace</title>
      <description><![CDATA[ <br />
<div id="art_pre_template"><b>Cause: </b><br /><br />This diagnostic occurs when a qualifier is not preceded by a class or namespace name.  <br /><br /><b>Example: </b><br /><br />
<p>class C {<br />   static int i;<br />};</p>
<p>typedef int Foo;</p>
<p>int Foo::i;  // error -- Foo is not a class or namespace</p>
<br />
<p>&gt; icl -c diag319.cpp<br />Intel(R) C++ Compiler Professional for applications running on IA-32, Version 11.1    Build 20090511 Package ID: w_cproc_p_11.1.035<br />Copyright (C) 1985-2009 Intel Corporation.  All rights reserved.</p>
<p>diag319.cpp<br />diag319.cpp(7): error: name followed by "::" must be a class or namespace name<br />  int Foo::i;<br />      ^</p>
<br /><b>Resolution: </b><br /><br />Quality the name correctly.  For example:<br /><br />int C::i;    // ok, C is a class name<br /></div> ]]></description>
      <link>http://software.intel.com/en-us/articles/cdiag319</link>
      <pubDate>Wed, 18 Nov 2009 15:24:43 -0800</pubDate>
      <comments>http://software.intel.com/en-us/articles/cdiag319#comments</comments>
      <guid isPermaLink="true">http://software.intel.com/en-us/articles/cdiag319</guid>
      <category>Intel® C++ Compiler for Linux* Knowledge Base</category>
      <category>Intel® C++ Compiler for Mac OS X* Knowledge Base</category>
      <category>Intel® C++ Compiler for Windows* Knowledge Base</category>
      <category>Intel® Parallel Composer Knowledge Base</category>
    </item>
    <item>
      <title>Diagnostic 109: expression must have (pointer-to-) function type</title>
      <description><![CDATA[ <br />
<div id="art_pre_template"><b>Cause: </b><br />
<p><br />This error is reported when the compiler sees a function call but the identifier in the<br />function call is not a function name or function pointer.</p>
<p><br /><b>Example: <br /></b><br />void foo(void* p) {<br />    p();   // p is being called as if it were a function but it is not a function<br /><br />}</p>
<p>&gt; icl -c diag109.cpp<br />Intel(R) C++ Compiler Professional for applications running on IA-32, Version 11.1    Build 20090511 Package ID: w_cproc_p_11.1.035<br />Copyright (C) 1985-2009 Intel Corporation.  All rights reserved.</p>
<p>diag109.cpp<br />diag109.cpp(2): error: expression must have (pointer-to-) function type<br />      p();<br />      ^</p>
<p><b>Resolution : </b><br />Ensure there is no syntax error and the function prototype exists.</p>
</div> ]]></description>
      <link>http://software.intel.com/en-us/articles/cdiag109</link>
      <pubDate>Wed, 18 Nov 2009 15:13:47 -0800</pubDate>
      <comments>http://software.intel.com/en-us/articles/cdiag109#comments</comments>
      <guid isPermaLink="true">http://software.intel.com/en-us/articles/cdiag109</guid>
      <category>Intel® C++ Compiler for Linux* Knowledge Base</category>
      <category>Intel® C++ Compiler for Mac OS X* Knowledge Base</category>
      <category>Intel® C++ Compiler for Windows* Knowledge Base</category>
      <category>Intel® Parallel Composer Knowledge Base</category>
    </item>
    <item>
      <title>error 409 when building boost libraries 1.40.0 with Intel compiler</title>
      <description><![CDATA[ <p><strong>Problem : <br /></strong>When building boost libraries version 1.40.0 with Intel compiler 11.1.046, the compiler report error #409 like below:</p>
<blockquote>
<p>./boost/wave/cpplexer/re2clex/cpp_re2c_lexer.hpp(119): error #409: "boost::wave::cpplexer::re2clex::lexer&lt;IteratorT, PositionT&gt;::lexer(const IteratorT &amp;, const IteratorT &amp;, const PositionT &amp;, boost::wave::language_support)" provides no initializer for:<br />const member "boost::wave::cpplexer::re2clex::lexer&lt;IteratorT, PositionT&gt;::cache"<br />{<br />^<br />detected during:<br />instantiation of "boost::wave::cpplexer::re2clex::lex_functor&lt;IteratorT, PositionT&gt;::lex_functor(const IteratorT &amp;, const IteratorT &amp;, const PositionT &amp;, boost::wave::language_support) [with IteratorT=char *, PositionT=boost::wave::util::file_position_type]" at line 402<br />instantiation of "boost::wave::cpplexer::lex_input_interface *boost::wave::cpplexer::new_lexer_gen&lt;IteratorT, PositionT&gt;::new_lexer(const IteratorT &amp;, const IteratorT &amp;, const PositionT &amp;, boost::wave::language_support) [with IteratorT=char *, PositionT=boost::wave::util::file_position_type]" at line 52 of "libs/wave/src/instantiate_re2c_lexer.cpp"</p>
</blockquote>
<p><strong>Environment :</strong> <br /><br />Boost libraries version 1.40.0 for linux*<br />Intel C++ Compiler for linux, version 11.1.046<br /><br /><strong>Root Cause :</strong> <br />Need initializer for const variable cache defined in file cpp_re2c_lexer.hpp, line 107. Refer this article <a href="http://software.intel.com/en-us/articles/cdiag409">http://software.intel.com/en-us/articles/cdiag409</a> for details.<br /><br /><strong>Resolution : <br /></strong>This error no longer occurs with the Intel® C++ Compiler 11.1.059 for Linux*.  As a workaround as well, you can add an initializer for the const variable cache in file boost/wave/cpplexer/re2clex/cpp_re2c_lexer.hpp. For example:</p>
<pre name="code" class="cpp">template &lt;typename IteratorT, typename PositionT&gt;
inline
lexer&lt;IteratorT, PositionT&gt;::lexer(IteratorT const &amp;first, 
IteratorT const &amp;last, PositionT const &amp;pos, 
boost::wave::language_support language_) 
: filename(pos.get_file()), at_eof(false), language(language_),cache(token_cache&lt; typename lexer &lt; IteratorT, PositionT &gt;::string_type &gt;())
{
using namespace std; // some systems have memset in std
memset(&amp;scanner, '\0', sizeof(Scanner));
</pre>
<p> </p> ]]></description>
      <link>http://software.intel.com/en-us/articles/error-409-when-building-boost-libraries-1400-with-intel-compiler</link>
      <pubDate>Tue, 17 Nov 2009 19:21:42 -0800</pubDate>
      <comments>http://software.intel.com/en-us/articles/error-409-when-building-boost-libraries-1400-with-intel-compiler#comments</comments>
      <guid isPermaLink="true">http://software.intel.com/en-us/articles/error-409-when-building-boost-libraries-1400-with-intel-compiler</guid>
      <category>Intel® C++ Compiler for Linux* Knowledge Base</category>
    </item>
    <item>
      <title>Diagnostic 1881: argument must be a constant null pointer value</title>
      <description><![CDATA[ <p><strong>Cause:</strong></p>
<p>The sentinel attribute is described in the GNU* documentation here: <a href="http://gcc.gnu.org/onlinedocs/gcc-4.4.1/gcc/Function-Attributes.html#Function-Attributes">http://gcc.gnu.org/onlinedocs/gcc-4.4.1/gcc/Function-Attributes.html#Function-Attributes</a> </p>
<p>It says:</p>
<p>A valid NULL in this context is defined as zero with any pointer type. If your system defines the NULL macro with an integer type then you need to add an explicit cast.</p>
<p>The GNU compiler will give a diagnostic too also if "-Wformat" is specified.</p>
<p><strong>Example:</strong></p>
<pre name="code" class="cpp">#define NULL 0

//#define NULL ((void*)0)  // this fixes the problem

int execl(const char *path, const char *arg, ...) __attribute__ ((sentinel));

int main() {
   execl("","",NULL); // warning issued here
   return 0;
}
</pre>
<p> </p>
<blockquote>
<p>$ icc -c diag1881.c<br />diag1881.c(9): warning #1881: argument must be a constant null pointer value<br />     execl("","",NULL); // warning issued here<br />                 ^</p>
</blockquote>
<p><br /><strong>Resolution status:<br /></strong>Use a header file that defines NULL as a pointer type (such as stddef.h) or declare NULL correctly like:</p>
<pre name="code" class="cpp">#define NULL ((void*)0)  // this fixes the problem</pre> ]]></description>
      <link>http://software.intel.com/en-us/articles/cdiag1881</link>
      <pubDate>Mon, 16 Nov 2009 16:44:26 -0800</pubDate>
      <comments>http://software.intel.com/en-us/articles/cdiag1881#comments</comments>
      <guid isPermaLink="true">http://software.intel.com/en-us/articles/cdiag1881</guid>
      <category>Intel® C++ Compiler for Linux* Knowledge Base</category>
      <category>Intel® C++ Compiler for Mac OS X* Knowledge Base</category>
      <category>Intel® C++ Compiler for Windows* Knowledge Base</category>
      <category>Intel® Parallel Composer Knowledge Base</category>
    </item>
    <item>
      <title>Compiler incorrectly issues error #12178 on used local const</title>
      <description><![CDATA[ <br />
<div id="art_pre_template"><strong>Reference Number : </strong>DPD200049575<br /><br /><br /><strong>Version : </strong>11.0, 11.1<br /><br /><br /><strong>Product : </strong>Intel® C++ Compiler Professional Edition for Linux*  <br /><br /><br /><strong>Operating System : </strong>Linux*<br /><br /><br /><strong>Problem Description : </strong>When compiling a program using the Static Verifier Compiler option <strong>"-diag-enable sc3"</strong> the compiler incorrectly issues a message indicating that a local variable, that is used in the program,  is not used as shown in the example below.  Older versions of the 11.1 compiler report this message as a warning:<br /><br />
<p>$ <strong>cat t.cpp &amp;&amp; icc -V -diag-enable sc3 -c -fpic t.cpp &amp;&amp; icc -diag-enable sc3 -shared -o libt.so t.oic<br /></strong>Intel(R) C Intel(R) 64 Compiler Professional for applications running on Intel(R) 64, Version 11.0  Beta  Build 20080730 Package ID: l_cproc_b_11.0.044<br />Copyright (C) 1985-2008 Intel Corporation.  All rights reserved.<br /><br />#include &lt;stdio.h&gt;</p>
<p>void foo () {<br />    const int i = 0;<br />    printf ("%d\n", i);<br />}<br />t.cpp(4): error #12178: [SV] this value of "i" isn't used in the program</p>
<br /><br /><strong>Resolution Status : </strong>This problem has been resolved in the compiler package l_cproc_p_11.1.056 Build 20090827 or higher.  <br /><br /><br /><br /><i>[DISCLAIMER: The information on this web site is intended for hardware system manufacturers and software developers. Intel does not warrant the accuracy, completeness or utility of any information on this site. Intel may make changes to the information or the site at any time without notice. Intel makes no commitment to update the information at this site. ALL INFORMATION PROVIDED ON THIS WEBSITE IS PROVIDED "as is" without any express, implied, or statutory warranty of any kind including but not limited to warranties of merchantability, non-infringement of intellectual property, or fitness for any particular purpose. Independent companies manufacture the third-party products that are mentioned on this site. Intel is not responsible for the quality or performance of third-party products and makes no representation or warranty regarding such products. The third-party supplier remains solely responsible for the design, manufacture, sale and functionality of its products. Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries. *Other names and brands may be claimed as the property of others.]</i></div> ]]></description>
      <link>http://software.intel.com/en-us/articles/compiler-incorrectly-issues-error-12178-on-used-local-const</link>
      <pubDate>Fri, 23 Oct 2009 15:51:28 -0700</pubDate>
      <comments>http://software.intel.com/en-us/articles/compiler-incorrectly-issues-error-12178-on-used-local-const#comments</comments>
      <guid isPermaLink="true">http://software.intel.com/en-us/articles/compiler-incorrectly-issues-error-12178-on-used-local-const</guid>
      <category>Intel® C++ Compiler for Linux* Knowledge Base</category>
    </item>
    <item>
      <title>Warning #677: memory usage conflict with precompiled header file seen on Windows* XP and Linux*</title>
      <description><![CDATA[ <br />
<div id="art_pre_template"><strong>Reference Number :</strong> DPD200136749<br /><br /><br /><strong>Version : </strong>10.1, 11.0, 11.1<br /><br /><br /><strong>Product : </strong>Intel® C++ Compilers Professional Edition for Windows* and Linux*.  Intel ® Parallel Composer.<br /><br /><br /><strong>Operating System :</strong> Windows* versions prior to Windows Vista* or equivalent, Linux*<br /><br /><br /><strong>Problem Description : </strong>When using precompiled headers, you may see the diagnostic:<br /><br />Warning #677: memory usage conflict with precompiled header file<br /><br />This means that there was an internal problem with the precompiled header processing in the compiler and precompiled headers will not be used for the file in question which may cause an increase in build times.<br /><br /><br /><strong>Resolution Status :</strong> We are investigating this issue.  Please contact us via the User Forum or Intel® Premier Support if you are experiencing this issue.<br /><br /><br /><br /><i>[DISCLAIMER: The information on this web site is intended for hardware system manufacturers and software developers. Intel does not warrant the accuracy, completeness or utility of any information on this site. Intel may make changes to the information or the site at any time without notice. Intel makes no commitment to update the information at this site. ALL INFORMATION PROVIDED ON THIS WEBSITE IS PROVIDED "as is" without any express, implied, or statutory warranty of any kind including but not limited to warranties of merchantability, non-infringement of intellectual property, or fitness for any particular purpose. Independent companies manufacture the third-party products that are mentioned on this site. Intel is not responsible for the quality or performance of third-party products and makes no representation or warranty regarding such products. The third-party supplier remains solely responsible for the design, manufacture, sale and functionality of its products. Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries. *Other names and brands may be claimed as the property of others.]</i></div> ]]></description>
      <link>http://software.intel.com/en-us/articles/warning-677-memory-usage-conflict-with-precompiled-header-file-seen-on-windows-xp-and-linux</link>
      <pubDate>Thu, 22 Oct 2009 15:35:39 -0700</pubDate>
      <comments>http://software.intel.com/en-us/articles/warning-677-memory-usage-conflict-with-precompiled-header-file-seen-on-windows-xp-and-linux#comments</comments>
      <guid isPermaLink="true">http://software.intel.com/en-us/articles/warning-677-memory-usage-conflict-with-precompiled-header-file-seen-on-windows-xp-and-linux</guid>
      <category>Intel® C++ Compiler for Linux* Knowledge Base</category>
      <category>Intel® C++ Compiler for Windows* Knowledge Base</category>
      <category>Intel® Parallel Composer Knowledge Base</category>
    </item>
    <item>
      <title>Diagnostic 10120: overriding &amp;lt;option&gt; with &amp;lt;option&gt;</title>
      <description><![CDATA[ <p> </p>
<p><strong>Cause</strong>:</p>
<p>This warning is issued by the driver when you have two conflicting options on the same command line. The last one on the command line "wins".Remember that command line options can exist in makefiles and config files (i.e. icc.cfg, icpc.cfg, icl.cfg or ifort.cfg).</p>
<p><strong>Example:</strong></p>
<blockquote>
<p>&gt; icc -O3 -O2 -c foo.c<br />icc: command line warning #10120: overriding '-O3' with '-O2'</p>
</blockquote>
<p><strong>Resolution Status</strong>:</p>
<p>Look at your command line and remove the redundant flag.</p> ]]></description>
      <link>http://software.intel.com/en-us/articles/cdiag10120</link>
      <pubDate>Fri, 02 Oct 2009 14:54:04 -0700</pubDate>
      <comments>http://software.intel.com/en-us/articles/cdiag10120#comments</comments>
      <guid isPermaLink="true">http://software.intel.com/en-us/articles/cdiag10120</guid>
      <category>Intel® C++ Compiler for Linux* Knowledge Base</category>
      <category>Intel® C++ Compiler for Mac OS X* Knowledge Base</category>
      <category>Intel® C++ Compiler for Windows* Knowledge Base</category>
      <category>Intel® Parallel Composer Knowledge Base</category>
    </item>
    <item>
      <title>Diagnostic 10114: Microsoft Visual C++ not found in path</title>
      <description><![CDATA[ <p><br /><strong>Cause:</strong></p>
<p>The Intel(R) C++ compiler for Windows needs to know which version of the Microsoft* compiler (i.e. Microsoft Visual C++ 2003*, 2005*, 2008* etc) you are using in order to set our Microsoft compability version to emulate. <br /><br />For example, there are certain Microsoft bugs that exist in the Microsoft Visual C++ 2003 compiler but were fixed in Microsoft Visual C++ 2005 that we would only emulate if you had a Microsoft Visual C++ 2003 environment (header files and libraries). <br /><br />In order to do this, the icl driver looks in your path for the version of cl.exe and sets the microsoft version when it calls our compiler based upon what it finds.</p>
<p><strong>Example:</strong></p>
<p>Compiling any program on Windows and not having "cl.exe" somewhere in your path.</p>
<p><strong>Resolution status:</strong></p>
<p>Change your path environment variables to include the directories where Microsoft Visual C++ executable "cl.exe", include header files and run time libraries. Easiest way is to run Visual C++ vcvars32.bat. <br /><br />Or pass the options "/Qvc[7.1|8|9]" and "/Qlocation,link,"[cl-dir]" to the icl.exe.</p> ]]></description>
      <link>http://software.intel.com/en-us/articles/cdiag10114</link>
      <pubDate>Mon, 28 Sep 2009 11:28:53 -0700</pubDate>
      <comments>http://software.intel.com/en-us/articles/cdiag10114#comments</comments>
      <guid isPermaLink="true">http://software.intel.com/en-us/articles/cdiag10114</guid>
      <category>Intel® C++ Compiler for Linux* Knowledge Base</category>
      <category>Intel® C++ Compiler for Mac OS X* Knowledge Base</category>
      <category>Intel® C++ Compiler for Windows* Knowledge Base</category>
      <category>Intel® Parallel Composer Knowledge Base</category>
    </item>
  </channel></rss>