From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 Date: Mon, 25 May 2015 20:44:42 +0200 Message-ID: From: Jens Staal To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=001a11343f2831409c0516ec6706 Subject: [9fans] "..." and "##' stuff with pcc? Topicbox-Message-UUID: 5560f3c4-ead9-11e9-9d60-3106f5b1d025 --001a11343f2831409c0516ec6706 Content-Type: text/plain; charset=UTF-8 Hi all. I tried using the following shim header to satisfy in a package I want to build. https://raw.githubusercontent.com/libressl-portable/portable/master/include/err.h It looked pretty neat since it does everything in the header. It did however not work (I guess the "..." and "##" are to blame?) so now I wonder how/if it is possible with the posix compiler on plan9? --001a11343f2831409c0516ec6706 Content-Type: text/html; charset=UTF-8

Hi all.

I tried using the following shim header to satisfy <err.h> in a package I want to build.

https://raw.githubusercontent.com/libressl-portable/portable/master/include/err.h

It looked pretty neat since it does everything in the header.

It did however not work (I guess the "..." and "##" are to blame?) so now I wonder how/if it is possible with the posix compiler on plan9?

--001a11343f2831409c0516ec6706-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Fri, 29 May 2015 14:04:23 -0700 To: 9fans@9fans.net Message-ID: <455123fac7cc3745816a60274bcb2256@lilly.quanstro.net> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] "..." and "##' stuff with pcc? Topicbox-Message-UUID: 56422506-ead9-11e9-9d60-3106f5b1d025 On Mon May 25 12:39:27 PDT 2015, staal1978@gmail.com wrote: > Hi all. > > I tried using the following shim header to satisfy in a package I > want to build. > > https://raw.githubusercontent.com/libressl-portable/portable/master/include/err.h > > It looked pretty neat since it does everything in the header. > > It did however not work (I guess the "..." and "##" are to blame?) so now I > wonder how/if it is possible with the posix compiler on plan9? there are some errors in cpp. a gsoc student looked at fixing them, but sadly the straightforward fix ran into some other limitations of the code. - erik From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: Date: Sun, 31 May 2015 11:14:42 +0100 Message-ID: From: Charles Forsyth To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=089e0160aa484c94d705175dfa09 Subject: Re: [9fans] "..." and "##' stuff with pcc? Topicbox-Message-UUID: 5739f894-ead9-11e9-9d60-3106f5b1d025 --089e0160aa484c94d705175dfa09 Content-Type: text/plain; charset=UTF-8 On 25 May 2015 at 19:44, Jens Staal wrote: > It did however not work (I guess the "..." and "##" are to blame?) so now > I wonder how/if it is possible with the posix compiler on plan9? It doesn't understand the named ... variant, which I suppose is more recent tinkering. Use the older __VA_ARGS__. Also I didn't think your use of ## was correct in any case (you can only concatenate things that produce a valid token). It looked as though #define err(exitcode, format, ...) \ errx(exitcode, format ": %s", __VA_ARGS__, strerror(errno)) etc might work. --089e0160aa484c94d705175dfa09 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

= On 25 May 2015 at 19:44, Jens Staal <staal1978@gmail.com> = wrote:
It did however not work (I guess the "...&q= uot; and "##" are to blame?) so now I wonder how/if it is possibl= e with the posix compiler on plan9?

It doesn't un= derstand the named ... variant, which I suppose is more recent tinkering. U= se the older __VA_ARGS__.
Also I didn't= think your use of ## was correct in any case (you can only concatenate thi= ngs that produce a valid token).

=
It looked as though

#define= err(exitcode, format, ...) \
=C2=A0 errx(e= xitcode, format ": %s", __VA_ARGS__, strerror(errno))

etc might work.


--089e0160aa484c94d705175dfa09-- From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Sun, 31 May 2015 09:31:14 -0700 From: Ori Bernstein To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Message-Id: <20150531093114.498db4460eb15fe52dd05651@eigenstate.org> In-Reply-To: References: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [9fans] "..." and "##' stuff with pcc? Topicbox-Message-UUID: 57b710f4-ead9-11e9-9d60-3106f5b1d025 On Sun, 31 May 2015 11:14:42 +0100 Charles Forsyth wrote: > It doesn't understand the named ... variant, which I suppose is more recent > tinkering. Use the older __VA_ARGS__. IIRC, the named variant is older, but it's also a GNU extension. -- Ori Bernstein From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <20150531093114.498db4460eb15fe52dd05651@eigenstate.org> References: <20150531093114.498db4460eb15fe52dd05651@eigenstate.org> Date: Sun, 31 May 2015 17:56:35 +0100 Message-ID: From: Charles Forsyth To: Ori Bernstein Content-Type: multipart/alternative; boundary=001a11c23d3e8aaf64051763974a Cc: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Subject: Re: [9fans] "..." and "##' stuff with pcc? Topicbox-Message-UUID: 57be116a-ead9-11e9-9d60-3106f5b1d025 --001a11c23d3e8aaf64051763974a Content-Type: text/plain; charset=UTF-8 On 31 May 2015 at 17:31, Ori Bernstein wrote: > > It doesn't understand the named ... variant, which I suppose is more > recent > > tinkering. Use the older __VA_ARGS__. > > IIRC, the named variant is older, but it's also a GNU extension. I've looked at the C99 and C1x standards and both describe pre-processor ... and __VA_ARGS__ as Plan 9's cpp implements it, and neither allows the identifier ... syntax. --001a11c23d3e8aaf64051763974a Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

= On 31 May 2015 at 17:31, Ori Bernstein <ori@eigenstate.org>= wrote:
> It doesn= 9;t understand the named ... variant, which I suppose is more recent
> tinkering. Use the older __VA_ARGS__.

IIRC, the named variant is older, but it's also a GNU extension.=

I've looked at the C99 and C1x standards and bot= h describe pre-processor ... and __VA_ARGS__ as Plan 9's cpp implements= it,
and neither allows the identifier ... = syntax.
--001a11c23d3e8aaf64051763974a--