[PATCH 3/5] drm: Fix gcc warning about missing braces.

Bryce Harrington bryce at osg.samsung.com
Thu Mar 10 00:49:30 UTC 2016


Use double-brackets for config initializer for
create_output_for_connector to avoid gcc warning, since first
element is another struct.  (See GCC bug 53119.)

Quells warning:
  src/compositor-drm.c: In function ‘create_output_for_connector’:
  src/compositor-drm.c:2292:9: warning: missing braces around initializer
  [-Wmissing-braces]
    struct weston_drm_backend_output_config config = { 0 };
           ^
  src/compositor-drm.c:2292:9: warning: (near initialization for
  ‘config.base’) [-Wmissing-braces]

Signed-off-by: Bryce Harrington <bryce at osg.samsung.com>
---
 src/compositor-drm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/compositor-drm.c b/src/compositor-drm.c
index 111c882..5ddedb9 100644
--- a/src/compositor-drm.c
+++ b/src/compositor-drm.c
@@ -2289,7 +2289,7 @@ create_output_for_connector(struct drm_backend *b,
 	drmModeModeInfo crtc_mode;
 	int i;
 	enum weston_drm_backend_output_mode mode;
-	struct weston_drm_backend_output_config config = { 0 };
+	struct weston_drm_backend_output_config config = {{ 0 }};
 
 	i = find_crtc_for_connector(b, resources, connector);
 	if (i < 0) {
-- 
1.9.1



More information about the wayland-devel mailing list