Again: FFI syntax

Fergus Henderson fjh at cs.mu.oz.au
Tue May 29 06:51:41 EDT 2001


On 29-May-2001, Sven Panne <Sven_Panne at BetaResearch.de> wrote:
> I'm against *always* wrapping the header file name
> in double quotes, unless
> 
>    #include "foo/bar.h"
> 
> implies
> 
>    #include <foo/bar.h>
> 
> if the first form is not found.

It does.

> I'm not sure about this, although it's guaranteed
> the other way round IIRC.

You recall incorrectly.

For <...>, the search is entirely implementation-defined [ISO C99 6.10.2#2].
For "...", the initial search is implementation-defined, but it if fails,
then the search is retried as if for <...> [ISO C99 6.10.2#3]:

Cheers,
	Fergus.

 ISO C99 6.10.2#2:
 |        [#2] A preprocessing directive of the form
 | 
 |          # include <h-char-sequence> new-line
 | 
 |        searches  a  sequence of implementation-defined places for a
 |        header identified uniquely by the specified sequence between
 |        the  <  and > delimiters, and causes the replacement of that
 |        directive by the entire contents of  the  header.   How  the
 |        places   are   specified   or   the   header  identified  is
 |        implementation-defined.

 ISO C99 6.10.2#3:
 |        [#3] A preprocessing directive of the form
 | 
 |          # include "q-char-sequence" new-line
 | 
 |        causes the replacement  of  that  directive  by  the  entire
 |        contents  of  the  source  file  identified by the specified
 |        sequence between the " delimiters.  The named source file is
 |        searched  for  in an implementation-defined manner.  If this
 |        search is  not  supported,  or  if  the  search  fails,  the
 |        directive is reprocessed as if it read
 | 
 |          # include <h-char-sequence> new-line
 | 
 |        with   the   identical   contained   sequence  (including  >
 |        characters, if any) from the original directive.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.




More information about the FFI mailing list