[Xcb] Proposed patch to support clang compilation of util-image

Pablo Cholaky waltercool at slash.cl
Sat Oct 8 19:58:28 UTC 2016


Guys,

I think this patch is currently harmless and makes support to clang to
properly compile it.

Author: Pablo Cholaky <waltercool at slash.cl>
Date:   Sat Oct 8 16:52:37 2016 -0300

   Added return to xcb_host_byte_order function

   Signed-off-by: Pablo Cholaky <waltercool at slash.cl>

diff --git a/image/xcb_bitops.h b/image/xcb_bitops.h
index a6872a1..bf6fdc1 100644
--- a/image/xcb_bitops.h
+++ b/image/xcb_bitops.h
@@ -207,6 +207,7 @@ xcb_host_byte_order(void) {
      return XCB_IMAGE_ORDER_LSB_FIRST;
  }
  assert(0);
+  return -1;
}

#endif /* __XCB_BITOPS_H__ */

Using clang it fails just after configure

Making all in image
make[2]: Entering directory
'/var/tmp/portage/x11-libs/xcb-util-image-0.4.0/work/xcb-util-image-0.4.0-abi_x86_64.amd64/image'
/bin/sh ../libtool  --tag=CC   --mode=compile clang -DHAVE_CONFIG_H -I.
-I/var/tmp/portage/x11-libs/xcb-util-image-0.4.0/work/xcb-util-image-0.4.0/image
-I..       -Wall -Wpointer-arith -Wmissing-declarations -Wformat=2
-Wstrict-prototypes -Wmissing-prototypes -Wnested-externs
-Wbad-function-cast -Wold-style-definition -Wdeclaration-after-statement
-Wunused -Wuninitialized -Wshadow -Wmissing-noreturn
-Wmissing-format-attribute -Wredundant-decls -Werror=implicit
-Werror=nonnull -Werror=init-self -Werror=main -Werror=missing-braces
-Werror=sequence-point -Werror=return-type -Werror=trigraphs
-Werror=array-bounds -Werror=write-strings -Werror=address
-Werror=int-to-pointer-cast -Werror=pointer-to-int-cast
-fno-strict-aliasing -O2 -pipe -g -c -o xcb_image.lo
/var/tmp/portage/x11-libs/xcb-util-image-0.4.0/work/xcb-util-image-0.4.0/image/xcb_image.c
libtool: compile:  clang -DHAVE_CONFIG_H -I.
-I/var/tmp/portage/x11-libs/xcb-util-image-0.4.0/work/xcb-util-image-0.4.0/image
-I.. -Wall -Wpointer-arith -Wmissing-declarations -Wformat=2
-Wstrict-prototypes -Wmissing-prototypes -Wnested-externs
-Wbad-function-cast -Wold-style-definition -Wdeclaration-after-statement
-Wunused -Wuninitialized -Wshadow -Wmissing-noreturn
-Wmissing-format-attribute -Wredundant-decls -Werror=implicit
-Werror=nonnull -Werror=init-self -Werror=main -Werror=missing-braces
-Werror=sequence-point -Werror=return-type -Werror=trigraphs
-Werror=array-bounds -Werror=write-strings -Werror=address
-Werror=int-to-pointer-cast -Werror=pointer-to-int-cast
-fno-strict-aliasing -O2 -pipe -g -c
/var/tmp/portage/x11-libs/xcb-util-image-0.4.0/work/xcb-util-image-0.4.0/image/xcb_image.c
 -fPIC -DPIC -o .libs/xcb_image.o
In file included from
/var/tmp/portage/x11-libs/xcb-util-image-0.4.0/work/xcb-util-image-0.4.0/image/xcb_image.c:37:
/var/tmp/portage/x11-libs/xcb-util-image-0.4.0/work/xcb-util-image-0.4.0/image/xcb_bitops.h:210:1:
error: control may reach end of non-void function [-Werror,-Wreturn-type]
}
^
1 error generated.

Based on the patch initially proposed here:
https://patchwork.openembedded.org/patch/118073/ and discussed here
https://github.com/gentoo/gentoo/pull/2496 and here
https://github.com/gentoo/musl/pull/12

Regards.


-- 
Pablo Cholaky
Computer Science and TI Engineer
Gentoo Linux user and developer
Slash.cl Owner
Blablabla
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/xcb/attachments/20161008/66afbc69/attachment.html>


More information about the Xcb mailing list