title: Error in system header file /usr/include/i386_types.h
body: <p>I've been using C/C++ for about 7 months, and am currently trying to write a small set of linear algebra programs. Right now I'm trying to test my vector class, but get the error message:</p>
  
  <pre><code>In file included from /usr/include/machine/_types.h:34,
               from /usr/include/sys/_types.h:33,
               from /usr/include/_types.h:27,
               from /usr/include/unistd.h:71,
               from /usr/include/c++/4.2.1/i686-apple-darwin10/x86_64/bits/os_defines.h:61,
               from /usr/include/c++/4.2.1/i686-apple-darwin10/x86_64/bits/c++config.h:41,
               from /usr/include/c++/4.2.1/cstdlib:50,
               from linalgtest.cpp:8:
  /usr/include/i386/_types.h:37: error: two or more data types in declaration of ‘__int8_t’
  </code></pre>
  
  <p>In file included from /usr/include/c++/4.2.1/stdexcept:43,
                   from vector.cpp:8:
      /usr/include/c++/4.2.1/exception:40: error: ‘#pragma’ is not allowed here</p>
  
  <pre><code>shell returned 1
  </code></pre>
  
  <p>I am running Mac OS X 10.6.5, and have checked my <code>/usr/include/i386_types.h</code> file against the one found at <a href="http://www.opensource.apple.com/source/xnu/xnu-1456.1.26/bsd/i386/_types.h" rel="nofollow">http://www.opensource.apple.com/source/xnu/xnu-1456.1.26/bsd/i386/_types.h</a>. They appear to be the same, for whatever that's worth.</p>
  
  <p>Here are the contents of my tester file</p>
  
  <pre><code>#include "linalg.h" // L7
  #include &lt;cstdlib&gt; // L8: the offending line
  #include &lt;cmath&gt; // L9
  
  using namespace std;
  
  double drand(double d) { return d*((double)rand()/RAND_MAX); }
  
  int main(void) {
     int n = 10;
     double comps[10];
     for (int i = 0; i &lt; n; ++i)
        comps[i] = drand(10.0);
  
     vector *v1 = new vector(n);
     vector *v2 = new vector(n, comps);
     v1-&gt;print();
     v2-&gt;print();
  
     return 0;
  }
  </code></pre>
  
  <p>The offending line (37) from _types.h is:</p>
  
  <pre><code>#ifdef __GNUC__
  typedef __signed char      __int8_t;  // L37
  #else /* !__GNUC__ */
  typedef char               __int8_t;
  </code></pre>
  
  <p>From exception (40):</p>
  
  <pre><code>#ifndef __EXCEPTION__
  #define __EXCEPTION__
  
  #pragma GCC visibility push(default)  // L40
  
  #include &lt;bits/c++config.h&gt;
  </code></pre>
  
  <p>I've done some searching on Google, and seen things involving similar types of errors, but its usually the result of a syntax error in user code. I also see this exact error on the machines in my university's computer lab. They run gcc/g++-4.2.4 on ubuntu lucid. I run gcc/g++-4.2.1 on mac os x 10.6.5.</p>