[Gmp-commit] /home/hgfiles/gmp: Get rid of K&R support.

mercurial at gmplib.org mercurial at gmplib.org
Tue Nov 9 21:23:01 CET 2010


details:   /home/hgfiles/gmp/rev/bf3be2ae2a3a
changeset: 13678:bf3be2ae2a3a
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Tue Nov 09 21:22:51 2010 +0100
description:
Get rid of K&R support.

diffstat:

 ChangeLog         |  11 +++++++++++
 Makefile.am       |  23 +----------------------
 configure.in      |   5 +----
 doc/configuration |  38 +++-----------------------------------
 doc/gmp.texi      |   3 +--
 dumbmp.c          |   3 ---
 mpn/Makefile.am   |  43 -------------------------------------------
 7 files changed, 17 insertions(+), 109 deletions(-)

diffs (264 lines):

diff -r c95cb2cd00f1 -r bf3be2ae2a3a ChangeLog
--- a/ChangeLog	Tue Nov 09 20:35:56 2010 +0100
+++ b/ChangeLog	Tue Nov 09 21:22:51 2010 +0100
@@ -1,3 +1,14 @@
+2010-11-09  Torbjorn Granlund  <tege at gmplib.org>
+
+	* configure.in: Get rid of K&R support.
+	* Makefile.am: Likewise.
+	* mpn/Makefile.am: Likewise.
+	* doc/configuration: Update docs wrt K&R support.
+	* doc/gmp.texi: Likewise.
+
+	* configure.in (AC_INIT): Amend bug reporting address with manual
+	reference.
+
 2010-11-06  Torbjorn Granlund  <tege at gmplib.org>
 
 	* config.guess: If cpuid says we have 32bit-only x86 but
diff -r c95cb2cd00f1 -r bf3be2ae2a3a Makefile.am
--- a/Makefile.am	Tue Nov 09 20:35:56 2010 +0100
+++ b/Makefile.am	Tue Nov 09 21:22:51 2010 +0100
@@ -25,7 +25,7 @@
 # Makefiles in subdirectories, but here we must omit it so automake gives
 # the actual ansi2knr build rule, not "cd $(top_builddir) && make ansi2knr".
 #
-AUTOMAKE_OPTIONS = 1.8 gnu no-dependencies ansi2knr
+# AUTOMAKE_OPTIONS = 1.8 gnu no-dependencies
 
 
 # Libtool -version-info for libgmp.la and libmp.la.  See "Versioning" in the
@@ -318,9 +318,6 @@
 	@echo ''
 
 
-# The ansi2knr setups for the build programs are the same as the normal
-# automake ansi2knr rules, but using $(CC_FOR_BUILD) instead of $(CC).
-#
 # The "test -f" support for srcdir!=builddir is similar to the automake .c.o
 # etc rules, but with each foo.c explicitly, since $< is not portable
 # outside an inference rule.
@@ -348,9 +345,6 @@
 DISTCLEANFILES += gen-fac_ui$(EXEEXT_FOR_BUILD)
 EXTRA_DIST += gen-fac_ui.c
 
-gen-fac_ui_.c: gen-fac_ui.c $(ANSI2KNR)
-	$(CPP_FOR_BUILD) `if test -f $(srcdir)/gen-fac_ui.c; then echo $(srcdir)/gen-fac_ui.c; else echo gen-fac_ui.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > gen-fac_ui_.c || rm -f gen-fac_ui_.c
-
 
 fib_table.h: gen-fib$(EXEEXT_FOR_BUILD)
 	./gen-fib header $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >fib_table.h || (rm -f fib_table.h; exit 1)
@@ -365,9 +359,6 @@
 DISTCLEANFILES += gen-fib$(EXEEXT_FOR_BUILD)
 EXTRA_DIST += gen-fib.c
 
-gen-fib_.c: gen-fib.c $(ANSI2KNR)
-	$(CPP_FOR_BUILD) `if test -f $(srcdir)/gen-fib.c; then echo $(srcdir)/gen-fib.c; else echo gen-fib.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > gen-fib_.c || rm -f gen-fib_.c
-
 
 mp_bases.h: gen-bases$(EXEEXT_FOR_BUILD)
 	./gen-bases header $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >mp_bases.h || (rm -f mp_bases.h; exit 1)
