Issue 1609 - PATCH to compile with non-gcc c compiler
Summary: PATCH to compile with non-gcc c compiler
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-02-22 17:25 UTC by jfrederic.clere@fujitsu-siemens.com
Modified: 2014-08-01 21:05 UTC (History)
0 users

See Also:


Attachments
patch.txt (4.68 KB, text/plain)
2002-02-22 17:39 UTC, jfrederic.clere@fujitsu-siemens.com
Details

Note You need to log in before you can comment on or make changes to this issue.
Description jfrederic.clere@fujitsu-siemens.com 2002-02-22 17:25:03 UTC
Full_Name: Jean-Frederic Clere
Version: cvs HEAD
OS: 
URL: 
Submission from: (NULL) (192.35.17.132)


The OpenLDAP stops compiling on machines that are no using gcc because
structures
have to initial with constantes.
Find below the patch
+++
Index: libraries/libldap/getdn.c
===================================================================
RCS file: /home/cvs/OpenLDAP/pkg/ldap/libraries/libldap/getdn.c,v
retrieving revision 1.94
diff -u -r1.94 getdn.c
--- libraries/libldap/getdn.c   13 Feb 2002 21:49:03 -0000      1.94
+++ libraries/libldap/getdn.c   22 Feb 2002 17:11:50 -0000
@@ -601,11 +601,12 @@
 int
 ldap_str2dn( LDAP_CONST char *str, LDAPDN **dn, unsigned flags )
 {
-       struct berval   bv = { 0, (char *)str };
+       struct berval   bv;
 
        assert( str );
 
        bv.bv_len = strlen( str );
+       bv.bv_val = (char *) str;
 
        return ldap_bv2dn( &bv, dn, flags );
 }
