From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Ing-Simmons To: rh@unifix.de Cc: drepper@cygnus.com, rms@gnu.ai.mit.edu, dm@sgi.com, Jim Wilson , gas2@cygnus.com, gcc2@cygnus.com, Ian Lance Taylor Subject: Re: global vars and symbol visibility for mips32/elf Date: Wed, 14 Aug 1996 00:18:00 -0000 Message-id: <199608140716.IAA28416@pluto> References: X-SW-Source: 1996/msg00098.html Ruediger Helsch writes: >But the standard allows such behaviour only if no strictly >standard-conforming program is broken by the extension. The following >program is strictly conforming and should continue to run: > > #include > int optind[30000], optarg[30000]; > > main() > { > int i; > for (i = 0; i < 30000; i++) { > optind[i] = 1; > optarg[i] = 2; > } > > for (i = 0; i < 30000; i++) { > assert(optind[i] == 1); > assert(optarg[i] == 2); > } > return 0; > } > >Try this to see whether your compiler conforms to the C standard! > FWIW - gcc-2.7.2 (using /usr/ccs/bin/ld) , Solaris 2.5 gcc x.c -o x ld: warning: symbol `optind' has differing sizes: (file /var/tmp/cca006vl1.o value=0x1d4c0; file /usr/lib/libc.so value=0x4); /usr/lib/libc.so definition taken ld: warning: symbol `optarg' has differing sizes: (file /var/tmp/cca006vl1.o value=0x1d4c0; file /usr/lib/libc.so value=0x4); /usr/lib/libc.so definition taken pluto 5% x Segmentation Fault (core dumped) Identical results with SunPro cc ...