From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 115614,81e8c2d562371d03 X-Google-Attributes: gid115614,public X-Google-Thread: fee84,81e8c2d562371d03 X-Google-Attributes: gidfee84,public From: Dave Butenhof Subject: Re: Q:_POSIX_SOURCE compile option Date: 1996/09/23 Message-ID: <32468CF8.15FB@zko.dec.com>#1/1 X-Deja-AN: 184799079 references: <32419437.794B@dna406.dna.mci.com> content-type: text/plain; charset=us-ascii organization: Digital Equipment Corporation mime-version: 1.0 newsgroups: comp.unix.osf.osf1,comp.unix.aix x-mailer: Mozilla 3.0Gold (X11; I; OSF1 V4.0 alpha) 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 ]----------------/