Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110518123254.GM277@brightrain.aerifal.cx>
Date: Wed, 18 May 2011 08:32:54 -0400
From: Rich Felker <dalias@...ifal.cx>
To: musl@...ts.openwall.com
Subject: Re: musl 0.7.10 released

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

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.