Re: [9fans] "..." and "##' stuff with pcc?

2015-05-31 Thread Charles Forsyth
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.


Re: [9fans] Ports tree for Plan 9

2015-05-31 Thread arnold
Kurt H Maier  wrote:

> I mangled some webshit earlier today on that server (bad timing I guess).
> Correct link to the hg repo is https://code.9front.org/hg/awk

This appears to be based on Brian Kernighan's awk from sometime in 1999
and not written from scratch.

There have been many fixes to BWK's code since then. If you're going to
start over, it should be done from his current code, available from
his Princeton home page.

Arnold



Re: [9fans] Ports tree for Plan 9

2015-05-31 Thread arnold
> Have the MKS sources ever been released?

I don't believe so. I think they were the basis for z/OS, which is
a POSIX environment on top of IBM's MVS.

The MKS awk made its way out into the world via Solaris, which for some
reason chose that code base, instead of a more recent version of BWK's
awk, for their POSIX awk.  Quite some time ago I ported it to Linux; it
took an hour or so. It'd take more work to make it generally portable, which
I never bothered to do.

Arnold



Re: [9fans] Ports tree for Plan 9

2015-05-31 Thread erik quanstrom
> There have been many fixes to BWK's code since then. If you're going to
> start over, it should be done from his current code, available from
> his Princeton home page.

9atom's awk has been updated with bwk's recent source.  it also has a fix for 
the problem
sometimes seen with plan 9 installs where a score looks enough like floating 
point that
awk tries to treat it as such and gets a fp exception in the process.

i would consider adding pure extensions, such as %C, or the ability to deal 
with hex.

- erik



Re: [9fans] "..." and "##' stuff with pcc?

2015-05-31 Thread Ori Bernstein
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 



Re: [9fans] "..." and "##' stuff with pcc?

2015-05-31 Thread Charles Forsyth
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.