From 2dc1ef4078acd7ca463a8eee2ef20de54e672f37 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Wed, 4 Feb 2009 23:28:09 +0000 Subject: [PATCH] don't do arithmetic on void pointers Fix one file in gssapi where we compute offsets from a void* without casting. Change options used with Sun compiler to make such expressions an error. ticket: 6362 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21886 dc483132-0cff-0310-8789-dd5450dbe970 --- src/aclocal.m4 | 2 +- src/lib/gssapi/generic/oid_ops.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/aclocal.m4 b/src/aclocal.m4 index b1141e86c..c494750ad 100644 --- a/src/aclocal.m4 +++ b/src/aclocal.m4 @@ -664,7 +664,7 @@ else # works, but it also means that declaration-in-code warnings won't # be issued. # -v -fd -errwarn=E_DECLARATION_IN_CODE ... - WARN_CFLAGS="-errtags=yes -errwarn=E_BAD_PTR_INT_COMBINATION" + WARN_CFLAGS="-errtags=yes -errwarn=E_BAD_PTR_INT_COMBINATION -errwarn=E_PTR_TO_VOID_IN_ARITHMETIC" WARN_CXXFLAGS="-errtags=yes +w +w2 -xport64" fi fi diff --git a/src/lib/gssapi/generic/oid_ops.c b/src/lib/gssapi/generic/oid_ops.c index bd78e262b..8390e7ba0 100644 --- a/src/lib/gssapi/generic/oid_ops.c +++ b/src/lib/gssapi/generic/oid_ops.c @@ -440,7 +440,7 @@ generic_gss_oid_compose( return GSS_S_FAILURE; } - op = oid->elements + prefix_len + nbytes; + op = (unsigned char *) oid->elements + prefix_len + nbytes; i = -1; while (suffix) { op[i] = (unsigned char)suffix & 0x7f; @@ -472,7 +472,7 @@ generic_gss_oid_decompose( return GSS_S_BAD_MECH; } - op = oid->elements + prefix_len; + op = (unsigned char *) oid->elements + prefix_len; *suffix = 0; -- 2.26.2