PATCH more __FUNCTION__



hello,

i have talked (via email) with some core gtk developers on gnome
mailinglist some hours ago. related to this __FUNCTION__ stuff again.
it went out, that concatenating __FUNCTION__ is more or less depracted.
recommended is using printf("%s", __FUNCTION__); instead. or even better
use whats provided with glib.

now the problem is a workaround for this problem will be given in glib
1.3.13 only earlier versions like glib 1 itself won't be supported
anymore.

meanwhile we have 3 solutions now:

a) use this new applied patch from me (a 2 liner only) this solves the
   __FUNCTION__ issue completely by using a string output instead of
   concatenating.

b) use my previous patch (i still recommend this one) because you can
   also check, wether the compiler understands __func__, __FUNCTION__
   ... or not.

c) migrate balsa to gnome 2 ASAP and use whats offered with glib since
   it will take care about the correct __FUNCTION__ stuff.

now that balsa is not migrated to gnome2 yet and still doesnt use the
stuff offered by glib, i would vote for point a) the fast way for a
short time until balsa port to gnome2 is done. or b) a tad more secure
way in checking wether the compiler supports or not.

-- 
Name....: Ali Akcaagac
Status..: Student Of Computer & Economic Science
E-Mail..: mailto:ali.akcaagac@stud.fh-wilhelmshaven.de
WWW.....: http://www.fh-wilhelmshaven.de/~akcaagaa
--- balsa/src/sendmsg-window.c.orig	Tue Jan 29 06:45:21 2002
+++ balsa/src/sendmsg-window.c	Tue Jan 29 07:19:55 2002
@@ -1120,12 +1120,12 @@
 	char *last_slash = strrchr(attach->filename, '/');
 
 	if (balsa_app.debug)
-	    fprintf (stderr, __FILE__ ":" __FUNCTION__ ": unlink `%s'\n",
+	    fprintf (stderr, "%s:%s: unlink `%s'\n", __FILE__, __FUNCTION__,
 		     attach->filename);
 	unlink(attach->filename);
 	*last_slash = 0;
 	if (balsa_app.debug)
-	    fprintf (stderr, __FILE__ ":" __FUNCTION__ ": rmdir `%s'\n",
+	    fprintf (stderr, "%s:%s: rmdir `%s'\n", __FILE__, __FUNCTION__,
 		     attach->filename);
 	rmdir(attach->filename);
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]