The unified diff between revisions [fa5851fd..] and [9d20abe6..] is displayed below. It can also be downloaded as a raw diff.

#
#
# delete "demo/Makefile"
#
# rename "demo/devel.gpr"
#     to "demo.gpr"
#
# patch "INSTALL"
#  from [15709010f2120040c9301b39030c495f33310aa2]
#    to [a7a14a1c8e73596b1764c9637418155b3bcf66cd]
#
# patch "Makefile"
#  from [2b8f3d5e0fcc2827d3f93131ae224b4eb383d2b6]
#    to [bbaa8d258b52ce19c8126155d724dcb912eb6c4f]
#
# patch "README"
#  from [94137037ef764f61c85ccdbaf0b62460b83913c6]
#    to [da8bedff4125177565c105648c933f87f36a6afe]
#
# patch "build.gpr"
#  from [1b0ecbb2f9c60ee93ed54af9eb811eb724f353d1]
#    to [5a7258cbb9bbad6f2984ee8dd616babe7829d2ec]
#
# patch "demo/demo.adb"
#  from [923f3cabbf42b20ad3c8c106ab54bf220cdfd00a]
#    to [f9b47525f1d2a4920e55bf14487634dfc0ebb5ac]
#
# patch "demo.gpr"
#  from [aadca89589d9becb7cbaf64ee455a59238b21e1a]
#    to [e7330b3f1f31e5f9f9191a4335c8ec7cc40e4099]
#
# patch "generate_constants.c"
#  from [1ac28b6537c399d930b4eaf4edf357fd60c3554f]
#    to [3b214a37b58cd222dbbf561bf4e3a3964ded5e0c]
#
# patch "gmp/gmp-binding.ads"
#  from [33fab7755e40bfad023a63d3015e18a552b3bae7]
#    to [92afe6fd4ecab6d57bfa17641061665801a47852]
#
# patch "gmp/gnu_multiple_precision-aux.adb"
#  from [6b2fb172e89636438accaf31f238dab7a170907f]
#    to [d3aa4738bae1a3382cd7e576a3490020d8dd5555]
#
# patch "gmp/gnu_multiple_precision-aux.ads"
#  from [2c5f240c152e80eac3332e7a303d16d1dc30f2ad]
#    to [409d4e3886d74c27d22819f7c4a0c6d01db7e6c1]
#
# patch "gmp/gnu_multiple_precision-big_floats.ads"
#  from [d85b7b48d7a60dcc69759efe06a5e35c687341c3]
#    to [7ef0f94c2280eefde6dd4d1185e01605ff195054]
#
# patch "gmp/gnu_multiple_precision-big_integers.ads"
#  from [1a28313c8ec3f2a5d3b57b61c938d09b31165329]
#    to [86465c9d3ee32311320a6421e3c38dabb44e387f]
#
# patch "gmp/gnu_multiple_precision-big_rationals.ads"
#  from [431fc47df96a79e72a1431be1f227fce0f6e3140]
#    to [092b1fc1b42ef8ec514f84b0a8b898ef557c7c3c]
#
# patch "gmp/gnu_multiple_precision-generic_text_io.adb"
#  from [724a611feb9f53c0990e5f0d076485c712396439]
#    to [d1bd688171f97c0fb06198a28e808876b5a8e380]
#
# patch "gmp/gnu_multiple_precision-generic_text_io.ads"
#  from [ce2e5e0a91a379ad4113fc86128d35083d924031]
#    to [67b4bf647ef2a02ee3d5cdde7bd36e5662a10528]
#
# patch "gmp/gnu_multiple_precision-random_numbers.ads"
#  from [1b8a442984d7a999006d2723c593f14c26288661]
#    to [53b3bfd9d585b602a9cf6926e6dd535f5a6d2a08]
#
# patch "gmp/gnu_multiple_precision.adb"
#  from [be62a7dd80161397aaaaab286a08639684a1ef15]
#    to [c71d1da40339d63b36b29490689d9d07076683e4]
#
# patch "gmp/gnu_multiple_precision.ads"
#  from [9ebb5bc1d47f4cf14b9d21486cc198da662ee473]
#    to [fb0e2a8ec3f86799c1eeb57c85299b7c1f9436a6]
#
============================================================
--- INSTALL	15709010f2120040c9301b39030c495f33310aa2
+++ INSTALL	a7a14a1c8e73596b1764c9637418155b3bcf66cd
@@ -1,12 +1,12 @@
-Currently, GMPAda should install on an linux-like system with the GNAT
-compiler.  Of course, you'll also need the GMP and MPFR libraries
-installed.
+GMPAda should compile on any linux-like system with the GCC/GNAT
+compiler and the gprbuild tool.  Of course, you'll also need the GMP
+and MPFR libraries installed.

 ------- INSTALL -------

 Uncompress the archive and enter the main source directory.