@@ -382,10 +373,6 @@
 DISTCLEANFILES += gen-bases$(EXEEXT_FOR_BUILD)
 EXTRA_DIST += gen-bases.c
 
-gen-bases_.c: gen-bases.c $(ANSI2KNR)
-	$(CPP_FOR_BUILD) `if test -f $(srcdir)/gen-bases.c; then echo $(srcdir)/gen-bases.c; else echo gen-bases.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > gen-bases_.c || rm -f gen-bases_.c
-
-
 
 trialdivtab.h: gen-trialdivtab$(EXEEXT_FOR_BUILD)
 	./gen-trialdivtab $(GMP_LIMB_BITS) 8000 >trialdivtab.h || (rm -f trialdivtab.h; exit 1)
@@ -396,9 +383,6 @@
 DISTCLEANFILES += gen-trialdivtab$(EXEEXT_FOR_BUILD)
 EXTRA_DIST += gen-trialdivtab.c
 
-gen-trialdivtab_.c: gen-trialdivtab.c $(ANSI2KNR)
-	$(CPP_FOR_BUILD) `if test -f $(srcdir)/gen-trialdivtab.c; then echo $(srcdir)/gen-trialdivtab.c; else echo gen-trialdivtab.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > gen-trialdivtab_.c || rm -f gen-trialdivtab_.c
-
 
 mpn/jacobitab.h: gen-jacobitab$(EXEEXT_FOR_BUILD)
 	./gen-jacobitab >mpn/jacobitab.h || (rm -f mpn/jacobitab.h; exit 1)
@@ -409,9 +393,6 @@
 DISTCLEANFILES += gen-jacobitab$(EXEEXT_FOR_BUILD)
 EXTRA_DIST += gen-jacobitab.c
 
-gen-jacobitab_.c: gen-jacobitab.c $(ANSI2KNR)
-	$(CPP_FOR_BUILD) `if test -f $(srcdir)/gen-jacobitab.c; then echo $(srcdir)/gen-jacobitab.c; else echo gen-jacobitab.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > gen-jacobitab_.c || rm -f gen-jacobitab_.c
-
 
 mpn/perfsqr.h: gen-psqr$(EXEEXT_FOR_BUILD)
 	./gen-psqr $(GMP_LIMB_BITS) $(GMP_NAIL_BITS) >mpn/perfsqr.h || (rm -f mpn/perfsqr.h; exit 1)
@@ -422,8 +403,6 @@
 DISTCLEANFILES += gen-psqr$(EXEEXT_FOR_BUILD)
 EXTRA_DIST += gen-psqr.c
 
-gen-psqr_.c: gen-psqr.c $(ANSI2KNR)
-	$(CPP_FOR_BUILD) `if test -f $(srcdir)/gen-psqr.c; then echo $(srcdir)/gen-psqr.c; else echo gen-psqr.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > gen-psqr_.c || rm -f gen-psqr_.c
 
 
 # Avoid: CVS - cvs directories
diff -r c95cb2cd00f1 -r bf3be2ae2a3a configure.in
--- a/configure.in	Tue Nov 09 20:35:56 2010 +0100
+++ b/configure.in	Tue Nov 09 21:22:51 2010 +0100
@@ -65,7 +65,7 @@
 dnl  Note that there's a copy of these options in the top-level Makefile.am,
 dnl  so update there too if changing anything.
 dnl
-AM_INIT_AUTOMAKE([1.8 gnu no-dependencies $(top_builddir)/ansi2knr])
+AM_INIT_AUTOMAKE([1.8 gnu no-dependencies])
 AM_CONFIG_HEADER(config.h:config.in)
 AM_MAINTAINER_MODE
 
@@ -2145,9 +2145,6 @@
 echo "      MPN_PATH=\"$path\""
 
 
-# Automake ansi2knr support.
-AM_C_PROTOTYPES
-
 CL_AS_NOEXECSTACK
 
 GMP_PROG_AR
