Bug 455489 - Address compiler warnings about strict-aliasing rules
Summary: Address compiler warnings about strict-aliasing rules
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: 389
Classification: Retired
Component: Directory Server
Version: 1.1.1
Hardware: All
OS: Linux
medium
low
Target Milestone: ---
Assignee: Rich Megginson
QA Contact: Viktor Ashirov
URL:
Whiteboard:
Depends On:
Blocks: 389_1.2.6 639035
TreeView+ depends on / blocked
 
Reported: 2008-07-15 18:37 UTC by Nathan Kinder
Modified: 2015-12-07 17:00 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-12-07 17:00:28 UTC
Embargoed:


Attachments (Terms of Use)
0001-Bug-455489-Address-compiler-warnings-about-strict-al.patch (2.28 KB, patch)
2010-03-25 22:54 UTC, Endi Sukma Dewata
rmeggins: review+
Details | Diff

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.


Note You need to log in before you can comment on or make changes to this bug.