-Edit the top of the Makefile. You must at least set the DESTDIR
+Edit the top of the Makefile. You must at least check the DESTDIR
 variable.  You may adapt the other directories to your local policy
 concerning Ada system-wide packages too.

============================================================
--- Makefile	2b8f3d5e0fcc2827d3f93131ae224b4eb383d2b6
+++ Makefile	bbaa8d258b52ce19c8126155d724dcb912eb6c4f
@@ -17,27 +17,20 @@
 #  Uncomment this and set this variable if you install by hand.
 #  DESTDIR=

-# gnatmake can do parallel builds; we don't want make to interfere.
+# gprbuild can do parallel builds; we don't want make to interfere.
 .NOTPARALLEL:
 CPUS := $(shell getconf _NPROCESSORS_ONLN)

-export LIB_NAME := gmpada
-SOVERSION := 1
-export LIB_DIR := .
-export SONAME := lib$(LIB_NAME).so.$(SOVERSION)
+# exported to project files
+export LIB_NAME ?= gmpada
+export SOVERSION ?= 1

-build: $(SONAME) lib$(LIB_NAME).a $(LIB_NAME).gpr
+build: gmp/gmp-constants.ads $(LIB_NAME).gpr
+	gprbuild -j$(CPUS) --create-missing-dirs -Pbuild \
+          -XLIB_KIND=dynamic -XLIB_OBJ_DIR=shared-obj -XLIB_DIR=shared-ali
+	gprbuild -j$(CPUS) --create-missing-dirs -Pbuild \
+          -XLIB_KIND=static -XLIB_OBJ_DIR=static-obj -XLIB_DIR=static-ali

-.PHONY: $(SONAME)
-$(SONAME): gmp/gmp-constants.ads
-	gnatmake -j$(CPUS) --create-missing-dirs -Pbuild.gpr \
-          -XLIB_KIND=dynamic -XLIB_OBJ_DIR=shared-obj -XLIB_ALI_DIR=shared-ali
-
-.PHONY: lib$(LIB_NAME).a
-lib$(LIB_NAME).a: gmp/gmp-constants.ads
-	gnatmake -j$(CPUS) --create-missing-dirs -Pbuild.gpr \
-          -XLIB_KIND=static -XLIB_OBJ_DIR=static-obj -XLIB_ALI_DIR=static-ali
-
 $(LIB_NAME).gpr: $(LIB_NAME).gpr.template
 	sed -e "s/\$$(DESTDIR)/$(DESTDIR)/g" $< > $@

@@ -46,52 +39,33 @@ generate_constants: LDFLAGS += -lgmp

 generate_constants: LDFLAGS += -lgmp

-clean: gmp/gmp-constants.ads
-# gnatclean needs to see this ads to remove its objects
-	$(MAKE) -C demo $@
+clean:
 	rm -rf \