diff -r c95cb2cd00f1 -r bf3be2ae2a3a doc/configuration
--- a/doc/configuration	Tue Nov 09 20:35:56 2010 +0100
+++ b/doc/configuration	Tue Nov 09 21:22:51 2010 +0100
@@ -121,14 +121,9 @@
   iii) If HAVE_NATIVE_func is going to be used, then add a #undef to
        the AH_VERBATIM([HAVE_NATIVE] block in configure.in.
 
-  iv) Add file.c to nodist_libdummy_la_SOURCES in mpn/Makefile.am (in
-      order to get an ansi2knr rule).  If the file is only in
-      assembler then this step is unnecessary, but do it anyway so as
-      not to forget if later a .c version is added.
-
-  v) If the function can be provided by a multi-function file, then
-     add to the "case" statement in configure.in which lists each
-     multi-function filename and what function files it can provide.
+  iv) If the function can be provided by a multi-function file, then
+      add to the "case" statement in configure.in which lists each
+      multi-function filename and what function files it can provide.
 
 
 ** Adding a test program
@@ -245,10 +240,6 @@
 ltmain.sh comes from libtool.  Remove it and run "libtoolize --copy",
 or just copy the file by hand.
 
-ansi2knr.c, ansi2knr.1, install-sh and doc/mdate-sh come from automake
-and can be updated by copying or by removing and running "automake
---add-missing --copy".
-
 texinfo.tex can be updated from ftp.gnu.org.  Check it still works
 with "make gmp.dvi", "make gmp.ps" and "make gmp.pdf".
 
@@ -367,30 +358,6 @@
 used in such cases, for the benefit of K&R compilers with int!=long
 and where the difference matters in function calls.
 
-** K&R support
-
-Function definitions must be in the GNU stylized form to work.  See
-the ansi2knr.1 man page (included in the GMP sources).
-
-__GMP_PROTO is used for function prototypes, other ANSI / K&R
-differences are conditionalized in various places.
-
-Proper testing of the K&R support requires a compiler which gives an
-error for ANSI-isms.  Configuring with --host=none is a good idea, to
-test all the generic C code.
-
-When using an ANSI compiler, the ansi2knr setups can be partially
-tested with
-
-	./configure am_cv_prog_cc_stdc=no ac_cv_prog_cc_stdc=no
-
-This will test the use of $U and the like in the makefiles, but not
-much else.
-
-Forcing the cache variables can be used with a compiler like HP C
-which is K&R by default but to which configure normally adds ANSI mode
-flags.  This then should be a good full K&R test.
-
 * Other Notes
 
 ** Compatibility
diff -r c95cb2cd00f1 -r bf3be2ae2a3a doc/gmp.texi
--- a/doc/gmp.texi	Tue Nov 09 20:35:56 2010 +0100
+++ b/doc/gmp.texi	Tue Nov 09 21:22:51 2010 +0100
@@ -923,8 +923,7 @@
 Compiling is done with both @samp{CPPFLAGS} and @samp{CFLAGS}, but
 preprocessing uses just @samp{CPPFLAGS}.  This distinction is because most
 preprocessors won't accept all the flags the compiler does.  Preprocessing is
-done separately in some configure tests, and in the @samp{ansi2knr} support
-for K&R compilers.
+done separately in some configure tests.
 
 @item @option{CC_FOR_BUILD}
 @cindex @code{CC_FOR_BUILD}
diff -r c95cb2cd00f1 -r bf3be2ae2a3a dumbmp.c
--- a/dumbmp.c	Tue Nov 09 20:35:56 2010 +0100
+++ b/dumbmp.c	Tue Nov 09 21:22:51 2010 +0100
@@ -26,9 +26,6 @@
    gmp.h or gmp-impl.h.  To use this file in a program just #include
    "dumbmp.c".
 
