Thanks for reporting that.  Can you please verify that the following C
program does not compile, on your platform?

   static long int longval () { return **0**; }
   static unsigned long int ulongval () { return **0**; }
   #include <stdio.h>
   #include <stdlib.h>
   int
   main ()
   {

     FILE *f = fopen ("conftest.val", "w");
     if (! f)
       return 1;
     if ((**0**) < 0)
       {
         long int i = longval ();
         if (i != (**0**))
           return 1;
         fprintf (f, "%ld\n", i);
       }
     else
       {
         unsigned long int i = ulongval ();
         if (i != (**0**))
           return 1;
         fprintf (f, "%lu\n", i);
       }
     return ferror (f) || fclose (f) != 0;

     ;
     return 0;
   }

I.e., can you verify that the command "gcc -g -O2 foo.c; echo $?"
echos a nonzero value at the end?  Here's what happens on my platform:

   $ gcc -g -O2 foo.c; echo $?
   foo.c: In function 'longval':
   foo.c:1: error: invalid type argument of 'unary *'
   foo.c:1: error: expected expression before ';' token
   foo.c: In function 'main':
   foo.c:12: error: invalid type argument of 'unary *'
   foo.c:12: error: expected expression before ')' token
   foo.c:15: error: invalid type argument of 'unary *'
   foo.c:15: error: expected expression before ')' token
   foo.c:22: error: 'i' undeclared (first use in this function)
   foo.c:22: error: (Each undeclared identifier is reported only once
   foo.c:22: error: for each function it appears in.)
   foo.c:22: error: invalid type argument of 'unary *'
   foo.c:22: error: expected expression before ')' token
   1

For now, I'll assume that it does not compile, and so I installed the
following patch, but I'd like you to verify my assumption.  Thanks.

2006-10-26  Paul Eggert  <[EMAIL PROTECTED]>

        * tests/base.at (AC_COMPUTE_INT): Test **0** rather than 1 / 0,
        since powerpc-apple-darwin8-gcc-4.0.1 (Apple Computer, Inc. build
        5363) simply issues a warning when dividing by zero at compile
        time.  Problem reported by Elias Pipping.

--- tests/base.at       23 Oct 2006 06:12:40 -0000      1.40
+++ tests/base.at       26 Oct 2006 19:28:13 -0000
@@ -230,12 +230,12 @@

 AT_DATA([configure.ac],
 [[AC_INIT
-AC_COMPUTE_INT([divide_by_zero],
-              [1 / 0],
+AC_COMPUTE_INT([invalid_expression],
+              [**0**],
               [],
-              [divide_by_zero=failed])
-test "$divide_by_zero" = failed ||
-  AC_MSG_ERROR([1 / 0 did not fail])
+              [invalid_expression=failed])
+test "$invalid_expression" = failed ||
+  AC_MSG_ERROR([**0** evaluated to $invalid_expression instead of failing])
 ]])

 AT_CHECK_AUTOCONF


Reply via email to