Bug 677464

Summary: clean up compiler warnings in 389-ds-base 1.2.8
Product: Red Hat Enterprise Linux 6 Reporter: Rich Megginson <rmeggins>
Component: 389-ds-baseAssignee: Rich Megginson <rmeggins>
Status: CLOSED ERRATA QA Contact: Chandrasekar Kannan <ckannan>
Severity: high Docs Contact:
Priority: high    
Version: 6.1CC: amsharma, benl, dpal, jgalipea
Target Milestone: rcKeywords: screened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 389-ds-base-1.2.8-0.3.a3.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 677440 Environment:
Last Closed: 2011-05-19 12:41:40 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 677440    
Bug Blocks: 639035, 656390, 676871    

Description Rich Megginson 2011-02-14 21:57:33 UTC
+++ This bug was initially created as a clone of Bug #677440 +++

Building on RHEL6 x86_64 with
CFLAGS="-g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic" and configure --enable-debug

There are several compiler warnings in 1.2.8
../ds.git/ldap/servers/slapd/attrsyntax.c: In function 'slapi_attr_is_dn_syntax_attr':
../ds.git/ldap/servers/slapd/attrsyntax.c:829: warning: suggest parentheses around assignment used as truth value
../ds.git/ldap/servers/slapd/libglobs.c: In function 'config_get_anon_access_switch':
../ds.git/ldap/servers/slapd/libglobs.c:4623: warning: assignment makes pointer from integer without a cast
../ds.git/ldap/servers/slapd/libglobs.c:4625: warning: return makes integer from pointer without a cast
../ds.git/ldap/servers/slapd/result.c:1699: warning: format '%u' expects type 'unsigned int', but argument 6 has type 'ber_tag_t'
... several of these ...
../ds.git/ldap/servers/plugins/acl/aclparse.c: In function 'acl_check_for_target_macro':
../ds.git/ldap/servers/plugins/acl/aclparse.c:1644: warning: initialization makes integer from pointer without a cast
../ds.git/ldap/servers/plugins/acl/aclparse.c:1649: warning: assignment makes integer from pointer without a cast
../ds.git/ldap/servers/plugins/acl/aclparse.c:1650: warning: comparison between pointer and integer
../ds.git/ldap/servers/slapd/back-ldbm/archive.c: In function 'ldbm_back_ldbm2archive':
../ds.git/ldap/servers/slapd/back-ldbm/archive.c:432: warning: implicit declaration of function 'is_slapd_running'
../ds.git/ldap/servers/slapd/back-ldbm/dblayer.c: In function 'dblayer_sys_pages':
../ds.git/ldap/servers/slapd/back-ldbm/dblayer.c:927: warning: format '%u' expects type 'unsigned int *', but argument 3 has type 'size_t *'
../ds.git/ldap/servers/slapd/back-ldbm/dblayer.c: In function 'commit_good_database':
../ds.git/ldap/servers/slapd/back-ldbm/dblayer.c:4217: warning: format '%u' expects type 'unsigned int', but argument 4 has type 'size_t'
../ds.git/ldap/servers/slapd/back-ldbm/import-threads.c:726: warning: format '%u' expects type 'unsigned int', but argument 3 has type 'size_t'
... several of these ...
../ds.git/ldap/servers/slapd/back-ldbm/ldbm_attrcrypt.c: In function '_back_crypt_crypto_op':
../ds.git/ldap/servers/slapd/back-ldbm/ldbm_attrcrypt.c:1513: warning: format '%d' expects type 'int', but argument 5 has type 'size_t'
../ds.git/ldap/servers/slapd/back-ldbm/ldbm_attrcrypt.c:1516: warning: format '%d' expects type 'int', but argument 4 has type 'size_t'
../ds.git/ldap/servers/plugins/chainingdb/cb_bind.c: In function 'cb_sasl_bind_once_s':
../ds.git/ldap/servers/plugins/chainingdb/cb_bind.c:186: warning: pointer type mismatch in conditional expression
../ds.git/ldap/servers/plugins/chainingdb/cb_bind.c:188: warning: format '%s' expects type 'char *', but argument 4 has type 'void * const'
../ds.git/ldap/servers/plugins/chainingdb/cb_conn_stateless.c: In function 'cb_get_connection':
../ds.git/ldap/servers/plugins/chainingdb/cb_conn_stateless.c:174: warning: unused variable 'error2'
../ds.git/ldap/servers/plugins/mep/mep.c: In function 'mep_modrdn_post_op':
../ds.git/ldap/servers/plugins/mep/mep.c:2374: warning: label 'bail' defined but not used
../ds.git/ldap/servers/plugins/replication/cl5_api.c: In function '_cl5AppInit':
../ds.git/ldap/servers/plugins/replication/cl5_api.c:1973: warning: format '%u' expects type 'unsigned int', but argument 5 has type 'size_t'
../ds.git/ldap/servers/plugins/replication/cl5_api.c: In function 'cl5WriteRUV':
../ds.git/ldap/servers/plugins/replication/cl5_api.c:6250: warning: implicit declaration of function 'is_slapd_running'
../ds.git/ldap/servers/slapd/connection.c:2702: warning: format ‘%u’ expects type ‘unsigned int’, but argument 6 has type ‘ber_len_t’
../ds.git/ldap/servers/slapd/connection.c:2702: warning: format ‘%u’ expects type ‘unsigned int’, but argument 7 has type ‘ber_len_t’
../ds.git/ldap/servers/slapd/main.c: In function ‘slapd_exemode_db2ldif’:
../ds.git/ldap/servers/slapd/main.c:2329: warning: implicit declaration of function ‘is_slapd_running’

