* Q:_POSIX_SOURCE compile option
@ 1996-09-19 4:00 David Hinz
1996-09-23 4:00 ` Dave Butenhof
0 siblings, 1 reply; 2+ messages in thread
From: David Hinz @ 1996-09-19 4:00 UTC (permalink / raw)
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.
--
David Hinz --- MCI Telecommunications Corporation
E-mail: dhinz@dna406.dna.mci.com Pager: 1-800-PAGE-MCI PIN: 172-3148
Phone: (303) 291-6108 VNET: 636-6108 Fax: (303) 291-6365
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Q:_POSIX_SOURCE compile option
1996-09-19 4:00 Q:_POSIX_SOURCE compile option David Hinz
@ 1996-09-23 4:00 ` Dave Butenhof
0 siblings, 0 replies; 2+ messages in thread
From: Dave Butenhof @ 1996-09-23 4:00 UTC (permalink / raw)
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 ]----------------/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1996-09-23 4:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-09-19 4:00 Q:_POSIX_SOURCE compile option David Hinz
1996-09-23 4:00 ` Dave Butenhof
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox