From: Thomas Dickey <dickey@saltmine.radix.net>
Subject: Re: Different Lint Preprocessor
Date: 1 Aug 2002 10:00:02 GMT [thread overview]
Message-ID: <aib0r2$mr6$2@news1.Radix.Net> (raw)
In-Reply-To: m3ado7kba6.fsf@salmon.parasoft.com
Paul Pluzhnikov <ppluzhnikov@earthlink.net> wrote:
> Thomas Dickey <dickey@saltmine.radix.net> writes:
>> Joe Blow <mrsincerity@hotmail.com> 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 <dickey@radix.net> <dickey@herndon4.his.com>
http://dickey.his.com
ftp://dickey.his.com
next prev parent reply other threads:[~2002-08-01 10:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-07-30 19:01 Different Lint Preprocessor Joe Blow
2002-07-31 11:01 ` Thomas Dickey
2002-07-31 19:04 ` Paul Pluzhnikov
2002-08-01 10:00 ` Thomas Dickey [this message]
2002-08-05 14:21 ` Ed Vogel
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox