title: Why does gcc allow extern declarations of type void (non-pointer)?
body: <p>Why does gcc allow extern declarations of type void?  Is this an extension or
  standard C?  Are there acceptable uses for this?</p>
  
  <p>I am guessing it is an extension, but I don't find it mentioned at:<br>
  <a href="http://gcc.gnu.org/onlinedocs/gcc-4.3.6/gcc/C-Extensions.html">http://gcc.gnu.org/onlinedocs/gcc-4.3.6/gcc/C-Extensions.html</a></p>
  
  <pre><code>$ cat extern_void.c
  extern void foo; /* ok in gcc 4.3, not ok in Visual Studio 2008 */
  void* get_foo_ptr(void) { return &amp;foo; }
  
  $ gcc -c extern_void.c # no compile error
  
  $ gcc --version | head -n 1
  gcc (Debian 4.3.2-1.1) 4.3.2
  </code></pre>
  
  <p>Defining foo as type void is of course a compile error:</p>
  
  <pre><code>$ gcc -c -Dextern= extern_void.c
  extern_void.c:1: error: storage size of ‘foo’ isn’t known
  </code></pre>
  
  <p>For comparison, Visual Studio 2008 gives an error on the extern declaration:</p>
  
  <pre><code>$ cl /c extern_void.c 
  Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.21022.08 for 80x86
  Copyright (C) Microsoft Corporation.  All rights reserved.
  
  extern_void.c
  extern_void.c(1) : error C2182: 'foo' : illegal use of type 'void'
  </code></pre>