9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] "..." and "##' stuff with pcc?
@ 2015-05-25 18:44 Jens Staal
  2015-05-29 21:04 ` erik quanstrom
  2015-05-31 10:14 ` Charles Forsyth
  0 siblings, 2 replies; 5+ messages in thread
From: Jens Staal @ 2015-05-25 18:44 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 395 bytes --]

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?

[-- Attachment #2: Type: text/html, Size: 592 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] "..." and "##' stuff with pcc?
  2015-05-25 18:44 [9fans] "..." and "##' stuff with pcc? Jens Staal
@ 2015-05-29 21:04 ` erik quanstrom
  2015-05-31 10:14 ` Charles Forsyth
  1 sibling, 0 replies; 5+ messages in thread
From: erik quanstrom @ 2015-05-29 21:04 UTC (permalink / raw)
  To: 9fans

On Mon May 25 12:39:27 PDT 2015, staal1978@gmail.com wrote:

> 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?

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



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] "..." and "##' stuff with pcc?
  2015-05-25 18:44 [9fans] "..." and "##' stuff with pcc? Jens Staal
  2015-05-29 21:04 ` erik quanstrom
@ 2015-05-31 10:14 ` Charles Forsyth
  2015-05-31 16:31   ` Ori Bernstein
  1 sibling, 1 reply; 5+ messages in thread
From: Charles Forsyth @ 2015-05-31 10:14 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 601 bytes --]

On 25 May 2015 at 19:44, Jens Staal <staal1978@gmail.com> 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.

[-- Attachment #2: Type: text/html, Size: 1285 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] "..." and "##' stuff with pcc?
  2015-05-31 10:14 ` Charles Forsyth
@ 2015-05-31 16:31   ` Ori Bernstein
  2015-05-31 16:56     ` Charles Forsyth
  0 siblings, 1 reply; 5+ messages in thread
From: Ori Bernstein @ 2015-05-31 16:31 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Sun, 31 May 2015 11:14:42 +0100
Charles Forsyth <charles.forsyth@gmail.com> 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 <ori@eigenstate.org>



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] "..." and "##' stuff with pcc?
  2015-05-31 16:31   ` Ori Bernstein
@ 2015-05-31 16:56     ` Charles Forsyth
  0 siblings, 0 replies; 5+ messages in thread
From: Charles Forsyth @ 2015-05-31 16:56 UTC (permalink / raw)
  To: Ori Bernstein; +Cc: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 445 bytes --]

On 31 May 2015 at 17:31, Ori Bernstein <ori@eigenstate.org> 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.

[-- Attachment #2: Type: text/html, Size: 804 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-05-31 16:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-25 18:44 [9fans] "..." and "##' stuff with pcc? Jens Staal
2015-05-29 21:04 ` erik quanstrom
2015-05-31 10:14 ` Charles Forsyth
2015-05-31 16:31   ` Ori Bernstein
2015-05-31 16:56     ` Charles Forsyth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).