[Date Prev][Date Next] [Chronological] [Thread] [Top]

ITS#3755 strict aliasing rules



Compiling current HEAD with gcc 4.1.1
  make AC_CFLAGS="-g -fstrict-aliasing -O3 -Wstrict-aliasing" -j3 CC=gcc

turned up a few "will break strict-aliasing rules" warnings:
libldap/cyrus.c
libldap/getdn.c
clients/tools/ldapsearch.c
servers/slapd/sasl.c

I've silenced all of those. Whether the code was actually unsafe before 
and is safer now is anybody's guess; I was unable to get any of it to 
misbehave with various combinations of optimization switches.

There are warnings about using the BerElementBuffer "might break 
strict-aliasing rules" which I've chosen to ignore. Since the memory is 
only actually referenced through the BerElement pointer, whether or not 
the contents are defined when accessing the BerElementBuffer is 
irrelevant. (I.e., we never access it that way, so it's moot.)

-- 
   -- Howard Chu
   Chief Architect, Symas Corp.  http://www.symas.com
   Director, Highland Sun        http://highlandsun.com/hyc
   OpenLDAP Core Team            http://www.openldap.org/project/