Compiz can't build with clang

Bug #1060804 reported by Daniel van Vugt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Compiz
Fix Released
Medium
Daniel van Vugt
Compiz Core
Triaged
Medium
Unassigned
compiz (Ubuntu)
Fix Released
Medium
Daniel van Vugt

Bug Description

Install clang and then:
   env CC=clang CXX=clang++ cmake ..
and then it can't build because of (at least):

In file included from /home/dan/bzr/compiz/clang/gtk/window-decorator/gwd-settings-storage-gsettings.c:28:
/home/dan/bzr/compiz/clang/gtk/window-decorator/gwd-settings-storage-gsettings.h:25:37: error:
      redefinition of typedef 'GWDSettingsWritable' is invalid in C
      [-Wtypedef-redefinition]
typedef struct _GWDSettingsWritable GWDSettingsWritable;
                                    ^
/home/dan/bzr/compiz/clang/gtk/window-decorator/gwd-settings-writable-interface.h:35:37: note:
      previous definition is here
typedef struct _GWDSettingsWritable GWDSettingsWritable;
                                    ^
In file included from /home/dan/bzr/compiz/clang/gtk/window-decorator/gwd-settings-storage-gsettings.c:28:
/home/dan/bzr/compiz/clang/gtk/window-decorator/gwd-settings-storage-gsettings.h:26:37: error:
      redefinition of typedef 'GWDSettingsStorage' is invalid in C
      [-Wtypedef-redefinition]
typedef struct _GWDSettingsStorage GWDSettingsStorage;
                                    ^
/home/dan/bzr/compiz/clang/gtk/window-decorator/gwd-settings-storage-interface.h:35:36: note:
      previous definition is here
typedef struct _GWDSettingsStorage GWDSettingsStorage;
                                   ^
In file included from /home/dan/bzr/compiz/clang/gtk/window-decorator/gwd-settings-storage-gsettings.c:28:
/home/dan/bzr/compiz/clang/gtk/window-decorator/gwd-settings-storage-gsettings.h:27:31: error:
      redefinition of typedef 'GSettings' is invalid in C
      [-Wtypedef-redefinition]
typedef struct _GSettings GSettings;
                                    ^
/usr/include/glib-2.0/gio/giotypes.h:60:47: note: previous definition is here
typedef struct _GSettings GSettings;
                                              ^

Clang also rejects lp:compiz-core/0.9.7 for different reasons.

Related branches

Changed in compiz-core:
status: New → Triaged
importance: Undecided → Medium
milestone: none → 0.9.7.12
Changed in compiz:
assignee: nobody → Daniel van Vugt (vanvugt)
description: updated
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Raised importance to High, because clang is proving itself to be an invaluable tool for code analysis. I'd like to use it as part of the code review process in future.

Changed in compiz:
status: Triaged → In Progress
Changed in compiz-core:
milestone: 0.9.7.12 → none
Changed in compiz:
importance: Medium → High
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Fix committed into lp:compiz at revision 3412

Changed in compiz:
status: In Progress → Fix Committed
importance: High → Medium
Changed in compiz (Ubuntu):
assignee: nobody → Daniel van Vugt (vanvugt)
importance: Undecided → Medium
status: New → Fix Committed
Changed in compiz:
status: Fix Committed → Fix Released
Stephen M. Webb (bregma)
no longer affects: compiz/0.9.8
Changed in compiz (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.