mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@aerifal.cx>
To: musl@lists.openwall.com
Subject: Re: musl 0.7.10 released
Date: Wed, 18 May 2011 08:32:54 -0400	[thread overview]
Message-ID: <20110518123254.GM277@brightrain.aerifal.cx> (raw)
In-Reply-To: <20110518114947.GO6142@port70.net>

On Wed, May 18, 2011 at 01:49:47PM +0200, Szabolcs Nagy wrote:
> nice
> 
> i see compiler workaround

Yes. Fortunately it's not so ugly and it might even make the code more
readable to people not familiat with the intricacies of the C
preprocessor.

> - pcc preprocessor bug with recursive macro expansion
> in WHATSNEW
> 
> have you reported the issue to the pcc developers?

No. I was planning to but haven't gotten around to it. If you or
someone else would be willing to handle it I'd appreciate it.

> or can you show me an example where pcc is incorrect?

See src/internal/syscall.h

I haven't tried reproducing it with a simpler test case, but the basic
issue is that the preprocessor does not suppress recursive macro
expansion. The __syscall_cp() macro expands to __syscall_cpN (where
N=0..6 depending on the number of arguments), which is another macro
which expands to __syscall_cp(...). Per the C standard (since original
ANSI C), since this instance of __syscall_cp was generated from
expanding the __syscall_cp macro earlier, it's not subject to being
expanded as a macro again, but pcc tries to expand it anyway and gets
in an infinite loop.

Rich


  reply	other threads:[~2011-05-18 12:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-18  1:49 Rich Felker
2011-05-18 11:49 ` Szabolcs Nagy
2011-05-18 12:32   ` Rich Felker [this message]
2011-05-18 15:28     ` Szabolcs Nagy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110518123254.GM277@brightrain.aerifal.cx \
    --to=dalias@aerifal.cx \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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).