Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Jan 1999 16:28:03 +1100
From:      Bruce Evans <bde@zeta.org.au>
To:        bde@zeta.org.au, jdp@polstra.com
Cc:        committers@FreeBSD.ORG
Subject:   Re: cvs commit: src/usr.bin/xlint/xlint xlint.c
Message-ID:  <199901240528.QAA11776@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>> Also, use the FreeBSD-standard __CONCAT() macro if you don't want
>> to break xlint's K&R support some more :-).
>
>Do you mean like this?
>
>    __XSTRING(__CONCAT(D__FreeBSD__=,__FreeBSD__))
                        -D...
>
>Hrm, I'm not so sure that's advisable.  It will work, but only because
>the "-D" happens to be jammed up against the "__FreeBSD__", turning it
>into a different identifier "D__FreeBSD__" as far as the preprocessor

I didn't think about it enough, but I wouldn't worry about that.

>Granted, two consecutive string literals get collapsed into one only
>by an ANSI preprocessor.  But __XSTRING also requires ANSI, so it's
>a moot point.

Concatenation could be handled by xlint's utility functions concat2()
and concat3().  Stringizing the value of __FreeBSD__ seems to require
dynamic evaluation in the K&R case
(e.g., sprintf(buf, "\"%d\"", __FreeBSD__).  This is more portable.

Bruce

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199901240528.QAA11776>