bug-m4
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: regex.c not 64-bit clean (?)


From: Eric Blake
Subject: Re: regex.c not 64-bit clean (?)
Date: Sat, 10 Jun 2006 01:56:45 +0000

Please keep replies on the list, so that others may find the answer to this
question when searching the archives.  Also, I'm adding m4-patches,
since I am proposing a patch.

> > > Debian has just switched to gcc 4.1 as the default compiler, so we are
> > > now looking at some build logs very closely.
> > > 
> > > When building m4 on a 64-bit architecture, the build log reads as follows:
> > > 
> > > regex.c:3995: warning: cast from pointer to integer of different size
> > 
> > Thanks for the report.  Was this m4 1.4.4 or CVS head?
> 
> It was with m4 1.4.4.

Good; I was hoping so.  That version of regex.c is several years old.

> 
> > [...]
> > 
> > Could you please let me know if the current branch-1_4 still has
> > this problem?
> 
> I would have to login to one of the debian machines to check that
> (as I don't have a 64-bit machine myself), but this should not be a problem.
> 
> (Well, I'm not fluent with cvs yet, could you give me the exact
> command line to retrieve branch-1_4, or provide a snapshot?)

General instructions are on:
https://savannah.gnu.org/cvs/?group=m4

Specifically, for the branch, you can do:
$ cvs -z3 -d:pserver:address@hidden:/sources/m4 co -r branch-1_4 m4

Also, if the bug is still present, which I imagine it is, you will need to
get gnulib from CVS:
$ cvs -z3 -d:pserver:address@hidden:/sources/gnulib co gnulib

First, confirm if the bug is still present in CVS m4:
$ cd m4
$ ./bootstrap
$ ./configure CFLAGS='-Wall -Werror'
$ make

I suspect it will be, since I really haven't touched regex.c that much
since 1.4.4.  Then try this patch which pulls the latest regex.c from
gnulib:

$ make clean
$ patch -p0 < email
$ GNULIB_TOOL=../gnulib/gnulib-tool ./bootstrap
$ ./configure CFLAGS='-Wall -Werror'
$ make

If that fixed the bug (as I suspect it will), then I will go ahead and
commit this patch, and make a snapshot m4-1.4.4b to upload to
alpha.gnu.org so you can build straight from a tarball rather than
going through CVS.  The reason I haven't committed this patch
yet is that I'm not sure it is worth moving to gnulib without confirmation
that it makes an improvement on at least one platform; and the
reason I have not uploaded a tarball yet is that it is my first time trying
to distribute a package via alpha.gnu.org, and I don't want to do
it twice in a row if the gnulib patch helps.

Thanks so much for your help!

-- Eric Blake

2006-06-09  Eric Blake  <address@hidden>

        * configure.ac (M4_EARLY, M4_INIT): Use gnulib.
        (AC_PROG_RANLIB, AC_AIX, AC_MINIX, AC_CHECK_HEADERS),
        (AC_FUNC_ALLOCA, AC_REPLACE_FUNCS): Avoid checks now done by
        gnulib.
        * Makefile.am (ACLOCAL_AMFLAGS): New entry, for gnulib.
        * m4/gnulib-cache.m4: New file, from gnulib.
        * bootstrap: Invoke gnulib-tool --update.
        * src/m4.c (main): Cast away const.
Index: bootstrap
===================================================================
RCS file: /sources/m4/m4/bootstrap,v
retrieving revision 1.31.2.1
diff -u -p -r1.31.2.1 bootstrap
--- bootstrap   11 May 2006 13:10:48 -0000      1.31.2.1
+++ bootstrap   10 Jun 2006 01:53:51 -0000
@@ -1,7 +1,54 @@
 #! /bin/sh
 
-# helps bootstrapping M4, when checked out from CVS
-# requires GNU Autoconf 2.5x.
+# Helps bootstrapping M4, when checked out from CVS.
+# Requires GNU Autoconf 2.59 or later, GNU Automake 1.9.6 or later,
+# and a recent CVS checkout of gnulib.
 
 : ${AUTORECONF=autoreconf}
-$AUTORECONF --force --verbose --install
+: ${GNULIB_TOOL=gnulib-tool}
+: ${SED=sed}
+
+dirname="s,/[^/]*$,,"
+basename="s,^.*/,,g"
+
+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+# is ksh but when the shell is invoked as "sh" and the current value of
+# the _XPG environment variable is not equal to 1 (one), the special
+# positional parameter $0, within a function call, is the name of the
+# function.
+progpath="$0"
+
+# The name of this program:
+progname=`echo "$progpath" | $SED "$basename"`
+
+# func_echo arg...
+# Echo program name prefixed message.
+func_echo ()
+{
+    echo $progname: ${1+"$@"}
+}
+
+
+# func_error arg...
+# Echo program name prefixed message to standard error.
+func_error ()
+{
+    echo $progname: ${1+"$@"} >&2
+    exit 1
+}
+
+## ---------------------- ##
+## Import Gnulib modules. ##
+## ---------------------- ##
+
+func_echo "running: ${GNULIB_TOOL} --update"
+${GNULIB_TOOL} --update || func_error "gnulib-tool failed"
+
+## ----------- ##
+## Autoreconf. ##
+## ----------- ##
+
+func_echo "running: $AUTORECONF --force --verbose --install"
+$AUTORECONF --force --verbose --install || func_error "autoreconf failed"
+
+exit 0
Index: configure.ac
===================================================================
RCS file: /sources/m4/m4/configure.ac,v
retrieving revision 1.36.2.11
diff -u -p -r1.36.2.11 configure.ac
--- configure.ac        9 Jun 2006 03:07:20 -0000       1.36.2.11
+++ configure.ac        10 Jun 2006 01:53:51 -0000
@@ -29,21 +29,16 @@ AC_CONFIG_SRCDIR([src/m4.h])
 AC_CONFIG_HEADERS([config.h:config-h.in])
 
 AC_PROG_CC
-AC_PROG_RANLIB
+M4_EARLY
 
-AC_AIX
-AC_MINIX
-
-AC_CHECK_HEADERS([limits.h memory.h siginfo.h string.h unistd.h])
+AC_CHECK_HEADERS([limits.h siginfo.h])
 AC_CHECK_HEADERS([signal.h sys/signal.h], [break])
 AC_TYPE_SIGNAL
 AC_TYPE_SIZE_T
 
 AC_CHECK_FUNCS([mkstemp sigaction sigaltstack sigstack sigvec strerror 
tmpfile])
-AC_FUNC_ALLOCA
-AC_FUNC_VPRINTF
-AC_REPLACE_FUNCS([strtol])
 
+M4_INIT
 
 AC_MSG_CHECKING([ecvt declaration])
 AC_EGREP_HEADER([ecvt], [stdlib.h],
Index: Makefile.am
===================================================================
RCS file: /sources/m4/m4/Makefile.am,v
retrieving revision 1.25.2.2
diff -u -p -r1.25.2.2 Makefile.am
--- Makefile.am 7 Jun 2006 12:13:08 -0000       1.25.2.2
+++ Makefile.am 10 Jun 2006 01:53:51 -0000
@@ -23,3 +23,4 @@
 SUBDIRS = examples lib src doc checks
 EXTRA_DIST = bootstrap c-boxes.el Makefile.maint
 DISTCLEANFILES = stamp-h
+ACLOCAL_AMFLAGS = -I m4
Index: src/m4.c
===================================================================
RCS file: /sources/m4/m4/src/Attic/m4.c,v
retrieving revision 1.1.1.1.2.9
diff -u -p -r1.1.1.1.2.9 m4.c
--- src/m4.c    5 Jun 2006 12:41:29 -0000       1.1.1.1.2.9
+++ src/m4.c    10 Jun 2006 01:53:51 -0000
@@ -281,7 +281,8 @@ main (int argc, char *const *argv, char 
 
   head = tail = NULL;
 
-  while (optchar = getopt_long (argc, argv, OPTSTRING, long_options, NULL),
+  while (optchar = getopt_long (argc, (char **) argv, OPTSTRING,
+                                long_options, NULL),
         optchar != EOF)
     switch (optchar)
       {
--- /dev/null   2006-06-09 19:53:54.150000000 -0600
+++ m4/gnulib-cache.m4  2006-06-08 20:54:14.000000000 -0600
@@ -0,0 +1,27 @@
+# Copyright (C) 2004-2006 Free Software Foundation, Inc.
+#
+# This file is free software, distributed under the terms of the GNU
+# General Public License.  As a special exception to the GNU General
+# Public License, this file may be distributed as part of a program
+# that contains a configuration script generated by Autoconf, under
+# the same distribution terms as the rest of that program.
+#
+# Generated by gnulib-tool.
+#
+# This file represents the specification of how gnulib-tool is used.
+# It acts as a cache: It is written and read by gnulib-tool.
+# In projects using CVS, this file is meant to be stored in CVS,
+# like the configure.ac and various Makefile.am files.
+
+
+# Specification in the form of a command-line invocation:
+#   gnulib-tool --import --dir=. --lib=libm4 --source-base=lib --m4-base=m4 
--aux-dir=. --macro-prefix=M4 alloca error getopt obstack regex strtol xalloc
+
+# Specification in the form of a few gnulib-tool.m4 macro invocations:
+gl_MODULES([alloca error getopt obstack regex strtol xalloc])
+gl_AVOID([])
+gl_SOURCE_BASE([lib])
+gl_M4_BASE([m4])
+gl_TESTS_BASE([tests])
+gl_LIB([libm4])
+gl_MACRO_PREFIX([M4])

reply via email to

[Prev in Thread] Current Thread [Next in Thread]