diff options
author | Colin Walters <walters@verbum.org> | 2014-07-18 09:13:54 -0400 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2014-07-18 08:31:20 -0700 |
commit | ac3acab1311c47cc73e2681e575f0407284c3c66 (patch) | |
tree | 0c9b34f77fde897604f34019b5b85d7ca515dddd | |
parent | 5c2e9fa3d6c4bdf626fededce866056ba8eca502 (diff) |
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 <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r-- | hw/xfree86/common/xf86platformBus.h | 6 |
1 files changed, 6 insertions, 0 deletions
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; } } |