GnuPG build problem under Solaris w/ SunPRO cc (keyserver/gpg_ldap.c)

Dr.Stefan.Dalibor at bfa.de Dr.Stefan.Dalibor at bfa.de
Thu Sep 26 13:40:08 CEST 2002


Hi,
GnuPG 1.2.0 doesn't build on Solaris 8 with the SunPro C compiler, due
to problems with struct initialization in keyserver/gpgkeys_ldap.c.
The same problem seems to exist under RiscOS (and I guess with many C
compilers except GCC - IMHO it's a good idea to avoid such `inlined'
struct initializations altogether for portable code...

With the following patchlet gpg builds fine (but I didn't test LDAP
keyserver connectivity).

Stefan
--
diff -C3 -r gnupg-1.2.0/keyserver/gpgkeys_ldap.c gnupg-1.2.0-patched/keyserver/gpgkeys_ldap.c
*** gnupg-1.2.0/keyserver/gpgkeys_ldap.c  Mon Sep  9 22:36:12 2002
--- gnupg-1.2.0-patched/keyserver/gpgkeys_ldap.c      Thu Sep 26 09:00:14 2002
***************
*** 66,74 ****
    char line[MAX_LINE];
    char *key[2]={0,0};
    char keyid[17];
! #ifndef __riscos__
    LDAPMod mod={LDAP_MOD_ADD,pgpkeystr,{key}},*attrs[2]={&mod,NULL};
! #else
    LDAPMod mod, *attrs[2];

    mod.mod_op      = LDAP_MOD_ADD;
--- 66,74 ----
    char line[MAX_LINE];
    char *key[2]={0,0};
    char keyid[17];
! #if !defined(__riscos__) && !defined(__SUNPRO_C)
    LDAPMod mod={LDAP_MOD_ADD,pgpkeystr,{key}},*attrs[2]={&mod,NULL};
! #else /* !defined(__riscos__) && !defined(__SUNPRO_C) */
    LDAPMod mod, *attrs[2];

    mod.mod_op      = LDAP_MOD_ADD;
***************
*** 78,84 ****

    attrs[0]    = &mod;
    attrs[1]    = NULL;
! #endif

    dn=malloc(strlen("pgpCertid=virtual,")+strlen(basekeyspacedn)+1);
    if(dn==NULL)
--- 78,84 ----

    attrs[0]    = &mod;
    attrs[1]    = NULL;
! #endif /* !defined(__riscos__) && !defined(__SUNPRO_C) */

    dn=malloc(strlen("pgpCertid=virtual,")+strlen(basekeyspacedn)+1);
    if(dn==NULL)





More information about the Gnupg-devel mailing list