From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jim Wilson To: Ian Lance Taylor Cc: rms@gnu.ai.mit.edu, drepper@cygnus.com, dm@sgi.com, gcc2@cygnus.com, gas2@cygnus.com Subject: Re: global vars and symbol visibility for mips32/elf Date: Sat, 10 Aug 1996 23:26:00 -0000 Message-id: <199608110626.XAA06107@cygnus.com> References: <9608110241.AA22482@tweedledumb.cygnus.com> X-SW-Source: 1996/msg00083.html The case which causes trouble is when a program uses a common variable (an uninitialized variable in C; most languages, including C++, have no notion of common variables). ANSI/ISO C also does not have common variables. A program with multiple external definitions of a variable has undefined behaviour. However, C compilers that make this work by treating uninitialized variables as common are so prevalent that most people aren't aware of this. This particular feature is mentioned in the `Common Extensions' appendix, in the section `Multiple External Definitions'. This also means that, technically, if you want to make sure that other ANSI/ISO C compilers can compile your code, you must use -fno-common in addition to -ansi and -pedantic. Jim