-          $(LIB_NAME).gpr gmp/gmp-constants.ads generate_constants *~ gmp/*~ \
+          $(LIB_NAME).gpr gmp/gmp-constants.ads generate_constants \
           shared-obj shared-ali static-obj static-ali \
-          $(SONAME) lib$(LIB_NAME).so lib$(LIB_NAME).a
+          demo-obj

 install: build
 	install -d $(DESTDIR)/usr/share/ada/adainclude/$(LIB_NAME)
 	install --mode=644 gmp/* $(DESTDIR)/usr/share/ada/adainclude/$(LIB_NAME)
 	install --mode=644 $(LIB_NAME).gpr $(DESTDIR)/usr/share/ada/adainclude
 	install -d $(DESTDIR)/usr/lib/ada/adalib/$(LIB_NAME)
-	install --mode=444 shared-ali/* $(DESTDIR)/usr/lib/ada/adalib/$(LIB_NAME)
-	install --mode=644 lib$(LIB_NAME).a $(SONAME) $(DESTDIR)/usr/lib
-	cd $(DESTDIR)/usr/lib && ln -s $(SONAME) lib$(LIB_NAME).so
+	install --mode=444 shared-ali/*.ali $(DESTDIR)/usr/lib/ada/adalib/$(LIB_NAME)
+	install --mode=644 static-ali/lib$(LIB_NAME).a $(DESTDIR)/usr/lib
+	install --mode=644 shared-ali/lib$(LIB_NAME).so.$(SOVERSION) $(DESTDIR)/usr/lib
+	cd $(DESTDIR)/usr/lib && ln -f -s lib$(LIB_NAME).so.$(SOVERSION) lib$(LIB_NAME).so

 uninstall:
 	rm -rf \
           $(DESTDIR)/usr/share/ada/adainclude/$(LIB_NAME) \
           $(DESTDIR)/usr/share/ada/adainclude/$(LIB_NAME).gpr \
           $(DESTDIR)/usr/lib/ada/adalib/$(LIB_NAME) \
-          $(DESTDIR)/usr/lib/lib$(LIB_NAME).a $(DESTDIR)/usr/lib/$(SONAME) \
+          $(DESTDIR)/usr/lib/lib$(LIB_NAME).a \
+          $(DESTDIR)/usr/lib/lib$(LIB_NAME).so.$(SOVERSION) \
           $(DESTDIR)/usr/lib/lib$(LIB_NAME).so

 test: gmp/gmp-constants.ads
-	$(MAKE) -C demo $@
+	gprbuild -j$(CPUS) --create-missing-dirs -Pdemo.gpr -XOBJ_DIR=demo-obj
+	cd demo-obj && ./demo

 .PHONY: build clean install uninstall test
-
-
-######################################################################
-#  All that C stuff will be unnecessary with gprbuild’s mixed C/Ada
-#  project files.  For the moment, gnatmake will embed all .o files,
-#  we only have to compile them and store them in the object dir.
-#####################################################################
-
-C_OBJECTS := $(patsubst gmp/%.c,%.o,$(wildcard gmp/*.c))
-
-$(SONAME): $(addprefix shared-obj/,$(C_OBJECTS))
-lib$(LIB_NAME).a: $(addprefix static-obj/,$(C_OBJECTS))
-
-%.o: CFLAGS += -g -O2
-shared-obj/%.o: gmp/%.c | shared-obj
-	$(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@ -fPIC
-static-obj/%.o: gmp/%.c | static-obj
-	$(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
-shared-obj static-obj:
-	mkdir --parents $@
============================================================
--- README	94137037ef764f61c85ccdbaf0b62460b83913c6
+++ README	da8bedff4125177565c105648c933f87f36a6afe
@@ -13,9 +13,9 @@
 a test for the library, almost without user-readable output.  Though,
 reading the source file "demo.adb" and the project "demo.gpr" will
 give you an idea of how this library works. If the library is well
-installed, "gnatmake -Pdemo" should compile it.
+installed, "gnatmake -Pdemo" or "gprmake -Pdemo" should compile it.

-The Makefile and "devel.gpr" are provided as a demonstration for those
+The upstream source provides project file as a demonstration for those
 who need to recompile the binding. The most obvious motivation to do
 so is the need of performance: inlining optimizations will be
 efficient for short wrappers like the ones in this library.
============================================================
--- build.gpr	1b0ecbb2f9c60ee93ed54af9eb811eb724f353d1
+++ build.gpr	5a7258cbb9bbad6f2984ee8dd616babe7829d2ec
@@ -1,24 +1,35 @@
+--    GMPAda, binding to the Ada Language for the GNU MultiPrecision library.
+--    Copyright (C) 2009-2010 Nicolas Boulenguez <nicolas.boulenguez@free.fr>
+--
+--    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
+--    the Free Software Foundation, either version 3 of the License, or
+--    (at your option) any later version.
+--
+--    This program is distributed in the hope that it will be useful,
+--    but WITHOUT ANY WARRANTY; without even the implied warranty of
+--    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+--    GNU General Public License for more details.
+--
+--    You should have received a copy of the GNU General Public License
+--    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
 project Build is

   --  All output configuration is inherited from the Makefile.

   for Library_Name use External ("LIB_NAME");
-  for Library_Version use External ("SONAME");
+  for Library_Version use
+    "lib" & Build'Library_Name & ".so." & External ("SOVERSION");
   for Library_Kind use External ("LIB_KIND");
   for Library_Dir use External ("LIB_DIR");
   for Object_Dir use External ("LIB_OBJ_DIR");
-  for Library_ALI_Dir use External ("LIB_ALI_DIR");

-  --  C sources are mentioned because one day gprbuild will understand
-  --  them and allow to simplify the Makefile.
   for Library_Options use ("-lgmp");
   for Languages use ("Ada", "C");
   for Source_Dirs use ("gmp");
   package Compiler is
-     for Default_Switches ("Ada") use
-       ("-g", "-O2", "-gnatafno", "-gnatVa", "-gnatwa", "-fstack-check");
-     for Default_Switches ("C") use
-       ("-g", "-O2");
+     for Default_Switches ("Ada") use ("-g", "-O2");
+     for Default_Switches ("C") use ("-g", "-O2");
   end Compiler;
-
 end Build;
============================================================
--- demo/demo.adb	923f3cabbf42b20ad3c8c106ab54bf220cdfd00a
+++ demo/demo.adb	f9b47525f1d2a4920e55bf14487634dfc0ebb5ac
@@ -70,6 +70,7 @@ procedure Demo is
       pragma Assert (Big_Rational'Input (Stream (File)) = To_Big_Rational (314159.0));
       pragma Assert (Big_Float'Input (Stream (File)) = To_Big_Float (0.000000314));
       Close (File);
+      pragma Unreferenced (File);
    end Stream_IO_Random_Demo;

    procedure Text_IO_Demo
@@ -145,6 +146,7 @@ procedure Demo is
          Skip_Line (File);
       end loop;
       Close (File);
+      pragma Unreferenced (File);
    end Text_IO_Demo;

    procedure Rationals_Demo
============================================================
--- demo/devel.gpr	aadca89589d9becb7cbaf64ee455a59238b21e1a
+++ demo.gpr	e7330b3f1f31e5f9f9191a4335c8ec7cc40e4099
@@ -1,5 +1,5 @@
 --    GMPAda, binding to the Ada Language for the GNU MultiPrecision library.
---    Copyright (C) 2007,2009 Nicolas Boulenguez <nicolas.boulenguez@free.fr>
+--    Copyright (C) 2007-2010 Nicolas Boulenguez <nicolas.boulenguez@free.fr>
 --
 --    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
@@ -14,25 +14,36 @@
 --    You should have received a copy of the GNU General Public License
 --    along with this program.  If not, see <http://www.gnu.org/licenses/>.

-project Devel is
-  for Main use ("demo");
-  for Source_Dirs use (".", "../gmp");
-  for Object_Dir use ".";
-  for Exec_Dir use ".";
+project Demo is

+  --  All output configuration is inherited from the Makefile.
+
+  for Main use ("demo.adb");
+  for Source_Dirs use ("gmp", "demo");
+  for Object_Dir use External ("OBJ_DIR");
+
+  for Languages use ("Ada", "C");
   package Compiler is
-     for Default_Switches ("Ada")
-       use ("-fstack-check", "-g",
-            "-gnata", "-gnatE",
-            "-gnatf", "-gnato",
-            "-gnatq", "-gnatQ",
-            "-gnatVa", "-gnatwcfiopu",
-            "-gnaty3abcefhiklnprst");
+     for Default_Switches ("Ada") use
+       ("-g",             --  debugging information
+        "-gnatf",         --  full errors
+        "-gnatq",         --  dont’quit
+        "-gnatQ",         --  generate ALI files for cross-ref
+        "-gnatw.e",       --  activate all optional warnings
+        "-gnatwH",        --  except hiding
+        "-gnata",         --  Assert and Debug pragmas
+        "-gnatVa",        --  all validity checks
+        "-gnaty",         --  all style checks
+        "-gnatyM159",     --  max line length
+        "-gnato",         --  runtime overflow checking
+        "-gnatE",         --  checks for access-before-elaboration
+        "-fstack-check"); --  stack overflow checking
+     for Default_Switches ("C") use
+       ("-g",                       --  debugging information
+        "-Wall", "-Wextra",         --  activate all optional warnings
+        "-fstack-check");           --  stack overflow checking
   end Compiler;
-
   package Linker is
-     for Default_Switches ("Ada")
-       use ("-lgmp", "gmp_macros.o");
+     for Default_Switches ("Ada") use ("-lgmp");
   end Linker;
-
-end Devel;
+end Demo;
============================================================
--- generate_constants.c	1ac28b6537c399d930b4eaf4edf357fd60c3554f
+++ generate_constants.c	3b214a37b58cd222dbbf561bf4e3a3964ded5e0c
@@ -38,6 +38,7 @@ Please report this to the Ada binding au
   printf ("--  The values provided here may vary on your system.\n");
   printf ("\n");
   printf ("package GMP.Constants is\n");
+  printf ("   pragma Pure;\n");
   printf ("   Gmp_Version : constant String := \"%s\";\n", gmp_version);
   printf ("   Mp_Bits_Per_Limb : constant := %i;\n", mp_bits_per_limb);
   printf ("   Gnu_Mp_Version : constant := %i;\n", __GNU_MP_VERSION);
============================================================
--- gmp/gmp-binding.ads	33fab7755e40bfad023a63d3015e18a552b3bae7
+++ gmp/gmp-binding.ads	92afe6fd4ecab6d57bfa17641061665801a47852
@@ -22,6 +22,8 @@ package GMP.Binding is

 package GMP.Binding is

+   pragma Preelaborate;
+
    Gmp_Version : String renames GMP.Constants.Gmp_Version;
    Mp_Bits_Per_Limb          : constant := GMP.Constants.Mp_Bits_Per_Limb;
    Gnu_Mp_Version            : constant := GMP.Constants.Gnu_Mp_Version;
============================================================
--- gmp/gnu_multiple_precision-aux.adb	6b2fb172e89636438accaf31f238dab7a170907f
+++ gmp/gnu_multiple_precision-aux.adb	d3aa4738bae1a3382cd7e576a3490020d8dd5555
@@ -35,8 +35,8 @@ package body GNU_Multiple_Precision.Aux
       Negative : Boolean;
    begin
       Mpz_Get_Str (Buffer.all, int (Base), Item);
-      Negative := To_Ada (Buffer (0)) = '-';
-      while Buffer (Length) /= nul loop
+      Negative := To_Ada (Buffer.all (0)) = '-';
+      while Buffer.all (Length) /= nul loop
          Length := Length + 1;
       end loop;
       case Base is
@@ -60,11 +60,11 @@ package body GNU_Multiple_Precision.Aux
       end case;
       if Negative then
          for I in 1 .. Length - 1 loop
-            Put_Character.all (To_Ada (Buffer (I)));
+            Put_Character.all (To_Ada (Buffer.all (I)));
          end loop;
       else
          for I in 0 .. Length - 1 loop
-            Put_Character.all (To_Ada (Buffer (I)));
+            Put_Character.all (To_Ada (Buffer.all (I)));
          end loop;
       end if;
       if Base /= 10 then
@@ -91,8 +91,8 @@ package body GNU_Multiple_Precision.Aux
       Negative : Boolean;
    begin
       Mpq_Get_Str (Buffer.all, int (Base), Item);
-      Negative := To_Ada (Buffer (0)) = '-';
-      while Buffer (Length) /= nul loop
+      Negative := To_Ada (Buffer.all (0)) = '-';
+      while Buffer.all (Length) /= nul loop
          Length := Length + 1;
       end loop;
       case Base is
@@ -116,11 +116,11 @@ package body GNU_Multiple_Precision.Aux
       end case;
       if Negative then
          for I in 1 .. Length - 1 loop
-            Put_Character.all (To_Ada (Buffer (I)));
+            Put_Character.all (To_Ada (Buffer.all (I)));
          end loop;
       else
          for I in 0 .. Length - 1 loop
-            Put_Character.all (To_Ada (Buffer (I)));
+            Put_Character.all (To_Ada (Buffer.all (I)));
          end loop;
       end if;
       if Base /= 10 then
@@ -181,7 +181,7 @@ package body GNU_Multiple_Precision.Aux
          begin
             Mpf_Get_Str (Buffer.all, Exponent, 10, Buffer'Length - 2, Item);
             Blank_And_Sign (Buffer.all, 1);
-            if Buffer (Next_In) /= nul then Exponent := Exponent - 1; end if;
+            if Buffer.all (Next_In) /= nul then Exponent := Exponent - 1; end if;
             Copy (Buffer.all);
             Put_Character.all ('.');
             for I in 1 .. Actual_Aft loop Copy (Buffer.all); end loop;
@@ -398,7 +398,7 @@ package body GNU_Multiple_Precision.Aux
       begin
          Blanks_And_Sign (Buffer.all, Next_Out);
          Copy_Literal (Buffer.all, Next_Out, Base, Allow_Float => False);
-         Buffer (Next_Out) := nul;
+         Buffer.all (Next_Out) := nul;
          Mpz_Set_Str (Ret, Item, Buffer.all, Base);
          pragma Assert (Ret = 0);
          if Next = 'E' or Next = 'e' then
@@ -429,7 +429,7 @@ package body GNU_Multiple_Precision.Aux
          Copy_Literal (Buffer.all, Next_Out, Base, Allow_Float => True);
          if Next = 'E' or Next = 'e' then
             Consume;
-            Buffer (Next_Out) := To_C ('@');
+            Buffer.all (Next_Out) := To_C ('@');
             Next_Out := Next_Out + 1;
             if Next = '+' then
                Consume;
@@ -438,7 +438,7 @@ package body GNU_Multiple_Precision.Aux
             end if;
             Copy_Numeral (Buffer.all, Next_Out, Dot_Seen, 10, Allow_Dot => False);
          end if;
-         Buffer (Next_Out) := nul;
+         Buffer.all (Next_Out) := nul;
          Mpf_Set_Str (Ret, Item, Buffer.all, -Base);
          pragma Assert (Ret = 0);
          Free (Buffer);
============================================================
--- gmp/gnu_multiple_precision-aux.ads	2c5f240c152e80eac3332e7a303d16d1dc30f2ad
+++ gmp/gnu_multiple_precision-aux.ads	409d4e3886d74c27d22819f7c4a0c6d01db7e6c1
@@ -18,6 +18,8 @@ private package GNU_Multiple_Precision.A
    --  Used for Generic_Text_IO.Put/Get procedures and
    --  Big_Float/Integer.Image/Value functions.

+   pragma Preelaborate;
+
    procedure Put
      (Put_Character : access procedure (Item : in Character);
       Item          : in Mpz_T;
============================================================
--- gmp/gnu_multiple_precision-big_floats.ads	d85b7b48d7a60dcc69759efe06a5e35c687341c3
+++ gmp/gnu_multiple_precision-big_floats.ads	7ef0f94c2280eefde6dd4d1185e01605ff195054
@@ -16,6 +16,8 @@ package GNU_Multiple_Precision.Big_Float

 package GNU_Multiple_Precision.Big_Floats is

+   pragma Elaborate_Body;
+
    function "<"  (Left, Right : Big_Float) return Boolean;
    function "<=" (Left, Right : Big_Float) return Boolean;
    function ">"  (Left, Right : Big_Float) return Boolean;
============================================================
--- gmp/gnu_multiple_precision-big_integers.ads	1a28313c8ec3f2a5d3b57b61c938d09b31165329
+++ gmp/gnu_multiple_precision-big_integers.ads	86465c9d3ee32311320a6421e3c38dabb44e387f
@@ -16,6 +16,8 @@ package GNU_Multiple_Precision.Big_Integ

 package GNU_Multiple_Precision.Big_Integers is

+   pragma Elaborate_Body;
+
    function "<"  (Left, Right : Big_Integer) return Boolean;
    function "<=" (Left, Right : Big_Integer) return Boolean;
    function ">"  (Left, Right : Big_Integer) return Boolean;
============================================================
--- gmp/gnu_multiple_precision-big_rationals.ads	431fc47df96a79e72a1431be1f227fce0f6e3140
+++ gmp/gnu_multiple_precision-big_rationals.ads	092b1fc1b42ef8ec514f84b0a8b898ef557c7c3c
@@ -18,6 +18,8 @@ package GNU_Multiple_Precision.Big_Ratio

    --  TODO Compare with Big_Integers seeking forgotten functions.

+   pragma Preelaborate;
+
    subtype A_Comparison is Interfaces.C.int range Interfaces.C."-" (1) .. 1;

    procedure Canonicalize (Op : in out Big_Rational);
============================================================
--- gmp/gnu_multiple_precision-generic_text_io.adb	724a611feb9f53c0990e5f0d076485c712396439
+++ gmp/gnu_multiple_precision-generic_text_io.adb	d1bd688171f97c0fb06198a28e808876b5a8e380
@@ -62,11 +62,13 @@ package body GNU_Multiple_Precision.Gene
       Next  : Character;
       procedure Consume;
       procedure Consume is
-         Temp : Maybe_Character;
+         Ignored : Maybe_Character;
+         Temp    : Maybe_Character;
       begin
          pragma Assert (Count < Actual_Width
                         and not End_Of_Line (File));
-         Get (File, Temp);
+         Get (File, Ignored);
+         pragma Unreferenced (Ignored);
          Count := Count + 1;
          Look_Ahead (File, Temp, EOL);
          if Count < Actual_Width and not EOL then
============================================================
--- gmp/gnu_multiple_precision-generic_text_io.ads	ce2e5e0a91a379ad4113fc86128d35083d924031
+++ gmp/gnu_multiple_precision-generic_text_io.ads	67b4bf647ef2a02ee3d5cdde7bd36e5662a10528
@@ -38,6 +38,8 @@ package GNU_Multiple_Precision.Generic_T
    with procedure Skip_Page (File : in File_Type) is <>;
 package GNU_Multiple_Precision.Generic_Text_IO is

+   pragma Preelaborate;
+
    subtype Field is Natural;
    Max_IO_Length : Field := 1_000_000;

============================================================
--- gmp/gnu_multiple_precision-random_numbers.ads	1b8a442984d7a999006d2723c593f14c26288661
+++ gmp/gnu_multiple_precision-random_numbers.ads	53b3bfd9d585b602a9cf6926e6dd535f5a6d2a08
@@ -16,6 +16,8 @@ package GNU_Multiple_Precision.Random_Nu

 package GNU_Multiple_Precision.Random_Numbers is

+   pragma Elaborate_Body;
+
    type Generator is limited private;
    --  No need for Stream attributes for this type.
    --  Use Save, Reset and Big_Integer instead.
============================================================
--- gmp/gnu_multiple_precision.adb	be62a7dd80161397aaaaab286a08639684a1ef15
+++ gmp/gnu_multiple_precision.adb	c71d1da40339d63b36b29490689d9d07076683e4
@@ -121,6 +121,7 @@ package body GNU_Multiple_Precision is
       Mpf_Init2 (Item.Value, Prec);
       Mpf_Set_Z (Item.Value, Z);
       Mpz_Clear (Z);
+      pragma Unreferenced (Z);
       if Exp >= 0 then
          Mpf_Mul_2exp (Item.Value, Item.Value, unsigned_long (Exp));
       else
@@ -140,6 +141,7 @@ package body GNU_Multiple_Precision is
       Mpf_Init2 (F, Prec);
       unsigned_long'Write (Stream, Prec);
       Mpf_Get_D_2exp (D, Exp, Item.Value);
+      pragma Unreferenced (D);
       Exp := Exp - long (Prec);
       long'Write (Stream, Exp);
       if Exp >= 0 then
@@ -151,7 +153,9 @@ package body GNU_Multiple_Precision is
       Mpz_Set_F (Z, F);
       Mpz_T'Write (Stream, Z);
       Mpf_Clear (F);
+      pragma Unreferenced (F);
       Mpz_Clear (Z);
+      pragma Unreferenced (Z);
    end Write;

    --     overriding procedure Initialize (Object : in out Big_Float_Rounded)
============================================================
--- gmp/gnu_multiple_precision.ads	9ebb5bc1d47f4cf14b9d21486cc198da662ee473
+++ gmp/gnu_multiple_precision.ads	fb0e2a8ec3f86799c1eeb57c85299b7c1f9436a6
@@ -21,6 +21,8 @@ package GNU_Multiple_Precision is

 package GNU_Multiple_Precision is

+   pragma Preelaborate;
+
    subtype Bit_Count is Interfaces.C.unsigned_long;
    subtype A_Sign is Integer range -1 .. 1;