-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Simon Josefsson on 3/4/2008 7:39 AM: | | However, what do you think about this? | | /Simon | |>From 232f8a7255f8addd9724156d7d245b51a7feb72e Mon Sep 17 00:00:00 2001 | From: Simon Josefsson <[EMAIL PROTECTED]> | Date: Tue, 4 Mar 2008 15:37:59 +0100 | Subject: [PATCH] Add module __func__ to provide C99 __func__ variable. | | --- | doc/gnulib.texi | 14 ++++++++++++++ | m4/__func__.m4 | 20 ++++++++++++++++++++ | modules/__func__ | 20 ++++++++++++++++++++
Maybe it's just me, but I hate typing _ (it involves a shift key and some coordination). Can we name it modules/func rather than modules/__func__? | [EMAIL PROTECTED] __func__ | [EMAIL PROTECTED] __func__ | + | +The @code{__func__} module makes sure that you can use the | [EMAIL PROTECTED] variable as defined by C99 in your code. Should we use the C99 terminology, where __func__ is predefined identifier? Technically, since it is const and not an lvalue, the term variable is a bit misleading. | + | +A small example is: | + | [EMAIL PROTECTED] | +#include <config.h> #include <stdio.h> /* for printf */ | +... | +printf ("%s: something happened\n", __func__); | [EMAIL PROTECTED] smallexample Include a function declaration around the use of __func__ in your example, since using __func__ outside a function is undefined. | + ASSERT (strlen (__func__) + 1 == sizeof (__func__)); The () around __func__ are extraneous. - -- Don't work too hard, make some time for fun as well! Eric Blake [EMAIL PROTECTED] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHzhit84KuGfSFAYARAhxYAKCgNl3UCqlh/Ru6Ubcl+3vH3Bt4DQCbBjuz CDFnMkZdKWEvOtIA+4uceGA= =d+/X -----END PGP SIGNATURE-----