[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bruno Haible <address@hidden>] _AC_COMPUTE_INT forgets to include s
From: |
Paul Eggert |
Subject: |
Re: [Bruno Haible <address@hidden>] _AC_COMPUTE_INT forgets to include stdio.h, stdlib.h |
Date: |
Thu, 13 Sep 2001 09:52:37 -0700 (PDT) |
> From: Akim Demaille <address@hidden>
> Date: 13 Sep 2001 17:24:41 +0200
>
> This seems OK to me. Paul?
Yes, it looks good. Thanks, Bruno.
Might I also suggest the following (alas untested) patch?
2001-09-13 Paul Eggert <address@hidden>
* aclang.m4: (AC_LANG_INT_SAVE(C)): Convert to `long', not
`int', to handle more integers. Check for output errors.
Append a newline, as POSIX requires that a shell be given only
text files, and text files must end in newline.
===================================================================
RCS file: aclang.m4,v
retrieving revision 2.52.0.1
retrieving revision 2.52.0.2
diff -pu -r2.52.0.1 -r2.52.0.2
--- aclang.m4 2001/09/13 11:03:33 2.52.0.1
+++ aclang.m4 2001/09/13 16:49:28 2.52.0.2
@@ -427,14 +427,15 @@ m4_define([AC_LANG_BOOL_COMPILE_TRY(C)],
# them only after the EXPRESSION has been evaluated.
m4_define([AC_LANG_INT_SAVE(C)],
[AC_LANG_PROGRAM([$1
-int conftestval () { return ($2); }
+long conftestval () { return ($2); }
@%:@include <stdio.h>
@%:@include <stdlib.h>],
[FILE *f = fopen ("conftest.val", "w");
if (!f)
exit (1);
-fprintf (f, "%d", conftestval ());
-fclose (f);])])
+fprintf (f, "%ld\n", conftestval ());
+if (ferror (f) || fclose (f) != 0)
+ exit (1);])])
# ----------------- #