Author: rmeggins
Update of /cvs/dirsec/ldapserver In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv26931/ldapserver
Modified Files: configure.ac aclocal.m4 configure config.h.in missing install-sh depcomp compile config.sub config.guess Makefile.in Log Message: Bug Description: Need to address 64-bit compiler warnings - part 1 Reviewed by: nhosoi (Thanks!) Fix Description: The intptr_t and uintptr_t are types which are defined as integer types that are the same size as the pointer (void *) type. On the platforms we currently support, this is the same as long and unsigned long, respectively (ILP32 and LP64). However, intptr_t and uintptr_t are more portable. These can be used to assign a value passed as a void * to get an integer value, then "cast down" to an int or PRBool, and vice versa. This seems to be a common idiom in other applications where values must be passed as void *. For the printf/scanf formats, there is a standard header called inttypes.h which defines formats to use for various 64 bit quantities, so that you don't need to figure out if you have to use %lld or %ld for a 64-bit value - you just use PRId64 which is set to the correct value. I also assumed that size_t is defined as the same size as a pointer so I used the PRIuPTR format macro for size_t. I removed many unused variables and some unused functions. I put parentheses around assignments in conditional expressions to tell the compiler not to complain about them. I cleaned up some #defines that were defined more than once. I commented out some unused goto labels. Some of our header files shared among several source files define static variables. I made it so that those variables are not defined unless a macro is set in the source file. This avoids a lot of unused variable warnings. I added some return values to functions that were declared as returning a value but did not return a value. In all of these cases no one was checking the return value anyway. I put explicit parentheses around cases like this: expr || expr && expr - the && has greater precedence than the ||. The compiler complains because it wants you to make sure you mean expr || (expr && expr), not (expr || expr) && expr. I cleaned up several places where the compiler was complaining about possible use of uninitialized variables. There are still a lot of these cases remaining. There are a lot of warnings like this: lib/ldaputil/certmap.c:1279: warning: dereferencing type-punned pointer will break strict-aliasing rules These are due to our use of void ** to pass in addresses of addresses of structures. Many of these are calls to slapi_ch_free, but many are not - they are cases where we do not know what the type is going to be and may have to cast and modify the structure or pointer. I started replacing the calls to slapi_ch_free with slapi_ch_free_string, but there are many many more that need to be fixed. The dblayer code also contains a fix for https://bugzilla.redhat.com/show_bug.cgi?id=463991 - instead of checking for dbenv->foo_handle to see if a db "feature" is enabled, instead check the flags passed to open the dbenv. This works for bdb 4.2 through bdb 4.7 and probably other releases as well. Platforms tested: RHEL5 x86_64, Fedora 8 i386 Flag Day: no Doc impact: no
Index: configure.ac =================================================================== RCS file: /cvs/dirsec/ldapserver/configure.ac,v retrieving revision 1.50 retrieving revision 1.51 diff -u -r1.50 -r1.51 --- configure.ac 23 Sep 2008 21:50:25 -0000 1.50 +++ configure.ac 8 Oct 2008 17:29:00 -0000 1.51 @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) # This version is the version returned by ns-slapd -v -AC_INIT([dirsrv], [1.1.3], [http://bugzilla.redhat.com/]) +AC_INIT([dirsrv], [1.1.4], [http://bugzilla.redhat.com/]) # AC_CONFIG_HEADER must be called right after AC_INIT. AC_CONFIG_HEADERS([config.h]) AM_INIT_AUTOMAKE([1.9 foreign subdir-objects]) @@ -21,7 +21,7 @@ AC_HEADER_DIRENT AC_HEADER_STDC AC_HEADER_SYS_WAIT -AC_CHECK_HEADERS([arpa/inet.h fcntl.h malloc.h netdb.h netinet/in.h stdlib.h string.h strings.h sys/file.h sys/socket.h sys/time.h unistd.h]) +AC_CHECK_HEADERS([arpa/inet.h fcntl.h malloc.h netdb.h netinet/in.h stdlib.h string.h strings.h sys/file.h sys/socket.h sys/time.h unistd.h inttypes.h])
# Checks for typedefs, structures, and compiler characteristics. AC_HEADER_STAT
Index: configure =================================================================== RCS file: /cvs/dirsec/ldapserver/configure,v retrieving revision 1.88 retrieving revision 1.89 diff -u -r1.88 -r1.89 --- configure 23 Sep 2008 21:50:25 -0000 1.88 +++ configure 8 Oct 2008 17:29:00 -0000 1.89 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59 for dirsrv 1.1.3. +# Generated by GNU Autoconf 2.59 for dirsrv 1.1.4. # # Report bugs to http://bugzilla.redhat.com/. # @@ -423,8 +423,8 @@ # Identity of this package. PACKAGE_NAME='dirsrv' PACKAGE_TARNAME='dirsrv' -PACKAGE_VERSION='1.1.3' -PACKAGE_STRING='dirsrv 1.1.3' +PACKAGE_VERSION='1.1.4' +PACKAGE_STRING='dirsrv 1.1.4' PACKAGE_BUGREPORT='http://bugzilla.redhat.com/'
# Factoring default headers for most tests. @@ -954,7 +954,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -`configure' configures dirsrv 1.1.3 to adapt to many kinds of systems. +`configure' configures dirsrv 1.1.4 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1020,7 +1020,7 @@
if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of dirsrv 1.1.3:";; + short | recursive ) echo "Configuration of dirsrv 1.1.4:";; esac cat <<_ACEOF
@@ -1203,7 +1203,7 @@ test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<_ACEOF -dirsrv configure 1.1.3 +dirsrv configure 1.1.4 generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc. @@ -1217,7 +1217,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake.
-It was created by dirsrv $as_me 1.1.3, which was +It was created by dirsrv $as_me 1.1.4, which was generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@ @@ -1863,7 +1863,7 @@
# Define the identity of the package. PACKAGE='dirsrv' - VERSION='1.1.3' + VERSION='1.1.4'
cat >>confdefs.h <<_ACEOF @@ -19369,7 +19369,8 @@
-for ac_header in arpa/inet.h fcntl.h malloc.h netdb.h netinet/in.h stdlib.h string.h strings.h sys/file.h sys/socket.h sys/time.h unistd.h + +for ac_header in arpa/inet.h fcntl.h malloc.h netdb.h netinet/in.h stdlib.h string.h strings.h sys/file.h sys/socket.h sys/time.h unistd.h inttypes.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test "${$as_ac_Header+set}" = set"; then @@ -25795,7 +25796,7 @@ } >&5 cat >&5 <<_CSEOF
-This file was extended by dirsrv $as_me 1.1.3, which was +This file was extended by dirsrv $as_me 1.1.4, which was generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES @@ -25858,7 +25859,7 @@
cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\ -dirsrv config.status 1.1.3 +dirsrv config.status 1.1.4 configured by $0, generated by GNU Autoconf 2.59, with options \"`echo "$ac_configure_args" | sed 's/[\""`$]/\\&/g'`\"
389-commits@lists.fedoraproject.org