This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] AI-362


Tested on i686-linux, committed on mainline.

This set of patches implements AI-362, which turned out to be tricky.
See www.ada-auth.org/cgi-bin/cvsweb.cgi/AIs/AI-00362.TXT?rev=1.9.
This AI recategorizes several packages in the run-time library
(pragma Preelaborate where no categorization was present before,
and pragma Pure, where previously we had pragma Preelaborate).
The difficulties are two fold, first these changes apply only
in Ada 2005 mode. Second, in pure Ada terms, the run-time units
do not obey the necessary restrictions and it would be virtually
impossible to fix this.

So we do three things. First, the pragma Preelaborate_05 and Pure_05
are introduced, usable only in GNAT mode, that are effective only
in Ada 2005 mode.

Second if GNAT_Mode is true, various error messages about violations
of categorization rules become warnings instead of errors. This turned
out to be more tricky than it might have been, since surprisingly it
was not the case that predefined units that are with'ed were always
compiled with GNAT_Mode set true. The fix to Sem corrects this which
seems right in any case.

Third, pragma Warnings (Off) statements are strategically placed in
various run time units so that the categorization violations that
appear in Ada 2005 mode are ignored. This is OK, since we can do
anything we want in the run-time library (consider that it can be
written in any language, and we choose to write it in Ada! which is
like Ada but does not worry so much about categorization problems).

The following test program compiles quietly in Ada 2005 mode

with Ada.Strings.Maps;
with Ada.Characters.Handling;
with Ada.Strings.Maps.Constants;
with System;
with System.Storage_Elements;
package T is
   pragma Pure (T);
end T;

More extensive tests will be in the new ACATS suite

2005-06-14  Robert Dewar  <dewar@adacore.com>

	* system-unixware.ads, system-linux-ia64.ads, system-freebsd-x86.ads,
	system-lynxos-ppc.ads, system-lynxos-x86.ads, system-linux-x86_64.ads,
	system-tru64.ads, system-aix.ads, system-vxworks-sparcv9.ads,
	system-vxworks-xscale.ads, system-solaris-x86.ads, system-irix-o32.ads,
	system-irix-n32.ads, system-hpux.ads, system-vxworks-m68k.ads,
	system-linux-x86.ads, system-vxworks-mips.ads, system-vxworks-mips.ads,
	system-os2.ads, system-interix.ads, system-solaris-sparc.ads,
	system-solaris-sparcv9.ads, system-vms.ads, system-mingw.ads,
	system-vms-zcx.ads, system-vxworks-ppc.ads, system.ads,
	system-darwin-ppc.ads, system-vxworks-x86.ads, system-linux-ppc.ads,
	system-linux-hppa.ads, system-vms_64.ads,
	system-vxworks-alpha.ads: Minor comment update for
	AI-362 (unit is Pure).

	* a-chahan.ads, a-chahan.adb: Move Wide_Wide functions to Conversions
	Add pragma Pure_05 for AI-362
	Make remaining conversion functions obsolescent in Ada 95

	* impunit.adb: Change a-swunha to a-swuwha and a-szunha to a-szuzha
	Make Ada.Wide_Characters[.Unicode] available in Ada 95 mode
	Add entries for a-wichun and a-zchuni
	Add a-widcha a-zchara for AI-395
	Add a-chacon (Ada.Characters.Conversions) to list of Ada 2005 routines

	* Makefile.rtl: Change a-swunha to a-swuwha and a-szunha to a-szuzha
	Add entries for a-wichun.o and a-zchuni.o
	Entries for a-widcha.o and a-zchara.o
	Add entry for a-chacon.o

	* a-ztenau.adb: Add with of Ada.Characters.Conversions

	* a-chacon.ads, a-chacon.adb: New files.

	* a-taside.adb, a-exstat.adb, a-excach.adb: Add warnings off to allow
	categorization violations.

	* a-strmap.ads: Add pragma Pure_05 for AI-362
	* a-strmap.ads: Add note on implicit categorization for AI-362

	* a-tgdico.ads, a-taside.ads: Add pragma Preelaborate_05 for AI-362

	* par-prag.adb: Dummy entry for pragma Persistent_BSS
	Set Ada_Version_Explicit, for implementation of AI-362
	Add processing for pragma Pure_05 and Preelaborate_05
	Add entry for Assertion_Policy pragma

	* sem.adb: Make sure predefined units are compiled with GNAT_Mode true
	when needed for proper processing of categorization stuff

	* sem_cat.adb: 
	For several cases, make errors in preealborate units warnings,
	instead of errors, if GNAT_Mode is set. For AI-362.

	* sem_elab.adb (Check_Elab_Call): Call to non-static subprogram in
	preelaborate unit is now warning if in GNAT mode

	* s-stoele.ads: Document AI-362 for pragma preelaborate

Attachment: difs.5
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]