--- Additional comment from rmeggins on 2011-02-14 14:54:24 EST ---

Created attachment 478695 [details]
0001-Bug-677440-clean-up-compiler-warnings-in-389-ds-base.patch

--- Additional comment from rmeggins on 2011-02-14 14:59:40 EST ---

Created attachment 478698 [details]
0001-Bug-677440-clean-up-compiler-warnings-in-389-ds-base.patch

fix formatting problems in previous patch

--- Additional comment from rmeggins on 2011-02-14 15:58:53 EST ---

To ssh://git.fedorahosted.org/git/389/ds.git
   cee5f05..79a3fae  master -> master
commit 79a3fae13fd3ae772b2a37343ef78a1d1e0cb24d
Author: Rich Megginson <rmeggins>
Date:   Tue Feb 8 11:28:31 2011 -0700
    * added is_slapd_running to shared header file
    * added parentheses around assignment used as truth value
    * added printf format string for ber_tag_t and ber_len_t
    * fixed type usage in config_get_anon_access_switch
    * fixed variable declaration in acl_check_for_target_macro
    * use %lu for size_t in scanf and printf
    * fixed usage of matcheddnp in cb_sasl_bind_once_s
    Reviewed by: nkinder (Thanks!)
To ssh://git.fedorahosted.org/git/389/ds.git
   b6871e9..b339ee0  389-ds-base-1.2.8 -> 389-ds-base-1.2.8
commit b339ee0e211b31abe038bb25e8abbf2314161f0f
Author: Rich Megginson <rmeggins>
Date:   Tue Feb 8 11:28:31 2011 -0700

Comment 3 Jenny Severance 2011-04-14 18:44:53 UTC
could you please add steps to verify.  I am still seeing a slew of warnings in the build logs from tps tests.

Comment 4 Rich Megginson 2011-04-14 19:48:42 UTC
I reviewed the logs - all of the ones that we planned to fix are fixed - the others are not serious - looks like tps uses a different set of build flags than regular rpm --eval %optflags - we need to fix these too (but it can wait until the next release)

Comment 5 Amita Sharma 2011-04-15 08:55:11 UTC
I request dev to please verify this.

Comment 6 Rich Megginson 2011-04-15 14:20:14 UTC
verified

Comment 7 errata-xmlrpc 2011-05-19 12:41:40 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2011-0533.html