[Date Prev][Date Next] [Chronological] [Thread] [Top]

(ITS#3469) back-ldap C99 compliance patch



Full_Name: Aaron Richton
Version: HEAD
OS: Solaris 9
URL: ftp://ftp.openldap.org/incoming/richton-c99-20050107.patch
Submission from: (NULL) (165.230.41.99)


Compiling HEAD (or many RE* -ULDAP_REL_ENG) results in errors from Sun Studio 9
compiler:

"bind.c", line 565: operands have incompatible types:
         const struct berval {unsigned long bv_len, pointer to char 
bv_val} ":" struct berval {unsigned long bv_len, pointer to char bv_val}
"bind.c", line 780: operands have incompatible types:
         const struct berval {unsigned long bv_len, pointer to char
bv_val} ":" struct berval {unsigned long bv_len, pointer to char bv_val}
"bind.c", line 826: operands have incompatible types:
         const struct berval {unsigned long bv_len, pointer to char
bv_val} ":" struct berval {unsigned long bv_len, pointer to char bv_val}

Per C99 spec section 6.7.3:
       [#9]  For  two  qualified types to be compatible, both shall
       have the identically qualified version of a compatible type;
       the  order of type qualifiers within a list of specifiers or
       qualifiers does not affect the specified type.


Therefore :? is invalid in this context. With the included patch, I've made the
if/else explicit, which should produce the desired behavior despite the const
qualifier difference.