X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: Hans-Bernhard Broeker Newsgroups: comp.lang.c,comp.os.msdos.djgpp Subject: Re: Environment Variables Followup-To: comp.lang.c Date: 6 Aug 2004 12:44:34 GMT Lines: 28 Message-ID: <2nhcpiFrscoU1@uni-berlin.de> References: <41115A5F DOT 7DDC6318 AT yahoo DOT com> <41127AF9 DOT 26DEA37C AT yahoo DOT com> X-Trace: news.uni-berlin.de dOnFXsdKhzRhFg+0ad9VTAJXhXOVwDFvq9Jgt2fiJXzvnHpCR0QeTjI4PE X-Orig-Path: not-for-mail To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com [F'up2 c.l.c, because the ball is safely back in their playing field.] In comp.os.msdos.djgpp CBFalconer wrote: > I agree with you, provided you use -ansi -pedantic. You don't need -pedantic in this case. What you need is the effect of -ansi turning off all extensions present in the compiler's runtime library, compared to the C standard. In other words, you need a clean namespace for the above program to reliably print zero, and that's what -ansi is meant to give you. On a more relaxed note, you can ask gcc to warn you in situations like this, while still keeping the full functionality of the standard libc intact, by using the -fno-common option. In terms of the standard: -fno-common turns off the usual Unix linkers' extension of allowing tentative definitions to be resolved across the entire program, not just individual translation units. This problem is actually a comp.lang.c FAQ, and addressed in the C FAQ. Usually it happens with the name 'index', which exists in Unix libc, is not an ANSI/ISO standard C library function, but is *very* tempting to use as the name of some object in your own source code, until you run into this the first time. Go figure. -- Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de) Even if all the snow were burnt, ashes would remain.