-   ANSI function definitions can be used here, since ansi2knr is run if
-   necessary.  But other ANSI-isms like "const" should be avoided.
-
    mp_limb_t here is an unsigned long, since that's a sensible type
    everywhere we know of, with 8*sizeof(unsigned long) giving the number of
    bits in the type (that not being true for instance with int or short on
diff -r c95cb2cd00f1 -r bf3be2ae2a3a mpn/Makefile.am
--- a/mpn/Makefile.am	Tue Nov 09 20:35:56 2010 +0100
+++ b/mpn/Makefile.am	Tue Nov 09 21:22:51 2010 +0100
@@ -24,49 +24,6 @@
 
 OFILES = @mpn_objects@
 
-
-# All possible mpn normal and optional function files are listed here, to
-# get automake to generate ansi2knr rules for each.  Such rules will be
-# ignored for any that are instead implemented with a .asm (or whatever) for
-# a particular target.
-#
-nodist_EXTRA_libmpn_la_SOURCES =					    \
-  add.c add_1.c add_n.c							    \
-  addmul_1.c addmul_2.c addmul_3.c addmul_4.c addmul_5.c addmul_6.c	    \
-  addmul_7.c addmul_8.c							    \
-  and_n.c andn_n.c							    \
-  cmp.c com.c copyd.c copyi.c						    \
-  dive_1.c diveby3.c divis.c divrem.c divrem_1.c divrem_2.c		    \
-  sbpi1_bdiv_qr.c sbpi1_bdiv_q.c					    \
-  sbpi1_div_qr.c sbpi1_div_q.c sbpi1_divappr_q.c			    \
-  dcpi1_bdiv_qr.c dcpi1_bdiv_q.c					    \
-  dcpi1_div_qr.c dcpi1_div_q.c dcpi1_divappr_q.c			    \
-  dump.c fib2_ui.c gcd.c						    \
-  gcd_1.c gcdext.c get_d.c get_str.c					    \
-  hamdist.c hgcd2.c hgcd.c invert_limb.c				    \
-  ior_n.c iorn_n.c jacbase.c jacobi_lehmer.c lshift.c			    \
-  matrix22_mul.c matrix22_mul1_inverse_vector.c mod_1.c mod_34lsub1.c mode1o.c  \
-  mod_1_1.c mod_1_2.c mod_1_3.c mod_1_4.c				    \
-  mul.c mul_1.c mul_2.c mul_3.c mul_4.c mul_fft.c mul_n.c mul_basecase.c    \
-  nussbaumer_mul.c							    \
-  toom22_mul.c toom32_mul.c toom42_mul.c toom52_mul.c toom62_mul.c	    \
-  toom33_mul.c toom43_mul.c toom53_mul.c toom63_mul.c			    \
-  toom44_mul.c								    \
-  toom6h_mul.c toom6_sqr.c toom8h_mul.c toom8_sqr.c			    \
-  toom_couple_handling.c						    \
-  toom2_sqr.c toom3_sqr.c toom4_sqr.c					    \
-  toom_eval_dgr3_pm1.c toom_eval_dgr3_pm2.c				    \
-  toom_eval_pm1.c toom_eval_pm1.c toom_eval_pm2exp.c toom_eval_pm2rexp.c    \
-  toom_interpolate_5pts.c toom_interpolate_6pts.c toom_interpolate_7pts.c   \
-  toom_interpolate_8pts.c toom_interpolate_12pts.c toom_interpolate_16pts.c \
-  invertappr.c invert.c binvert.c mulmod_bnm1.c sqrmod_bnm1.c		    \
-  mullo_n.c mullo_basecase.c nand_n.c neg.c nior_n.c perfsqr.c	    \
-  popcount.c pre_divrem_1.c pre_mod_1.c pow_1.c random.c random2.c rshift.c \
-  rootrem.c scan0.c scan1.c set_str.c			    \
-  sqr_basecase.c sqr_diagonal.c						    \
-  sqrtrem.c sub.c sub_1.c sub_n.c submul_1.c				    \
-  tdiv_qr.c udiv_qrnnd.c udiv_w_sdiv.c xor_n.c xnor_n.c
-
 noinst_LTLIBRARIES = libmpn.la
 nodist_libmpn_la_SOURCES = fib_table.c mp_bases.c
 libmpn_la_LIBADD = $(OFILES)


More information about the gmp-commit mailing list