[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Make AC_CHECK_SIZEOF warning-free
From: |
Eric Blake |
Subject: |
[PATCH] Make AC_CHECK_SIZEOF warning-free |
Date: |
Thu, 01 Jan 2004 07:38:13 -0700 |
User-agent: |
Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) |
I tried to run `autoconf -Wall,error' on my project to clean it up from
older constructs, and to my surprise, AC_CHECK_SIZEOF is not warning-free:
eblake$ mkdir junk
eblake$ cd junk
eblake$ cat >> configure.ac
AC_INIT(junk)
AC_CHECK_SIZEOF(int)
AC_OUTPUT
eblake$ autoconf -Wall,error
autom4te: unknown warning category `'
configure.ac:2: warning: AC_RUN_IFELSE called without default to allow cross
compiling
autoconf/general.m4:2281: AC_RUN_IFELSE is expanded from...
autoconf/general.m4:1799: AC_CACHE_VAL is expanded from...
autoconf/general.m4:1808: AC_CACHE_CHECK is expanded from...
autoconf/types.m4:405: AC_CHECK_SIZEOF is expanded from...
configure.ac:2: the top level
eblake$ echo $?
1
I'm not sure how to silence the "autom4te: unknown warning category `'" line
noise, but it comes because `autoconf -Wall,error' passes
--warnings=,all,error to autom4te, and autom4te is not gracefully dealing
with the empty warning category.
You may find it an interesting exercise to clean up the testsuite, so that
it can pass all tests when WARNINGS=all,error is in the environment. This
patch only solved tests 85 and 86 of CVS HEAD (AC_CHECK_SIZEOF, in
tests/semantics.at:256,274) when fatal warnings are on. I did not try to
solve more of the testsuite, because a) some of the tests make sure obsolete
constructs still work (so they must warn), and b) I don't have copyright
assignment on file for autoconf (yet).
Here's the patch:
2004-01-01 Eric Blake <address@hidden>
* lib/autoconf/general.m4 (_AC_COMPUTE_INT_RUN): Pass
cross-compiling argument to AC_RUN_IFELSE.
Index: lib/autoconf/general.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/general.m4,v
retrieving revision 1.824
diff -u -p -r1.824 general.m4
--- lib/autoconf/general.m4 17 Nov 2003 17:37:08 -0000 1.824
+++ lib/autoconf/general.m4 1 Jan 2004 14:12:34 -0000
@@ -1,7 +1,7 @@
# This file is part of Autoconf. -*- Autoconf -*-
# Parameterized macros.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, Free Software Foundation, Inc.
+# 2002, 2003, 2004 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -2510,7 +2510,7 @@ esac[]dnl
# Store the evaluation of the integer EXPRESSION in VARIABLE.
m4_define([_AC_COMPUTE_INT_RUN],
[AC_RUN_IFELSE([AC_LANG_INT_SAVE([$3], [$1])],
- [$2=`cat conftest.val`], [$4])])
+ [$2=`cat conftest.val`], [$4], [:])])
# _AC_COMPUTE_INT(EXPRESSION, VARIABLE, INCLUDES, IF-FAILS)
--
Someday, I might put a cute statement here.
Eric Blake address@hidden
- [PATCH] Make AC_CHECK_SIZEOF warning-free,
Eric Blake <=