"const" globals are being handled as "static const" globals?

Kaz Kylheku bill@cafe.net
Thu May 14 21:12:00 GMT 1998


On Thu, 14 May 1998, Brad M. Garcia wrote:

> 
> If you define a variable within a file (global) like:
> 
>    const int foo = 1;
> 
> and compile it, you will find that egcs does _not_ give it global scope:

Perhaps you are compiling a C++ file (.cc or .cpp suffix). What you
are seeing is ANSI C++ at work. In C++, file scope consts have internal
linkage.

Try it with a .c source file.



More information about the Gcc-bugs mailing list