From: Nate Eldredge Newsgroups: comp.os.msdos.djgpp Subject: Re: make depend Date: 24 Jan 2000 13:08:25 -0800 Organization: InterWorld Communications Lines: 40 Message-ID: <83u2k3kwja.fsf@mercury.st.hmc.edu> References: NNTP-Posting-Host: mercury.st.hmc.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: nntp1.interworld.net 948748215 94644 134.173.45.219 (24 Jan 2000 21:10:15 GMT) X-Complaints-To: usenet AT nntp1 DOT interworld DOT net NNTP-Posting-Date: 24 Jan 2000 21:10:15 GMT User-Agent: Gnus/5.0802 (Gnus v5.8.2) Emacs/20.5 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Eli Zaretskii writes: > On Mon, 17 Jan 2000, Andris Pavenis wrote: > > > Including $DJDIR/lib/../include/sys/version.h is a hack how to get > > definitions of current DJGPP version automatically in. I still think > > that best would be to force to include stdio.h when one needs version > > definitions, but there were objections against such solution. > > The main objection is this: the ANSI Standard says that a program > which doesn't include any header files should still have the same > behavior as when it does. How can this be? Consider: #include double my_sqrt(double d); { double x; return sqrt(d); } If you don't include , the implicit declaration of `sqrt' will be used: `int sqrt();'. So the compiler will use the calling conventions for an int-returning function instead of a double, and on most platforms it'll be wrong. On x86, for instance, you'll get whatever garbage was in %eax, casted to double. This is definitely different behavior than when you do include , when you get the right answer. Does ANSI really expect every platform to work some magic to make this work anyhow? Are there any that actually do? -- Nate Eldredge neldredge AT hmc DOT edu