components/krb5/patches/074-stricter-compile-flags.patch
author Will Fiveash <will.fiveash@oracle.com>
Tue, 27 Sep 2016 15:08:33 -0500
changeset 6987 e80772ec96e1
permissions -rw-r--r--
24697585 Userland krb5 should have a stricter set of compiler flags
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6987
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
     1
#
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
     2
# This patch provides support for compiling Userland krb5 with compiler flags
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
     3
# that will treat more code issues as errors rather than just warning.  The
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
     4
# code change to src/include/k5-utf8.h comes from upstream (MIT) and this code
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
     5
# change should be in MIT's next release 1.15 so this patch should be deleted
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
     6
# when Userland krb5 rebases to that release.
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
     7
# Patch source: upstream
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
     8
#
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
     9
--- a/src/include/k5-utf8.h
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    10
+++ b/src/include/k5-utf8.h
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    11
@@ -68,37 +68,10 @@
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    12
 #ifndef K5_UTF8_H
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    13
 #define K5_UTF8_H
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    14
 
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    15
-#include "autoconf.h"
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    16
+#include "k5-platform.h"
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    17
 
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    18
-#ifdef HAVE_SYS_TYPES_H
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    19
-#include <sys/types.h>
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    20
-#endif
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    21
-
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    22
-#ifdef HAVE_UNISTD_H
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    23
-#include <unistd.h>
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    24
-#endif
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    25
-
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    26
-#ifdef HAVE_STDLIB_H
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    27
-#include <stdlib.h>
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    28
-#endif
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    29
-
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    30
-#if INT_MAX == 0x7fff
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    31
-typedef unsigned int    krb5_ucs2;
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    32
-#elif SHRT_MAX == 0x7fff
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    33
-typedef unsigned short  krb5_ucs2;
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    34
-#else
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    35
-#error undefined 16 bit type
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    36
-#endif
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    37
-
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    38
-#if INT_MAX == 0x7fffffffL
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    39
-typedef int     krb5_ucs4;
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    40
-#elif LONG_MAX == 0x7fffffffL
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    41
-typedef long    krb5_ucs4;
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    42
-#elif SHRT_MAX == 0x7fffffffL
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    43
-typedef short   krb5_ucs4;
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    44
-#else
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    45
-#error: undefined 32 bit type
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    46
-#endif
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    47
+typedef uint16_t krb5_ucs2;
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    48
+typedef uint32_t krb5_ucs4;
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    49
 
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    50
 #define KRB5_MAX_UTF8_LEN   (sizeof(krb5_ucs2) * 3/2)
e80772ec96e1 24697585 Userland krb5 should have a stricter set of compiler flags
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    51