title: C/C++ extension for Visual Studio Code, gcc, Mac: "variable uint32_t is not a type name"
body: <p>I've begun using VSC for my embedded C projects with gcc for ARM on a Mac. Having set up include paths in <code>c_cpp_properties.json</code>, most of my <code>#includes</code> are now working. However, a line such as this:</p>
  
  <pre><code>uint32_t m_ttff_seconds = 0;
  </code></pre>
  
  <p>produces a red squiggly underline and the error:</p>
  
  <pre><code>variable uint32_t is not a type name
  </code></pre>
  
  <p>The source file in question includes stdint:</p>
  
  <pre><code>#include &lt;stdint.h&gt;
  </code></pre>
  
  <p>and the <code>includePath</code> includes:</p>
  
  <pre><code>"${HOME}/dev/gcc-arm-none-eabi-4_9-2015q3/lib/gcc/arm-none-eabi/4.9.3/include"
  </code></pre>
  
  <p>and:</p>
  
  <pre><code>"intelliSenseMode": "clang-x64"
  </code></pre>
  
  <p>(the only other option being <code>msvc-x64</code>).</p>
  
  <p>The codebase compiles just fine when I use make and gcc. How do I show the C/C++ extension where <code>uint32_t</code> is?</p>
  
  <p>Edit:</p>
  
  <p><code>stdint.h</code> looks like this:</p>
  
  <pre><code>#ifndef _GCC_WRAP_STDINT_H
  #if __STDC_HOSTED__
  # if defined __cplusplus &amp;&amp; __cplusplus &gt;= 201103L
  #  undef __STDC_LIMIT_MACROS
  #  define __STDC_LIMIT_MACROS
  #  undef __STDC_CONSTANT_MACROS
  #  define __STDC_CONSTANT_MACROS
  # endif
  # include_next &lt;stdint.h&gt;
  #else
  # include "stdint-gcc.h"
  #endif
  #define _GCC_WRAP_STDINT_H
  #endif
  </code></pre>
  
  <p>and <code>stdint-gcc.h</code> contains:</p>
  
  <pre><code>/* 7.8.1.1 Exact-width integer types */
  
  #ifdef __INT8_TYPE__
  typedef __INT8_TYPE__ int8_t;
  #endif
  #ifdef __INT16_TYPE__
  typedef __INT16_TYPE__ int16_t;
  #endif
  #ifdef __INT32_TYPE__
  typedef __INT32_TYPE__ int32_t;
  #endif
  #ifdef __INT64_TYPE__
  typedef __INT64_TYPE__ int64_t;
  #endif
  #ifdef __UINT8_TYPE__
  typedef __UINT8_TYPE__ uint8_t;
  #endif
  #ifdef __UINT16_TYPE__
  typedef __UINT16_TYPE__ uint16_t;
  #endif
  #ifdef __UINT32_TYPE__
  typedef __UINT32_TYPE__ uint32_t;
  #endif
  #ifdef __UINT64_TYPE__
  typedef __UINT64_TYPE__ uint64_t;
  #endif
  </code></pre>
  
  <p>This suggests <code>__UINT32_TYPE__</code> is NOT defined when VSC is parsing my code, but it IS defined when I build with make and gcc.</p>
  
  <p>Edit:</p>
  
  <p>Following @mbmcavoy's answer I'm including my <code>c_cpp_properties.json</code> file here:</p>
  
  <pre><code>{
      "configurations": [
          {
              "name": "Mac",
              "includePath": [
                  "${HOME}/dev/gcc-arm-none-eabi-4_9-2015q3/lib/gcc/arm-none-eabi/4.9.3/include",
                  "${HOME}/dev/nRF5_SDK_14.0.0_3bcc1f7/components/libraries/util",
                  "${HOME}/dev/nRF5_SDK_14.0.0_3bcc1f7/config",
                  [many more of these omitted]
                  "${HOME}/dev/wisol_SDK_SFM20Rx_master/development/sigfox_cfg2/source",
                  "${workspaceRoot}"
              ],
              "browse": {
                  "path": [
                      "${HOME}/dev/gcc-arm-none-eabi-4_9-2015q3/lib/gcc/arm-none-eabi/4.9.3/include",
                      "${HOME}/dev/nRF5_SDK_14.0.0_3bcc1f7/components/libraries/util",
                      "${HOME}/dev/nRF5_SDK_14.0.0_3bcc1f7/config",
                      [many more of these omitted]
                      "${workspaceRoot}"
                  ],
                  "databaseFilename": "${workspaceRoot}/.vscode/browse.vc.db"
              },
              "intelliSenseMode": "clang-x64",
              "macFrameworkPath": [
                  "/System/Library/Frameworks",
                  "/Library/Frameworks"
              ],
              "defines": [
                  "__UINT_LEAST16_MAX__=65535",
                  "__UINT_LEAST8_TYPE__=unsigned char",
                  "__UINT8_MAX__=255",
                  "__UINT_FAST64_MAX__=18446744073709551615ULL",
                  "__UINT_FAST8_MAX__=4294967295U",
                  "__UINT_LEAST64_MAX__=18446744073709551615ULL",
                  "__UINT_LEAST8_MAX__=255",
                  "__UINTMAX_TYPE__=long long unsigned int",
                  "__UINT32_MAX__=4294967295UL",
                  "__UINT16_C(c)=c",
                  "__UINT16_MAX__=65535",
                  "__UINT8_TYPE__=unsigned char",
                  "__UINT64_C(c)=c ## ULL",
                  "__UINT_LEAST16_TYPE__=short unsigned int",
                  "__UINT64_MAX__=18446744073709551615ULL",
                  "__UINTMAX_C(c)=c ## ULL",
                  "__UINT_FAST32_MAX__=4294967295U",
                  "__UINT_LEAST64_TYPE__=long long unsigned int",
                  "__UINT_FAST16_TYPE__=unsigned int",
                  "__UINT_LEAST32_MAX__=4294967295UL",
                  "__UINT16_TYPE__=short unsigned int",
                  "__UINTPTR_MAX__=4294967295U",
                  "__UINT_FAST64_TYPE__=long long unsigned int",
                  "__UINT_LEAST32_TYPE__=long unsigned int",
                  "__UINT8_C(c)=c",
                  "__UINT64_TYPE__=long long unsigned int",
                  "__UINT32_C(c)=c ## UL",
                  "__UINT_FAST32_TYPE__=unsigned int",
                  "__UINTMAX_MAX__=18446744073709551615ULL",
                  "__UINT32_TYPE__=long unsigned int",
                  "__UINTPTR_TYPE__=unsigned int",
                  "__UINT_FAST16_MAX__=4294967295U",
                  "__UINT_FAST8_TYPE__=unsigned int"
              ]
          }
      ],
      "version": 3
  }
  </code></pre>
  
  <p>Edit:</p>
  
  <p>On digging deeper, I found that <code>gcc-arm-none-eabi-4_9-2015q3/lib/gcc/arm-none-eabi/4.9.3/include/stdint.h</code> had <code>__STDC_HOSTED__</code> defined and therefore <code>stdint-gcc.h</code> was not actually being included. Instead, that header does an "<code>include_next &lt;stdint.h&gt;</code>", which finds <code>gcc-arm-none-eabi-4_9-2015q3/arm-none-eabi/include/stdint.h</code>. I still can't see where unint32_t is defined, either for gcc and make or for VSC.</p>