[parisc-linux] Gnu cpp bug or feature?

John Marvin jsm@udlkern.fc.hp.com
Tue, 9 Jan 2001 23:31:49 -0700 (MST)


I just discovered that the gnu cpp doesn't allow * and = to be concatenated.
What I am trying to do is the following:

#ifdef __LP64__
#define ADDIB addib,*
#else
#define ADDIB addib,
#endif

I then would use the above defines throughout some assembly functions, e.g.:

    ADDIB>      -1,%r1,1b
    ADDIB=      -1,%arg3,fdoneloop

If __LP64__ is defined, the above two examples wind up expanding to:

    addib,*>    -1,%r1,1b
    addib,* =   -1,%arg3,fdoneloop

The first example expands as I would expect, but the second example winds
up being a syntax error, because it should have been expanded to:

    addib,*=    -1,%arg3,fdoneloop

Anyway, I prefer to write the code this way rather than sprinkling
#ifdef __LP64__'s throughout the code, or using two different copies
of the functions. I imagine that gnu cpp must be trying to avoid
creating the C *= operator by mistake, but I don't believe there is
any standard that requires this. I know that the above examples work
on HP-UX (not that HP-UX sets the standard).

It just seems strange to me for gnu cpp to special case this particular
sequence.  Is there a good reason for this behaviour, or is this a bug?

John Marvin
jsm@fc.hp.com