Re: [dev] pledge(2) patches

From: <ilabdsf_AT_yandex.ru>
Date: Thu, 19 May 2016 01:31:06 +0300

On Wed, May 18, 2016 at 02:46:16PM -0700, Evan Gates wrote:
> > #ifndef __OpenBSD__
> > int pledge(const char *promises, const char *paths[]) { return 0; }
> > #endif
>
> Why the full function instead of
>
> #define pledge(x,y) 0
>
> (perhaps to enforce correct types?)

When using such trick you can't take function pointer. If x and y have
side effects, they are not evaluated.

In general preprocessor should not be used if it is easy to do the same
thing without it.
Received on Thu May 19 2016 - 00:31:06 CEST

This archive was generated by hypermail 2.3.0 : Thu May 19 2016 - 00:36:11 CEST