From ac3acab1311c47cc73e2681e575f0407284c3c66 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Fri, 18 Jul 2014 09:13:54 -0400 Subject: [PATCH] xf86platformBus: Add assertion to avoid (fatal) compiler warning Compilation of -video-intel started failing in gnome-continuous, it's because xserver has -Werror=return-type on, and gcc can't prove this function always returns a value: /usr/include/xorg/xf86platformBus.h:119:1: error: control reaches end of non-void function [-Werror=return-type] Let's add assertions to the accessor functions to fix this. Reviewed-by: Keith Packard Signed-off-by: Keith Packard --- hw/xfree86/common/xf86platformBus.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/xfree86/common/xf86platformBus.h b/hw/xfree86/common/xf86platformBus.h index 2a901046d..317dd24d5 100644 --- a/hw/xfree86/common/xf86platformBus.h +++ b/hw/xfree86/common/xf86platformBus.h @@ -115,6 +115,9 @@ _xf86_get_platform_device_attrib(struct xf86_platform_device *device, int attrib return xf86_platform_device_odev_attributes(device)->busid; case ODEV_ATTRIB_DRIVER: return xf86_platform_device_odev_attributes(device)->driver; + default: + assert(FALSE); + return NULL; } } @@ -135,6 +138,9 @@ _xf86_get_platform_device_int_attrib(struct xf86_platform_device *device, int at return xf86_platform_device_odev_attributes(device)->major; case ODEV_ATTRIB_MINOR: return xf86_platform_device_odev_attributes(device)->minor; + default: + assert(FALSE); + return 0; } }