[Spice-devel] [spice-gtk v4 00/13] CD sharing feature

Christophe Fergeau cfergeau at redhat.com
Thu Sep 27 15:35:50 UTC 2018


On Fri, Sep 21, 2018 at 08:10:08PM +0200, Christophe Fergeau wrote:
> 
> All your SPICE_DEBUG calls include a __FUNCTION__, but it seems
> SPICE_DEBUG already does that for you?
> 
> #define SPICE_DEBUG(fmt, ...)                                   \
>     do {                                                        \
>         if (G_UNLIKELY(spice_util_get_debug()))                 \
>             g_debug(G_STRLOC " " fmt, ## __VA_ARGS__);          \
>     } while (0)
> 
> with
> 
> #define G_STRLOC __FILE__ ":" G_STRINGIFY (__LINE__) ":" __PRETTY_FUNCTION__ "()"

I c&p'ed this from devhelp, but this is actually wrong, G_STRLOC is:

/* Provide a string identifying the current code position */
#if defined(__GNUC__) && (__GNUC__ < 3) && !defined(__cplusplus)
#define G_STRLOC    __FILE__ ":" G_STRINGIFY (__LINE__) ":" __PRETTY_FUNCTION__ "()"
#else
#define G_STRLOC    __FILE__ ":" G_STRINGIFY (__LINE__)
#endif

so no __PRETTY_FUNCTION__ on current GCC because of https://bugzilla.gnome.org/show_bug.cgi?id=69097

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20180927/8ea2db35/attachment.sig>


More information about the Spice-devel mailing list