You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by fi...@apache.org on 2001/02/09 01:56:05 UTC

cvs commit: apr CHANGES apr_common.m4

fielding    01/02/08 16:56:05

  Modified:    .        CHANGES apr_common.m4
  Log:
  Add APR_TRY_GCC_WARNING macro to dynamically test the iconv prototype
  if gcc is being used.
  
  Revision  Changes    Path
  1.56      +5 -0      apr/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apr/CHANGES,v
  retrieving revision 1.55
  retrieving revision 1.56
  diff -u -r1.55 -r1.56
  --- CHANGES	2001/02/07 16:40:52	1.55
  +++ CHANGES	2001/02/09 00:56:03	1.56
  @@ -1,5 +1,10 @@
   Changes with APR b1  
   
  +  *) Added the APR_TRY_GCC_WARNING configure macro for testing a
  +     gcc-specific compile with -Werror) and the APR_CHECK_ICONV_INBUF
  +     macro to test for annoying iconv prototype differences.
  +     [Jeff Trawick, Roy Fielding]
  +
     *) Fix a problem with configure on NetBSD.  We must include sys/types.h
        for some platforms.  [jun-ichiro hagino <it...@kame.net>]
   
  
  
  
  1.13      +30 -4     apr/apr_common.m4
  
  Index: apr_common.m4
  ===================================================================
  RCS file: /home/cvs/apr/apr_common.m4,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- apr_common.m4	2001/02/08 02:37:29	1.12
  +++ apr_common.m4	2001/02/09 00:56:04	1.13
  @@ -1,3 +1,32 @@
  +dnl APR_TRY_GCC_WARNING(INCLUDES, FUNCTION-BODY,
  +dnl             [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
  +AC_DEFUN(APR_TRY_GCC_WARNING,
  +[if test "$GCC" = "yes"; then 
  +  changequote(', ')
  +  cat > conftest.$ac_ext <<EOTEST
  +#include "confdefs.h"
  +'$1'
  +int main(int argc, const char * const argv[]) {
  +'$2'
  +; return 0; }
  +EOTEST
  +  changequote([, ])
  +  if ${CC-cc} -c -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -Werror $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&AC_FD_CC ; then
  +    ifelse([$3], , :, [rm -rf conftest*
  +    $3])
  +  else
  +    echo "configure: warning on program:" >&AC_FD_CC
  +    cat conftest.$ac_ext >&AC_FD_CC
  +    ifelse([$4], , , [rm -rf conftest*
  +    $4])
  +  fi
  +else
  +    # Not using gcc -- assume everything is okay
  +    ifelse([$3], , :, [rm -rf conftest*
  +    $3])
  +fi
  +rm -f conftest*])
  +
   dnl
   dnl RUN_SUBDIR_CONFIG_NOW(dir [, sub-package-cmdline-args])
   dnl
  @@ -300,13 +329,10 @@
   AC_DEFUN(APR_CHECK_ICONV_INBUF,[
   AC_MSG_CHECKING(for type of inbuf parameter to iconv)
   if test "x$apr_iconv_inbuf_const" = "x"; then
  -    AC_TRY_COMPILE([
  +    APR_TRY_GCC_WARNING([
       #include <stddef.h>
       #include <iconv.h>
       ],[
  -    #if defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR < 2
  -    #error We know this version of glibc has const char **, so fail this compile
  -    #endif
       iconv(0,(char **)0,(size_t *)0,(char **)0,(size_t *)0);
       ], apr_iconv_inbuf_const="0", apr_iconv_inbuf_const="1")
   fi
  
  
  

Re: cvs commit: apr CHANGES apr_common.m4

Posted by "Roy T. Fielding" <fi...@ebuilt.com>.
> A key characteristic we need is to make sure that our assumption about
> const-ness compiles at all on the platform, whether or not gcc is
> being used.  It is my understanding that certain platforms besides
> glibc-2.2+gcc-recent will fail the compile if the const-ness is
> wrong.  IRIX was an example given on the mailing list.

I remembered that as well while in the shower this morning.
I'll fix it.

....Roy

Re: cvs commit: apr CHANGES apr_common.m4

Posted by Jeff Trawick <tr...@bellsouth.net>.
fielding@apache.org writes:

> fielding    01/02/08 16:56:05
> 
>   Modified:    .        CHANGES apr_common.m4
>   Log:
>   Add APR_TRY_GCC_WARNING macro to dynamically test the iconv prototype
>   if gcc is being used.

This turned out a little different than I imagined :)

A key characteristic we need is to make sure that our assumption about
const-ness compiles at all on the platform, whether or not gcc is
being used.  It is my understanding that certain platforms besides
glibc-2.2+gcc-recent will fail the compile if the const-ness is
wrong.  IRIX was an example given on the mailing list.

An additional characteristic which is extremely nice is to add -Werror
to the CFLAGS if the compiler is gcc.  That verifies an additional
level of correctness without needing the apr_iconv_inbuf_const hint.