From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,9de647ceb9cdd1df X-Google-Attributes: gidfa528,public X-Google-ArrivalTime: 2002-08-01 03:00:03 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!news.maxwell.syr.edu!newspeer.radix.net!news1.radix.net!not-for-mail From: Thomas Dickey Newsgroups: comp.unix.tru64 Subject: Re: Different Lint Preprocessor Date: 1 Aug 2002 10:00:02 GMT Organization: RadixNet Internet Services Message-ID: References: <45467788.0207301101.4fa9b000@posting.google.com> NNTP-Posting-Host: saltmine.radix.net User-Agent: tin/1.4.4-20000803 ("Vet for the Insane") (UNIX) (SunOS/5.8 (sun4u)) Xref: archiver1.google.com comp.unix.tru64:8277 Paul Pluzhnikov wrote: > Thomas Dickey writes: >> Joe Blow wrote: >> > #define func(type, fmt, args...) \ >> > func( type, __FUNCTION__, __LINE__, fmt, ## args) > Especially given that you can achieve the same thing with > minimal increase in typing and still be standard-compliant: > #if defined(__GNUC__) > #define __HERE__ __FUNCTION__, __FILE__, __LINE__ > #else > #define __HERE__ __FILE__, __LINE__ > #endif > ... > func(type, __HERE__, "%d %d", 1, 2); I didn't focus on the __FUNCTION__ keyword (as you note, not needed), but on the ellipsis "..." which is used to implement a variable-argument list in the C preprocessor. (At one point someone was urging me to bundle the GNU preprocessor with lynx so he could submit code that relied on this feature ;-) -- Thomas E. Dickey http://dickey.his.com ftp://dickey.his.com