Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Oct 1996 03:39:59 -0400 (EDT)
From:      Tim Vanderhoek <>
Subject:   PreProcessor concatenation question/bug
Message-ID:  <>

Next in thread | Raw E-Mail | Index | Archive | Help

#define a(x,y) x ## y
#define m partone
#define n parttwo

will result in

# 1 "x.c"


when run through `cc -E <file>'.  What I want it to produce is, of course,
not `mn', but `partoneparttwo'.

How can I make it do this?  (this is cpp on 2.2-961006-SNAP)

As it is right now, what seems to happen is that `m' and `n' don't get
expanded in the 2nd pass because they are no longer separated by a space.

However, I have read the section of the GNU info manual on macro
expansion and concatanation and it sounds very somewhat like this is a bug
in cpp.

Thanks rendered in advance.

Outnumbered?  Maybe.  Outspoken?  Never!

Want to link to this message? Use this URL: <>