Extension to the FFI to allow macro expansions to be avoided

Fergus Henderson fjh at cs.mu.oz.au
Wed Apr 14 14:38:49 EDT 2004

On 13-Apr-2004, Ross Paterson <ross at soi.city.ac.uk> wrote:
> On Tue, Apr 13, 2004 at 11:55:47AM +0100, Simon Marlow wrote:
> > > I'd favour turning off the
> > > macro interface, preferably with #undef, at least by default.
> > 
> > Agreed.  Why is #undef to be preferred over adding parentheses around
> > the function name as Ian originally suggested?
> It would also switch off
> #define func another_func
> and
> #define errno thread_local_errno()

Why is that preferred?  Undefining errno means that it won't work!

As the C standard says:

 |        It is unspecified whether errno
 |        is a macro or an identifier declared with external  linkage.
 |        If  a  macro  definition is suppressed in order to access an
 |        actual object ...  the behavior is undefined.

Fergus Henderson                    |  "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