[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Thu, 28 Feb 2008 13:36:33 -0800
Thunderbird 22.214.171.124 (X11/20071031)
-----BEGIN PGP SIGNED MESSAGE-----
Bruno Haible wrote:
> Simon Josefsson wrote:
>> # define __func__ "<unknown>"
> Some packages use
> #define __func__ __FILE__
> in this case. Not perfect, but still more informative than "<unknown>".
But, wouldn't one normally include __FILE__ in diagnostic output, anyway?
#define whine(msg) ((void)fprintf(stderr, "%s(%s:%u): %s", __FILE__,
__func__, __LINE__, (msg)))
(sorry about line-breakage above.)
If they don't do things like that, then yeah, __FILE__ is better than
nothing. If they _do_, though, then it seems like
"file.c(<unknown>:1971): blah" is less confusing than
Probably better to let the developers use that sort of logic, when they
know how they're using it, than to provide that as the general fallback?
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----