<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated on Sun, 08 Nov 2009 10:36:21 -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 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>
    <item>
      <title>Diagnostic 436: pointer to incomplete class type is not allowed</title>
      <description><![CDATA[ <p><strong>Cause:</strong></p>
<p>Trying to use the arrow field selection operator on an object whose type is incomplete. An incomplete type is a type which<br />has not been defined yet, there is only a forward declaration of the type.</p>
<p><strong>Example:</strong></p>
<pre name="code" class="cpp">class C;   // forward declaration of class C

int main() {
  C* cp = 0;
  cp-&gt;foo();  // error here
  return 0;
}
</pre>
<p> </p>
<blockquote>
<p>$ icpc -c diag436.cpp<br />diag436.cpp(5): error: pointer to incomplete class type is not allowed<br />    cp-&gt;foo();  // error here<br />    ^</p>
</blockquote>
<p>compilation aborted for diag436.cpp (code 2)</p>
<p><strong>Resolution Status:</strong></p>
<p>Make sure the class/struct/union type has been defined before you try to use the arrow (-&gt;) operator.</p> ]]></description>
      <link>http://software.intel.com/en-us/articles/cdiag436</link>
      <pubDate>Mon, 28 Sep 2009 11:01:03 -0700</pubDate>
      <comments>http://software.intel.com/en-us/articles/cdiag436#comments</comments>
      <guid isPermaLink="true">http://software.intel.com/en-us/articles/cdiag436</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 in 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, 28 Sep 2009 10:57:08 -0700</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>Diagnostic 1569: class member typedef may not be redeclared</title>
      <description><![CDATA[ <p><strong>Cause:</strong></p>
<p>This diagnostic is triggered when you redeclare a typedef (to the same type) within a class.</p>
<p>Member typedefs cannot be redeclared in strict C++ mode (clarified in TC1; see 7.1.3/2 in the 2003 standard).  Most compilers do not enforce this, but the Intel C++ Compiler emits this warning.</p>
<p><strong>Example:</strong></p>
<pre name="code" class="cpp">struct C {
  typedef int* ip;
  typedef int* ip;
};
</pre>
<p> </p>
<blockquote>
<p>$ icc -c diag1569.cpp<br />diag1569.cpp(6): warning #1569: class member typedef may not be redeclared<br />    typedef int* ip;<br />                 ^</p>
</blockquote>
<p><strong>Resolution status:<br /></strong>Remove one of the redundant declarations.</p> ]]></description>
      <link>http://software.intel.com/en-us/articles/cdiag1569</link>
      <pubDate>Mon, 28 Sep 2009 10:51:42 -0700</pubDate>
      <comments>http://software.intel.com/en-us/articles/cdiag1569#comments</comments>
      <guid isPermaLink="true">http://software.intel.com/en-us/articles/cdiag1569</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 1487: destructible entities are not allowed inside of a statement expression</title>
      <description><![CDATA[ <p><strong>Cause:</strong></p>
<p>GNU* statement expressions are described here: <a href="http://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html">http://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html</a></p>
<p>The diagnostic occurs if you declare an object with a destructor inside one of these expressions such as in the example below. This is to avoid various implementation difficulties. <br /><br />The following are also currently prohibited in statement expressions in C++ mode:</p>
<ul>
<li>dynamically-initialized local static variables, </li>
<li>dlocal non-POD class definitions</li>
<li>try/catch </li>
</ul>
<p>Also, branching out of a statement expression is not allowed, and statement expressions may not be used in default argument expressions.</p>
<pre name="code" class="cpp">class C {
public:
     ~C();
};

void foo() {
   if  (( { C c; } ), true); // error inside this statement expression
}
</pre>
<p> </p>
<p><strong>Resolution status:</strong></p>
<p>Do not use GNU statement expressions if you need to make use of a destructible entity inside of one. Instead use macros, functions or lambdas (which are now available in -std=c++0x mode).</p>
<p> </p> ]]></description>
      <link>http://software.intel.com/en-us/articles/cdiag1487</link>
      <pubDate>Mon, 28 Sep 2009 10:49:14 -0700</pubDate>
      <comments>http://software.intel.com/en-us/articles/cdiag1487#comments</comments>
      <guid isPermaLink="true">http://software.intel.com/en-us/articles/cdiag1487</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 569: a parameter may not have void type</title>
      <description><![CDATA[ <p><strong>Cause:</strong></p>
<p>The Intel(R) C++ compiler for Linux* will give this diagnostic when you try to instantiate template parameter with type void.</p>
<p>For compatibility with the Microsoft* compiler the Intel(R) C++ compiler for Windows will allow (with a warning) an ordinary (i.e., nontemplate) member function of a class template to be treated as a function taking no arguments if it has a single parameter whose type is void after instantiation.</p>
<p>For example:</p>
<pre name="code" class="cpp">template&lt;typename T&gt; struct S {
    int f(T);
};

int r = S&lt;void&gt;().f();  // error on Linux, warning on Windows
</pre>
<p> </p>
<br />
<blockquote>
<p>$ icpc -c diag569.cpp<br />diag569.cpp(4): error: a parameter may not have void type<br />      int f(T);<br />            ^<br />          detected during instantiation of class "S&lt;T&gt; [with T=void]" at line 7</p>
<p>diag569.cpp(7): error #165: too few arguments in function call<br />  int r = S&lt;void&gt;().f();  // error on Linux, warning on Windows</p>
</blockquote>
<p><strong>Resolution Status:</strong></p>
<p>Do not use void as a template parameter argument. You may need to create a specialization for the template with void type.</p> ]]></description>
      <link>http://software.intel.com/en-us/articles/cdiag569</link>
      <pubDate>Mon, 28 Sep 2009 10:41:45 -0700</pubDate>
      <comments>http://software.intel.com/en-us/articles/cdiag569#comments</comments>
      <guid isPermaLink="true">http://software.intel.com/en-us/articles/cdiag569</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 1159: ordered region must be closely nested inside a loop or parallel loop region with an ordered clause</title>
      <description><![CDATA[ <p><strong>Cause:</strong></p>
<p>According to the OpenMP* API "The ordered construct specifies a structured block in a loop region which wil be executed in the order of the loop iterations." <br />This diagnositic is issued if the compiler finds an ordered region which is not closely nested inside a loop with an ordered clause.</p>
<p><strong>Example:</strong></p>
<pre name="code" class="cpp">void foo()
{
  int k;
#pragma omp parallel
#pragma omp ordered  // no #pragma omp parallel ordered loop before this
  printf("%d\n",k);
}
</pre>
<p> </p>
<blockquote>
<p>&gt;&gt; icc -c -openmp diag1159.c<br />diag1159.c(5): error: ordered region must be closely nested inside a loop or parallel loop region with an ordered clause<br />  #pragma omp ordered<br />          ^</p>
</blockquote>
<p><strong>Resolution status:<br /></strong>Add a loop before the ordered region, i.e.:</p>
<pre name="code" class="cpp">void foo()
{
  int k;
#pragma omp parallel for ordered
  for (k = 0; k &lt; 4; k++) {
#pragma omp ordered
    printf("%d\n",k);
  }
}
</pre> ]]></description>
      <link>http://software.intel.com/en-us/articles/cdiag1159</link>
      <pubDate>Mon, 28 Sep 2009 08:59:19 -0700</pubDate>
      <comments>http://software.intel.com/en-us/articles/cdiag1159#comments</comments>
      <guid isPermaLink="true">http://software.intel.com/en-us/articles/cdiag1159</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>