@@ -687,7 +688,9 @@
 
        for ( ; p < end; p++ ) {
                int             err;
-               struct berval   tmpbv = { bv->bv_len - ( p - str ), (char *)p
};
+               struct berval   tmpbv;
+               tmpbv.bv_len = bv->bv_len - ( p - str );
+               tmpbv.bv_val = (char *)p;
 
                err = ldap_bv2rdn( &tmpbv, &newRDN, (char **) &p, flags );
                if ( err != LDAP_SUCCESS ) {
@@ -815,12 +818,13 @@
 ldap_str2rdn( LDAP_CONST char *str, LDAPRDN **rdn,
        char **n_in, unsigned flags )
 {
-       struct berval   bv = { 0, (char *)str };
+       struct berval   bv;
 
        assert( str );
        assert( str[ 0 ] != '\0' );     /* FIXME: is this required? */
 
        bv.bv_len = strlen( str );
+       bv.bv_val = (char *) str;
 
        return ldap_bv2rdn( &bv, rdn, n_in, flags );
 }
Index: servers/slapd/acl.c
===================================================================
RCS file: /home/cvs/OpenLDAP/pkg/ldap/servers/slapd/acl.c,v
retrieving revision 1.139
diff -u -r1.139 acl.c
--- servers/slapd/acl.c 13 Feb 2002 11:09:37 -0000      1.139
+++ servers/slapd/acl.c 22 Feb 2002 17:11:52 -0000
@@ -845,10 +845,13 @@
 
                if ( b->a_group_pat.bv_len && op->o_ndn.bv_len ) {
                        char buf[1024];
-                       struct berval bv = { sizeof(buf) - 1, buf };
+                       struct berval bv;
                        struct berval ndn = { 0, NULL };
                        int rc;
 
+                       bv.bv_len = sizeof(buf) - 1;
+                       bv.bv_val = buf;
+
                        /* b->a_group is an unexpanded entry name, expanded it
should be an
                         * entry with objectclass group* and we test to see if
odn is one of
                         * the values in the attribute group
@@ -1823,8 +1826,11 @@
 {
        regex_t re;
        char newbuf[512];
-       struct berval bv = {sizeof(newbuf), newbuf};
+       struct berval bv;
        int     rc;
+
+       bv.bv_len = sizeof(newbuf);
+       bv.bv_val = newbuf;
 
        if(str == NULL) str = "";
 
Index: servers/slapd/backglue.c===================================================================
RCS file: /home/cvs/OpenLDAP/pkg/ldap/servers/slapd/backglue.c,v
retrieving revision 1.38
diff -u -r1.38 backglue.c
--- servers/slapd/backglue.c    26 Jan 2002 07:44:59 -0000      1.38
+++ servers/slapd/backglue.c    22 Feb 2002 17:11:52 -0000
@@ -296,8 +296,12 @@
        long stoptime = 0;
        struct berval bv;
        glue_state gs = {0};
-       slap_callback cb = {glue_back_response, glue_back_sresult,
-               glue_back_sendentry, &gs};
+       slap_callback cb;
+
+       cb.sc_response = glue_back_response;
+       cb.sc_sresult = glue_back_sresult;
+       cb.sc_sendentry = glue_back_sendentry;
+       cb.sc_private = &gs;
 
        gs.prevcb = op->o_callback;
 
Index: servers/slapd/entry.c
===================================================================
RCS file: /home/cvs/OpenLDAP/pkg/ldap/servers/slapd/entry.c,v
retrieving revision 1.90
diff -u -r1.90 entry.c
--- servers/slapd/entry.c       25 Jan 2002 06:11:52 -0000      1.90
+++ servers/slapd/entry.c       22 Feb 2002 17:11:54 -0000
@@ -590,7 +590,9 @@
        a = NULL;
 
        while (i = entry_getlen(&ptr)) {
-               struct berval bv = { i, ptr };
+               struct berval bv;
+               bv.bv_len = i;
+               bv.bv_val = ptr;
                if (a) {
                        a->a_next = (Attribute *)bptr;
                }
Index: servers/slapd/sets.c
===================================================================
RCS file: /home/cvs/OpenLDAP/pkg/ldap/servers/slapd/sets.c,v
retrieving revision 1.12
diff -u -r1.12 sets.c
--- servers/slapd/sets.c        28 Jan 2002 09:11:36 -0000      1.12
+++ servers/slapd/sets.c        22 Feb 2002 17:11:54 -0000
@@ -119,8 +119,11 @@
 {
        BerVarray vals, nset;
        char attrstr[32];
-       struct berval bv = {attr->bv_len, attrstr};
+       struct berval bv;
        int i;
+
+       bv.bv_len = attr->bv_len;
+       bv.bv_val = attrstr;
 
        if (set == NULL)
                return(ch_calloc(1, sizeof(struct berval)));
Index: servers/slapd/tools/slapadd.c
===================================================================
RCS file: /home/cvs/OpenLDAP/pkg/ldap/servers/slapd/tools/slapadd.c,v
retrieving revision 1.40
diff -u -r1.40 slapadd.c
--- servers/slapd/tools/slapadd.c       28 Jan 2002 19:36:29 -0000      1.40
+++ servers/slapd/tools/slapadd.c       22 Feb 2002 17:11:54 -0000
@@ -53,7 +53,10 @@
 
        while( ldif_read_record( ldiffp, &lineno, &buf, &lmax ) ) {
                Entry *e = str2entry( buf );
-               struct berval bvtext = { textlen, textbuf };
+               struct berval bvtext;
+
+               bvtext.bv_len = textlen;
+               bvtext.bv_val = textbuf;
 
                if( e == NULL ) {
                        fprintf( stderr, "%s: could not parse entry
(line=%d)\n",

Comment 1 jfrederic.clere@fujitsu-siemens.com 2002-02-22 17:39:27 UTC
I am attached the patch.txt file, that propably more easy to use than the text
for the web page.

Cheers

Jean-frederic

 openldap-its@OpenLDAP.org wrote:
> 
> *** THIS IS AN AUTOMATICALLY GENERATED REPLY ***
> 
> Thanks for your report to openldap-its@OpenLDAP.org.  Your report
> has been placed into our Issue Tracking System and has been assigned
> the tracking number ITS#1609.
> 
> One of support engineers will look at your report in due course.
> Note that this may take some time because our support engineers
> are volunteers.  They only work on OpenLDAP when they have spare
> time.
> If you need to provide additional information in regards to your
> issue report, you may do so by replying to this message.  Note that
> any mail sent to openldap-its@openldap.org with (ITS#1609)
> in the subject will automatically be attached to the issue report.
> 
>         mailto:openldap-its@openldap.org?subject=(ITS#1609)
> 
> You may follow the progress of this message by loading the following
> URL in a web browser:
>     http://www.OpenLDAP.org/its/index.cgi?findid=1609
> 
> Please remember to retain your issue tracking number (ITS#1609)
> on any further messages you send to us regarding this message.  If
> you don't then you'll just waste our time and yours because we
> won't be able to properly track the message.
> 
> In our experience many people ask questions that have been asked
> before.  We recommend that you review our online FAQ:
>         http://www.OpenLDAP.org/faq/
> 
> and search archives of our many mailing lists (such as openldap-software
> and openldap-bugs):
>         http://www.OpenLDAP.org/lists/#archives
> 
> --------------
> Copyright 2002 The OpenLDAP Foundation, All Rights Reserved.
Comment 2 Kurt Zeilenga 2002-02-26 03:27:12 UTC
changed notes
changed state Open to Closed
moved from Incoming to Development
Comment 3 OpenLDAP project 2014-08-01 21:05:18 UTC
fixed in HEAD