www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/01/19/11:48:20

From: pavenis AT lanet DOT lv
Message-ID: <B0000116389@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 12:09:36 +0200
MIME-Version: 1.0
Subject: Re: make depend
References: <B0000116380 AT stargate DOT astr DOT lu DOT lv>
In-reply-to: <Pine.SUN.3.91.1000119114743.9609P-100000@is>
X-mailer: Pegasus Mail for Win32 (v3.12b)
Reply-To: djgpp AT delorie DOT com

On 19 Jan 00, at 11:49, Eli Zaretskii wrote:

> 
> On Wed, 19 Jan 2000 pavenis AT lanet DOT lv wrote:
> 
> > > 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.
> 
> Perhaps not in 100%, but it doesn't mean we shouldn't try.
> 
> > 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):
> 
> The case was with programs that were ported *before* v2.03.  What you 
> suggest is reasonable, but it doesn't help for old code.

We'll here is sample of very simple script that detects such definitions that should be 
avoided:

#! /bin/sh

for file in `cat manifest/$1`; do
  case $file in *.c|*.cc|*.h|*.C)
    cat $file | \
    awk '$1=="#define" && $2=="DJGPP_MINOR" {found=1} END {exit found}' ||\
    echo $file ;;
  esac;
done

It works for DJGPP packages which have .mft files, but it's simple to modify it
to scan a directory tree instead (tested: script found include/sys/version.h
in djdev203 as it should). After removal of explicit #define DJGPP_MINOR and
#undef DJGPP_MINOR in user code (and header files) the remaining work will
be done by GCC.

Of course it would be complicated for novices, but I think novices are likely
not to use definition of DJGPP_MINOR anyway.

Andris

- Raw text -


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