From: pavenis AT lanet DOT lv Message-ID: To: Eli Zaretskii , djgpp AT delorie DOT com Date: Wed, 19 Jan 2000 11:34:28 +0200 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: make depend References: In-reply-to: X-mailer: Pegasus Mail for Win32 (v3.12b) Reply-To: djgpp AT delorie DOT com On 18 Jan 00, at 9:55, Eli Zaretskii wrote: > > 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. I think such goal is not reachable. Examples: code using macrodefinitions like FILENAME_MAX or code explicitly using stdin, stdout or stderr (like fflush(stdout)). Procedures returning value in floating point register etc. DJGPP_MINOR isn't in ANSI standard (in difference from some ot things I mentioned above). So I don't understand why it should have higher priority. > > The best way to solve this nuisance would be to have some environment > variable that specifies default command-line arguments for gcc or cpp. > Then we could simply put -D__DJGPP__= there (in djgpp.env), and forget > about this issue. > It was also said that removal such definition (DJGPP_MINOR at compiler startup) should cause hard to debug problems. Here is simple (and easy to use) rule that would force GCC to emit errors on such problems (for us to be able to fix them): Never define DJGPP_MINOR in application. For example, don't include code like #ifndef DJGPP_MINOR #define DJGPP_MINOR 1 #endif in code (or application's header files). I think there is no problems to grep sources for violations of this rule. One can even write simple script to automate this. After that there will be no problem for GCC to emit errors when DJGPP_MINOR is not defined (when one removes -imacros %s../include/sys/version.h hack from specs) Andris