ANSI compliance bug in Apple C compiler on OS X

Zack Weinberg zackw@stanford.edu
Mon Jan 29 16:28:00 GMT 2001


On Mon, Jan 29, 2001 at 07:11:16PM -0500, Andrew Pinski wrote:

> One thing this is not a bug in Apple's compiler I just tried it on
> the newest gcc (cvs checkout about 3pm) on linux ia86. So no need to
> send in a bug.

Hm, I just tried it on the newest gcc on linux/x86 (cvs checkout of
about a minute ago).  This pruned version of your test case:

#define Mjoin(pre, nam) my_join(pre, nam)
#define my_join(pre, nam) pre ## nam
#define Mstr2(m) # m
#define Mstr(m) Mstr2(m)

Mstr(Mjoin(Mjoin(atlas_,d),NCmm.h))

produces

"atlas_dNCmm.h"

when preprocessed.  If I put the #include back, it correctly tries to
find the header file.

GCC's preprocessor was completely rewritten over the course of 2000,
and anyone whose code base was taken from snapshots in that time is
likely to have gotten a buggy version.  There were definitely issues
with insertion of spaces where none were necessary.  I don't know the
heritage of the OSX compiler.  You should definitely take this up with
them.

zw


More information about the Gcc-bugs mailing list