delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/01/23/02:05:06

Message-Id: <199801230701.JAA13012@ankara.duzen.com.tr>
Comments: Authenticated sender is <mitch AT ankara DOT duzen DOT com DOT tr>
From: "S. M. Halloran" <mitch AT duzen DOT com DOT tr>
Organization: User RFC 822- and 1123-Compliant
To: djgpp AT delorie DOT com
Date: Fri, 23 Jan 1998 09:02:03 +0200
MIME-Version: 1.0
Subject: Re: access() in DJGPP and TC/BC
CC: djgpp AT delorie DOT com
References: <199801220827 DOT KAA08443 AT ankara DOT duzen DOT com DOT tr>
In-reply-to: <Pine.SUN.3.91.980122184458.1427L-100000@is>

On 22 Jan 98, Eli Zaretskii was found to have commented thusly:

> 
> On Thu, 22 Jan 1998, S. M. Halloran wrote:
> 
> > This is a C language fundamental that you bring up.  Constants should 
> > never really be used in the code and should really be defined by 
> > macros for the purpose of portability.  If you always use the macro 
> > symbols for constants for functions in the standard library (or 
> > functions with well-understood portability), you should never have a 
> > problem getting the code to work on different implementations.  It is 
> > a very rare case that numeric constants, rather than their symbolic 
> > macros, would ever be used directly in the code.
> 
> Unfortunately, this advice is useless in the case of `access', since
> some systems (TC is one of them, but there are others, even on Unix)
> don't define the R_OK, W_OK etc. symbols for the mode argument of
> `access'.  On those systems, you *must* use numeric values if you
> call `access'.  That's why I advise to avoid using this function.
> 
I checked a TC++ v3.0 copy for access(), and indeed you're right.  
Incredibly Borland did not define the constants with macros.  What is 
more bizarre is that Borland indicated in its portability table that 
access() is portable with Unix.  Why Borland borrows a function from 
Unix, then fails to use the constants that were probably defined the 
day that access() was conceived is vexing.  Is it the case that 
the earliest implementations of access() in Unix did, in fact, not 
use macro symbols?

Mitch Halloran
Research (Bio)chemist
Duzen Laboratories Group
Ankara   TURKEY
mitch AT duzen DOT com DOT tr

other job title:  Sequoia's (dob 12-20-95) daddy

- Raw text -


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