Bug 455489

Summary: Address compiler warnings about strict-aliasing rules
Product: [Retired] 389 Reporter: Nathan Kinder <nkinder>
Component: Directory ServerAssignee: Rich Megginson <rmeggins>
Status: CLOSED CURRENTRELEASE QA Contact: Viktor Ashirov <vashirov>
Severity: low Docs Contact:
Priority: medium    
Version: 1.1.1CC: amsharma
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-12-07 17:00:28 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:    
Bug Blocks: 543590, 639035    
Attachments:
Description Flags
0001-Bug-455489-Address-compiler-warnings-about-strict-al.patch rmeggins: review+

Description Nathan Kinder 2008-07-15 18:37:48 UTC
We have a number of compiler warnings like the ones below that we need to address:

370  lib/ldaputil/certmap.c: In function 'ldapu_set_cert_mapfn':
   371  lib/ldaputil/certmap.c:1277: warning: dereferencing type-punned pointer
will break strict-aliasing rules
   372  lib/ldaputil/certmap.c: In function 'ldapu_get_cert_mapfn':
   373  lib/ldaputil/certmap.c:1305: warning: dereferencing type-punned pointer
will break strict-aliasing rules
   374  lib/ldaputil/certmap.c: In function 'ldapu_set_cert_searchfn':
   375  lib/ldaputil/certmap.c:1318: warning: dereferencing type-punned pointer
will break strict-aliasing rules
   376  lib/ldaputil/certmap.c: In function 'ldapu_get_cert_searchfn':
   377  lib/ldaputil/certmap.c:1346: warning: dereferencing type-punned pointer
will break strict-aliasing rules
   378  lib/ldaputil/certmap.c: In function 'ldapu_set_cert_verifyfn':
   379  lib/ldaputil/certmap.c:1359: warning: dereferencing type-punned pointer
will break strict-aliasing rules

We can fix these issues in the code, or build with the -fno-strict-aliasing
compiler option.

Comment 1 Endi Sukma Dewata 2010-03-25 22:54:14 UTC
Created attachment 402710 [details]
0001-Bug-455489-Address-compiler-warnings-about-strict-al.patch

After applying the patch, the code was compiled as follows:

% export CFLAGS="-g -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings"
% configure --enable-debug
% make

There is no more warnings about strict-aliasing rules.

Comment 2 Rich Megginson 2010-03-25 23:00:11 UTC
To ssh://git.fedorahosted.org/git/389/ds.git
   c1d2e74..65e04b8  master -> master
commit 65e04b8d72fa0ebe8a4c8475c6bc26ac831f984f
Author: Endi S. Dewata <edewata>
Date:   Sun Mar 21 23:15:56 2010 -0500
    Fix description: The codes that generate strict-aliasing warnings have
    been changed.
    Reviewed by: rmeggins (and pushed by)

Comment 5 Amita Sharma 2011-06-14 05:50:00 UTC
Dev Verified.