Bug 94310

Summary: [PATCH] Fix -Werror build for clang
Product: Telepathy Reporter: Ting-Wei Lan <lantw44>
Component: mission-controlAssignee: Telepathy bugs list <telepathy-bugs>
Status: RESOLVED FIXED QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: normal    
Priority: medium CC: lantw44
Version: unspecified   
Hardware: Other   
OS: FreeBSD   
Whiteboard:
i915 platform: i915 features:
Attachments: Don't initialize function pointers with G_TYPE_INVALID

Description Ting-Wei Lan 2016-02-26 14:33:57 UTC
Please see the attached patch. It fixes the following error:
mcd-account.c:101:7: error: expression which evaluates to zero treated as a null pointer constant of type 'GType (*)(void)' [-Werror,-Wnon-literal-null-conversion]
    { G_TYPE_INVALID, }
      ^~~~~~~~~~~~~~
/home/lantw44/gnome/devinstall/include/glib-2.0/gobject/gtype.h:55:26: note: expanded from macro 'G_TYPE_INVALID'
#define G_TYPE_INVALID                  G_TYPE_MAKE_FUNDAMENTAL (0)
                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/lantw44/gnome/devinstall/include/glib-2.0/gobject/gtype.h:219:36: note: expanded from macro 'G_TYPE_MAKE_FUNDAMENTAL'
#define G_TYPE_MAKE_FUNDAMENTAL(x)      ((GType) ((x) << G_TYPE_FUNDAMENTAL_SHIFT))
                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Comment 1 Ting-Wei Lan 2016-02-26 14:40:01 UTC
The attached patch is made for branch telepathy-mission-control-5.16. I cannot find that version on bugzilla.
Comment 2 Ting-Wei Lan 2016-02-26 14:41:07 UTC
Created attachment 121986 [details] [review]
Don't initialize function pointers with G_TYPE_INVALID
Comment 3 George Kiagiadakis 2016-07-03 17:17:18 UTC
commit 20dc94875afecacf086e57f67447e9384fb85d90
Author: Ting-Wei Lan <lantw@src.gnome.org>
Date:   Fri Feb 26 22:32:28 2016 +0800

    Don't initialize function pointers with G_TYPE_INVALID
    
    https://bugs.freedesktop.org/show_bug.cgi?id=94310
    Reviewed-by: George Kiagiadakis

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.