<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated on Sun, 22 Nov 2009 13:58:23 -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-mac-os-x-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-mac-os-x-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>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>dyld:Library not loaded:libiomp5.dylib</title>
      <description><![CDATA[ <br />
<div id="art_pre_template"><b>Problem : </b><br />
<p>Build a mkl program on Mac OS with Intel fortran compiler, <br /><br />For example, m_cprof_p_11.1.076, <br />MKLPATH=/opt/intel/Compiler/11.1/076/Frameworks/mkl/lib/em64t<br />MKLINCLUDE=opt/intel/Compiler/11.1/076/Frameworks/mkl/include<br />&gt; ifort  main. f -o  main -L$(MKLPATH) -I$(MKLINCLUDE) -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core  -lpthread </p>
get compiler warning: <br />ld64 warning: indirect library libiomp5.dylib could not be loaded: file not found: libiomp5.dylib<br /><br />Or runtime error:<br />dyld: Library not loaded: libiomp5.dylib<br />  Referenced from: /opt/intel/Compiler/11.1/076/Frameworks/mkl/lib/em64t/libmkl_intel_thread.dylib<br />  Reason: image not found<br />Trace/BPT trap<br /><br /><br /><b>Root Cause : </b><br />Since MKL 10.0, MKL libraries for Mac OS* was integrated to Intel® C++/Fortran Compiler Professional Edition. The default path of MKL libraries were changed from <br />"/Library/Frameworks/Intel_MKL.framework/Versions/10.0.x.xxx/"   <br />to "/opt/intel/Compiler/11.x/0xx/Frameworks/mkl/"  <br /><br />At the same time, the default OpenMP library (libiomp5.dylib, libiomp5.a) used by MKL are not in &lt;MKL Libraries&gt;/lib directory as previous versions. They are  under Intel compiler lib directory now. <br />for example,  in /opt/intel/Compiler/11.0/0xx/lib<br /><br />(IPP is same, please see the article <a href="http://software.intel.com/en-us/articles/xcode-link-error-file-not-found-libiomp5dylib/">XCode link error: "file not found: libiomp5.dylib"</a> )<br /><br /><b>Resolution : </b><br />For compiler warning, <br />Please refer to the <a href="http://software.intel.com/en-us/articles/intel-mkl-link-line-advisor/">MKL link line advisor</a> <br />the command line could be <br />&gt;ifort  main. f -o  main -L$(MKLPATH) -I$(MKLINCLUDE) -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core <strong>-openmp</strong> -lpthread <br /><br />or <br />ifort  main. f -o  main -L$(MKLPATH) -I$(MKLINCLUDE) -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core <br />-L opt/intel/Compiler/11.1/076/lib <strong>-liomp5</strong> -lpthread <br /><br />For run-time error <br />Please add the path of libiomp5.dylib in system environment before run binary.<br />&gt;export DYLD_LIBRARY_PATH="opt/intel/Compiler/11.1/076/lib:$DYLD_LIBRARY_PATH"<br /><br /><br /></div> ]]></description>
      <link>http://software.intel.com/en-us/articles/dyld-library-not-loadedlibiomp5dylib</link>
      <pubDate>Mon, 16 Nov 2009 01:02:02 -0800</pubDate>
      <comments>http://software.intel.com/en-us/articles/dyld-library-not-loadedlibiomp5dylib#comments</comments>
      <guid isPermaLink="true">http://software.intel.com/en-us/articles/dyld-library-not-loadedlibiomp5dylib</guid>
      <category>Intel® C++ Compiler for Mac OS X* Knowledge Base</category>
      <category>Intel® Fortran Compiler for Mac OS X* Knowledge Base</category>
      <category>Intel® Integrated Performance Primitives Knowledge Base</category>
      <category>Intel® Math Kernel Library 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>
    <item>
      <title>Diagnostic 2215: definition at end of file not followed by a semicolon or a declarator</title>
      <description><![CDATA[ <br />
<p><strong>Cause:</strong></p>
<p>A header or source file does not have a terminator at the end of the file. This usually is followed by a syntax error in the file that includes the header file but can occur by itself if the terminator appears in the next file.</p>
<p><strong>Example:</strong></p>
<pre name="code" class="cpp">// diag2215.h

class C {
} // Warn on the suspect end-of-file condition here.

// diag2215.cpp
#include "diag2215.h"

Ctype;  // semicolon (terminator) is actually in the source file

int main() {
   return 0;
}
</pre>
<p> </p>
<blockquote>
<p>$ icpc -c diag2215.cpp<br />diag2215.h(4): warning #2215: definition at end of file not followed by a semicolon or a declarator<br />  } // no semicolon in this file<br />  ^</p>
</blockquote>
<p><strong>Resolution state:</strong></p>
<p>Either move the terminator to the file with the last token of the type definition or suppress the warning with -wd2215 (Linux*) or -Qwd2215 (Windows*).</p> ]]></description>
      <link>http://software.intel.com/en-us/articles/cdiag2215</link>
      <pubDate>Mon, 28 Sep 2009 11:12:27 -0700</pubDate>
      <comments>http://software.intel.com/en-us/articles/cdiag2215#comments</comments>
      <guid isPermaLink="true">http://software.intel.com/en-us/articles/cdiag2215</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 553: a template argument may not reference an unnamed type</title>
      <description><![CDATA[ <div id="art_pre_template"><br /><br /><b>Cause : </b><br /><br />
<p>In standard C++98/C++03, template type arguments must have linkage, and therefore cannot be based on local or unnamed classes/enums.</p>
<p>So an example of where this diagnostic would be emitted is below.<br />g++ emits a similar diagnostic on the code below as well.</p>
<p><b>Example : </b></p>
<pre name="code" class="cpp">template &lt;class T&gt; struct FOO {};

typedef struct { } *unnamed;

void bar() {
  FOO&lt;unnamed&gt; f2;
}

int main() {
  bar();
  return 0;
}
</pre>
<p> </p>
<blockquote>
<p>$ icc -c -V diag553.cpp<br />Intel(R) C Intel(R) 64 Compiler Professional for applications running on Intel(R) 64, Version 11.0    Build 20090318 Package ID: l_cproc_p_11.0.083<br />Copyright (C) 1985-2009 Intel Corporation.  All rights reserved.</p>
<p>diag553.cpp(6): error: a template argument may not reference an unnamed type<br />    FOO&lt;unnamed&gt; f2;<br />        ^</p>
</blockquote>
<p><strong><b>Resolution Status : </b><br /></strong><br />We have an open bug report to allow this behaviour for Microsoft* compatibility in the Intel(R) C++ compiler for Windows. <br />To fix the code you should supply a name for the unnamed structure or enum.</p>
</div> ]]></description>
      <link>http://software.intel.com/en-us/articles/cdiag553</link>
      <pubDate>Mon, 28 Sep 2009 11:03:50 -0700</pubDate>
      <comments>http://software.intel.com/en-us/articles/cdiag553#comments</comments>
      <guid isPermaLink="true">http://software.intel.com/en-us/articles/cdiag553</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>