Re: posix_spawn man page strangeness
Re: posix_spawn man page strangeness
- Subject: Re: posix_spawn man page strangeness
- From: Terry Lambert <email@hidden>
- Date: Thu, 12 Mar 2009 02:56:20 -0700
On Mar 11, 2009, at 3:55 PM, Stephane Sudre wrote:
On Mar 11, 2009, at 3:53 PM, Andrew Gallatin wrote:
Stéphane Sudre wrote:
Is it a bug that the __restrict option is written behind the name
of every parameters of the posix_spawn and posix_spawnp prototypes
in the man page?
It might be better readable without the "restrict" word.
"restrict" is a C99 keyword that specifies that the referenced
pointers
to the function must not be aliased (point to the same memory
location).
This enables additional compiler optimizations. See
http://www.cellperformance.com/mike_acton/2006/05/demystifying_the_restrict_keyw.html
I think having that information in the man page is helpful.
The issue (I see) is not with the restrict meaning, it's with the
reading because restrict is not a very often used keyword (it's the
first time I see it). Additionally, the real prototype in spawn.h
uses '__restrict' not 'restrict'.
This is so that <sys/cdefs.h> can make the keyword go away if it's not
supported by the compiler. For example, if you pass -std=c89 to the
compiler because you have old code that will break with a newer
compiler, or you use someone else's compiler that has not been updated
to comply with the current standards.
See also <sys/cdefs.h>.
-- Terry _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden