This addresses the following clang-3.4 warning:
XGetFCtl.c:129:32: warning: comparison of constant 268435455 with expression of 
type 'CARD16' (aka 'unsigned short') is always false
      [-Wtautological-constant-out-of-range-compare]
                if (strf->num_syms_supported >= (INT_MAX / sizeof(KeySym)))
                    ~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
---
 src/XGetFCtl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/XGetFCtl.c b/src/XGetFCtl.c
index bb50bf3..100ae9e 100644
--- a/src/XGetFCtl.c
+++ b/src/XGetFCtl.c
@@ -126,7 +126,7 @@ XGetFeedbackControl(
            {
                xStringFeedbackState *strf = (xStringFeedbackState *) f;
 
-               if (strf->num_syms_supported >= (INT_MAX / sizeof(KeySym)))
+               if (strf->num_syms_supported >= (SHRT_MAX / sizeof(KeySym)))
                    goto out;
                size += sizeof(XStringFeedbackState) +
                    (strf->num_syms_supported * sizeof(KeySym));
-- 
1.8.3.1

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to