Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: Dave Butenhof <butenhof@zko.dec.com>
Subject: Re: Q:_POSIX_SOURCE compile option
Date: 1996/09/23	[thread overview]
Message-ID: <32468CF8.15FB@zko.dec.com> (raw)
In-Reply-To: 32419437.794B@dna406.dna.mci.com


David Hinz wrote:
> 
> We are currently porting code between DEC UNIX 3.2c and AIX 3.2.5. When
> the code was originally written we did not use the _POSIX_SOURCE compile
> option. Now that we are porting to AIX it looks like it may be easier to
> port the code if we used the _POSIX_SOURCE setting on both systems. Does
> any one have experience (good, bad, otherwise) with setting this option?
> Does it really make the code more portable?
> 
> I would appreciate any info...
> 
> dave.

Well, dave, that depends very much upon how portable the code is. If
your program is "strictly conforming" to POSIX 1003.1-1990, then setting
_POSIX_SOURCE will probably make porting much easier, because you'll be
masking out all differences between the various systems, reducing them
all to pure POSIX 1003.1-1990.

But there are catches. "Strictly conforming" means that you use ONLY
what is EXPLICITLY REQUIRED in the POSIX standard. You do not rely on
any behavior that is allowed to differ between implementations, and you
will work correctly with any allowed behavior as the default. That's a
really big "if" for most UNIX code.

If you use ANY BSD or System V capability, or any "POSIX extension",
then explicitly turning on _POSIX_SOURCE will make your job a living
hell until you've resolved all the implicit dependencies you didn't
know about. But, as long as you have no REAL dependency on the non POSIX
features, even that may have a long-term benefit, just like turning on
strict ANSI-C checking in your compiler.

/---[ Dave Butenhof ]-----------------------[ butenhof@zko.dec.com ]---\
| Digital Equipment Corporation           110 Spit Brook Rd ZKO2-3/Q18 |
| 603.881.2218, FAX 603.881.0120                  Nashua NH 03062-2698 |
\-----------------[ Better Living Through Concurrency ]----------------/



      reply	other threads:[~1996-09-23  4:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-09-19  4:00 Q:_POSIX_SOURCE compile option David Hinz
1996-09-23  4:00 ` Dave Butenhof [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox