[PATCH 4/5] render: Silence warnings when building with clang

Jeremy Huddleston jeremyhu at apple.com
Sat Apr 23 21:52:38 PDT 2011


picture.c:351:37: error: implicit conversion from 'unsigned int' to 'CARD16' (aka 'unsigned short') changes value from 4294967295 to 65535
      [-Werror,-Wconstant-conversion]
            pFormats[f].direct.alphaMask = Mask(PICT_FORMAT_A(format));
                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~
...
fatal error: too many errors emitted, stopping now [-ferror-limit=]

Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
---
 render/picture.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/render/picture.c b/render/picture.c
index e7e1f2b..59f2c68 100644
--- a/render/picture.c
+++ b/render/picture.c
@@ -42,6 +42,11 @@
 #include "picturestr.h"
 #include "xace.h"
 
+#ifdef __clang__
+/* Many implicit conversions from int to CARD16 which look intentional */
+#pragma clang diagnostic ignored "-Wconstant-conversion"
+#endif
+
 DevPrivateKeyRec PictureScreenPrivateKeyRec;
 DevPrivateKeyRec PictureWindowPrivateKeyRec;
 static int	PictureGeneration;
-- 
1.7.4.1




More information about the xorg-devel mailing list