Question: When I try to compile the following with g++:

```
const int zero;

int main()
{
  return 0;
}

```

I get an error about an `uninitialized const 'zero'`. I thought that global variables were default initialized to 0 [1] ? Why isn't this the case here?  

VS compiles this fine.

[1] For example, see <https://stackoverflow.com/a/10927293/331785>

Answer: 
My gcc is slightly more verbose:

```
$ g++ zeroconst.c
zeroconst.c:1:11: error: uninitialized const ‘zero’ [-fpermissive]

```

We see that `-fpermissive` option will allow this to compile.

See this question on [uninitialized const](https://stackoverflow.com/questions/8092670/uninitialized-const) for a reference to C++ standard (the problem is C++-specific).

As cited at [GCC wiki](http://gcc.gnu.org/wiki/VerboseDiagnostics#error:_uninitialized_const_.27d.27_.5B-fpermissive.5D.2C_note:_.27const_class_D.27_has_no_user-provided_default_constructor):

> 
> As mandated by the C++ standard (8.5 [decl.init], para 9 in C++03,
>  para 6 in C++0x), G++ does not allows objects of const-qualified type
>  to be default initialized unless the type has a user-declared default
>  constructor. Code that fails to compile can be fixed by providing an
>  initializer...
> 
> 
>
G++ requires that you initialize your constant during definition.