+2004-01-15 Olivier Hainque <hainque@act-europe.fr>
+
+ * decl.c (gnat_to_gnu_entity, E_Variable): Retrieve the object size
+ also when not defining if a Size clause applies. That information is
+ not to be ignored.
+
+2004-01-15 Arnaud Charlet <charlet@act-europe.fr>
+
+ * Makefile.in (install-gnatlib, gnatlib-shared-default): Set up
+ symbolic links for the shared gnat run time when needed.
+
+2004-01-15 Vasiliy Fofanov <fofanov@act-europe.fr>
+
+ * memtrack.adb (Gmem_Initialize): check that gmem.out could be opened
+ for writing, and terminate with an error message if not.
+
+2004-01-15 Ed Schonberg <schonberg@gnat.com>
+
+ * sem_attr.adb (Resolve_Attribute, case 'Access): Remove spurious
+ warning on an access to subprogram in an instance, when the target
+ type is declared in the same generic unit.
+ (Eval_Attribute): If 'access is known to fail accessibility check,
+ rewrite as a raise statement.
+
+2004-01-15 GNAT Script <nobody@gnat.com>
+
+ * Make-lang.in: Makefile automatically updated
+
2004-01-15 Kelley Cook <kcook@gcc.gnu.org>
* Make-lang.in (ada.srcextra): Dummy entry.
ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads ada/uintp.adb \
ada/uname.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
-ada/memtrack.o : ada/ada.ads ada/a-except.ads ada/system.ads \
- ada/s-memory.ads ada/memtrack.adb ada/s-soflin.ads ada/s-stache.ads \
- ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-traceb.ads \
- ada/s-traent.ads ada/s-traent.adb ada/unchconv.ads
+ada/memtrack.o : ada/ada.ads ada/a-except.ads ada/gnat.ads ada/g-io.ads \
+ ada/system.ads ada/s-memory.ads ada/memtrack.adb ada/s-soflin.ads \
+ ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
+ ada/s-traceb.ads ada/s-traent.ads ada/s-traent.adb ada/unchconv.ads
ada/namet.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/debug.ads \
ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
# of $(INSTALL_DATA). The latter may force a mode inappropriate
# for shared libraries on some targets, e.g. on HP-UX where the x
# permission is required.
-ifeq ($(strip $(filter-out alpha% dec vms% openvms% alphavms%,$(targ))),)
- -for file in rts/lib*$(soext);do \
- $(INSTALL) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
+ for file in gnat gnarl; do \
+ if [ -f rts/lib$$file-$(LIBRARY_VERSION)$(soext) ]; then \
+ $(INSTALL) rts/lib$$file-$(LIBRARY_VERSION)$(soext) \
+ $(ADA_RTL_OBJ_DIR); \
+ fi; \
+ if [ -f rts/lib$$file$(soext) ]; then \
+ $(LN_S) lib$$file-$(LIBRARY_VERSION)$(soext) \
+ $(ADA_RTL_OBJ_DIR)/lib$$file$(soext); \
+ fi; \
done
-else
- -for file in rts/lib*-*$(soext);do \
- $(INSTALL) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
- done
-endif
# This copy must be done preserving the date on the original file.
for file in rts/*.adb rts/*.ads; do \
$(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_INCLUDE_DIR); \
-o libgnarl-$(LIBRARY_VERSION)$(soext) \
$(GNATRTL_TASKING_OBJS) \
$(SO_OPTS)libgnarl-$(LIBRARY_VERSION)$(soext) $(THREADSLIB)
+ cd rts; $(LN_S) libgnat-$(LIBRARY_VERSION)$(soext) libgnat$(soext)
+ cd rts; $(LN_S) libgnarl-$(LIBRARY_VERSION)$(soext) libgnarl$(soext)
gnatlib-shared-dual:
$(MAKE) $(FLAGS_TO_PASS) \
* *
* C Implementation File *
* *
- * Copyright (C) 1992-2003, Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2004, Free Software Foundation, Inc. *
* *
* GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- *
}
/* If we are defining the object, see if it has a Size value and
- validate it if so. Then get the new type, if any. */
+ validate it if so. If we are not defining the object and a Size
+ clause applies, simply retrieve the value. We don't want to ignore
+ the clause and it is expected to have been validated already. Then
+ get the new type, if any. */
if (definition)
gnu_size = validate_size (Esize (gnat_entity), gnu_type,
gnat_entity, VAR_DECL, 0,
Has_Size_Clause (gnat_entity));
+ else if (Has_Size_Clause (gnat_entity))
+ gnu_size = UI_To_gnu (Esize (gnat_entity), bitsizetype);
if (gnu_size != 0)
{
-- --
-- B o d y --
-- --
--- Copyright (C) 2001-2003 Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2004 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
with System.Soft_Links;
with System.Traceback;
with System.Traceback_Entries;
+with GNAT.IO;
package body System.Memory is
use System.Soft_Links;
use System.Traceback;
use System.Traceback_Entries;
+ use GNAT.IO;
function c_malloc (Size : size_t) return System.Address;
pragma Import (C, c_malloc, "malloc");
(Ptr : System.Address; Size : size_t) return System.Address;
pragma Import (C, c_realloc, "realloc");
- type File_Ptr is new System.Address;
+ subtype File_Ptr is System.Address;
function fopen (Path : String; Mode : String) return File_Ptr;
pragma Import (C, fopen);
+ procedure OS_Exit (Status : Integer);
+ pragma Import (C, OS_Exit, "__gnat_os_exit");
+ pragma No_Return (OS_Exit);
+
procedure fwrite
(Ptr : System.Address;
Size : size_t;
if Needs_Init then
Needs_Init := False;
Gmemfile := fopen (Gmemfname, "wb" & ASCII.NUL);
+ if Gmemfile = System.Null_Address then
+ Put_Line ("Couldn't open gnatmem log file for writing");
+ OS_Exit (255);
+ end if;
fwrite ("GMEM DUMP" & ASCII.LF, 10, 1, Gmemfile);
end if;
end Gmem_Initialize;
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2003, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2004, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
Compile_Time_Known_Attribute (N, Alignment (P_Entity));
return;
+ -- If this is an access attribute that is known to fail accessibility
+ -- check, rewrite accordingly.
+
+ elsif Attribute_Name (N) = Name_Access
+ and then Raises_Constraint_Error (N)
+ then
+ Rewrite (N,
+ Make_Raise_Program_Error (Loc,
+ Reason => PE_Accessibility_Check_Failed));
+ Set_Etype (N, C_Type);
+ return;
+
-- No other cases are foldable (they certainly aren't static, and at
-- the moment we don't try to fold any cases other than these three).
null; -- Nothing to check
-- Check the static accessibility rule of 3.10.2(32)
+ -- In an instance body, if subprogram and type are both
+ -- local, other rules prevent dangling references, and no
+ -- warning is needed.
elsif Attr_Id = Attribute_Access
and then Subprogram_Access_Level (Entity (P))
Error_Msg_N
("subprogram must not be deeper than access type",
P);
- else
+
+ elsif Scope (Entity (P)) /= Scope (Btyp) then
Error_Msg_N
("subprogram must not be deeper than access type?",
P);
-- Check the restriction of 3.10.2(32) that disallows
-- the type of the access attribute to be declared
- -- outside a generic body when the attribute occurs
+ -- outside a generic body when the subprogram is declared
-- within that generic body.
elsif Enclosing_Generic_Body (Entity (P))