www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/01/19/07:30:32

From: pavenis AT lanet DOT lv
Message-ID: <B0000116380@stargate.astr.lu.lv>
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>, djgpp AT delorie DOT com
Date: Wed, 19 Jan 2000 11:34:28 +0200
MIME-Version: 1.0
Subject: Re: make depend
References: <Pine DOT A41 DOT 4 DOT 05 DOT 10001171922480 DOT 64218-100000 AT ieva01 DOT lanet DOT lv>
In-reply-to: <Pine.SUN.3.91.1000118095433.3041E-100000@is>
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019