Commit 1b31321b by Arnaud Charlet

[multiple changes]

2014-02-24  Robert Dewar  <dewar@adacore.com>

	* a-direct.adb, sem_ch5.adb, a-cfdlli.adb, a-cfhase.adb, a-tags.adb,
	s-filatt.ads, a-cforma.adb, sem_ch6.adb, g-socthi-mingw.adb,
	a-cfhama.adb, a-cforse.adb, a-cofove.adb: Minor reformatting and code
	reorganization.

2014-02-24  Thomas Quinot  <quinot@adacore.com>

	* Make-generated.in (OSCONS_CPP, OSCONS_EXTRACT): Make sure
	that the source directory containing s-oscons-tmplt.c is on the
	include path, so that all internal header files are available.

From-SVN: r208081
parent 28108618
2014-02-24 Robert Dewar <dewar@adacore.com>
* a-direct.adb, sem_ch5.adb, a-cfdlli.adb, a-cfhase.adb, a-tags.adb,
s-filatt.ads, a-cforma.adb, sem_ch6.adb, g-socthi-mingw.adb,
a-cfhama.adb, a-cforse.adb, a-cofove.adb: Minor reformatting and code
reorganization.
2014-02-24 Thomas Quinot <quinot@adacore.com>
* Make-generated.in (OSCONS_CPP, OSCONS_EXTRACT): Make sure
that the source directory containing s-oscons-tmplt.c is on the
include path, so that all internal header files are available.
2014-02-24 Ed Schonberg <schonberg@adacore.com> 2014-02-24 Ed Schonberg <schonberg@adacore.com>
* sem_ch5.adb (Analyze_Loop_Parameter_Specification): If the * sem_ch5.adb (Analyze_Loop_Parameter_Specification): If the
......
...@@ -68,26 +68,30 @@ $(ADA_GEN_SUBDIR)/stamp-nmake: $(ADA_GEN_SUBDIR)/sinfo.ads $(ADA_GEN_SUBDIR)/nma ...@@ -68,26 +68,30 @@ $(ADA_GEN_SUBDIR)/stamp-nmake: $(ADA_GEN_SUBDIR)/sinfo.ads $(ADA_GEN_SUBDIR)/nma
# GCC_FOR_TARGET has paths relative to the gcc directory, so we need to adjust # GCC_FOR_TARGET has paths relative to the gcc directory, so we need to adjust
# for running it from $(ADA_GEN_SUBDIR)/bldtools/oscons # for running it from $(ADA_GEN_SUBDIR)/bldtools/oscons
OSCONS_CC=`echo "$(GCC_FOR_TARGET)" \ OSCONS_CC=$(subst ./xgcc,../../../xgcc,$(subst -B./, -B../../../,$(GCC_FOR_TARGET)))
| sed -e 's^\./xgcc^../../../xgcc^' -e 's^-B./^-B../../../^'` OSCONS_SRCDIR=$${_oscons_srcdir}
OSCONS_CPP=$(OSCONS_CC) $(GNATLIBCFLAGS) -E -C \ OSCONS_CPP=$(OSCONS_CC) $(GNATLIBCFLAGS) -E -C \
-DTARGET=\"$(target)\" s-oscons-tmplt.c > s-oscons-tmplt.i -DTARGET=\"$(target)\" -I$(OSCONS_SRCDIR) s-oscons-tmplt.c > s-oscons-tmplt.i
OSCONS_EXTRACT=$(OSCONS_CC) -S s-oscons-tmplt.i OSCONS_EXTRACT=$(OSCONS_CC) -I$(OSCONS_SRCDIR) -S s-oscons-tmplt.i
# Note: if you need to build with a non-GNU compiler, you could adapt the # Note: if you need to build with a non-GNU compiler, you could adapt the
# following definitions (written for VMS DEC-C) # following definitions (written for VMS DEC-C)
#OSCONS_CPP=../../../$(DECC) -E /comment=as_is -DNATIVE \ #OSCONS_CPP=../../../$(DECC) -E /comment=as_is -DNATIVE \
# -DTARGET='""$(target)""' s-oscons-tmplt.c # -DTARGET='""$(target)""' -I$(OSCONS_SRCDIR) s-oscons-tmplt.c
# #
#OSCONS_EXTRACT=../../../$(DECC) -DNATIVE \ #OSCONS_EXTRACT=../../../$(DECC) -DNATIVE \
# -DTARGET='""$(target)""' s-oscons-tmplt.c ; \ # -DTARGET='""$(target)""' -I$(OSCONS_SRCDIR) s-oscons-tmplt.c ; \
# ld -o s-oscons-tmplt.exe s-oscons-tmplt.obj; \ # ld -o s-oscons-tmplt.exe s-oscons-tmplt.obj; \
# ./s-oscons-tmplt.exe > s-oscons-tmplt.s # ./s-oscons-tmplt.exe > s-oscons-tmplt.s
$(ADA_GEN_SUBDIR)/s-oscons.ads : $(ADA_GEN_SUBDIR)/s-oscons-tmplt.c $(ADA_GEN_SUBDIR)/gsocket.h $(ADA_GEN_SUBDIR)/adaint.h $(ADA_GEN_SUBDIR)/xoscons.adb $(ADA_GEN_SUBDIR)/xutil.ads $(ADA_GEN_SUBDIR)/xutil.adb # Note: the first dependency of s-oscons.ads *must* remain s-oscons-tmplt.c, as
# we use $(<D) to locate the main ada/ source directory and pass it to OSCONS_CPP
# as a -I argument.
$(ADA_GEN_SUBDIR)/s-oscons.ads : $(ADA_GEN_SUBDIR)/s-oscons-tmplt.c $(ADA_GEN_SUBDIR)/xoscons.adb $(ADA_GEN_SUBDIR)/xutil.ads $(ADA_GEN_SUBDIR)/xutil.adb
-$(MKDIR) $(ADA_GEN_SUBDIR)/bldtools/oscons -$(MKDIR) $(ADA_GEN_SUBDIR)/bldtools/oscons
$(RM) $(addprefix $(ADA_GEN_SUBDIR)/bldtools/oscons/,$(notdir $^)) $(RM) $(addprefix $(ADA_GEN_SUBDIR)/bldtools/oscons/,$(notdir $^))
$(CP) $^ $(ADA_GEN_SUBDIR)/bldtools/oscons $(CP) $^ $(ADA_GEN_SUBDIR)/bldtools/oscons
_oscons_srcdir=`cd $(<D) && pwd` ; \
(cd $(ADA_GEN_SUBDIR)/bldtools/oscons ; gnatmake -q xoscons ; \ (cd $(ADA_GEN_SUBDIR)/bldtools/oscons ; gnatmake -q xoscons ; \
$(RM) s-oscons-tmplt.i s-oscons-tmplt.s ; \ $(RM) s-oscons-tmplt.i s-oscons-tmplt.s ; \
$(OSCONS_CPP) ; \ $(OSCONS_CPP) ; \
......
...@@ -507,7 +507,8 @@ package body Ada.Containers.Formal_Doubly_Linked_Lists is ...@@ -507,7 +507,8 @@ package body Ada.Containers.Formal_Doubly_Linked_Lists is
function First_To_Previous function First_To_Previous
(Container : List; (Container : List;
Current : Cursor) return List is Current : Cursor) return List
is
Curs : Cursor := Current; Curs : Cursor := Current;
C : List (Container.Capacity) := Copy (Container, Container.Capacity); C : List (Container.Capacity) := Copy (Container, Container.Capacity);
Node : Count_Type; Node : Count_Type;
...@@ -515,19 +516,19 @@ package body Ada.Containers.Formal_Doubly_Linked_Lists is ...@@ -515,19 +516,19 @@ package body Ada.Containers.Formal_Doubly_Linked_Lists is
begin begin
if Curs = No_Element then if Curs = No_Element then
return C; return C;
end if;
if not Has_Element (Container, Curs) then elsif not Has_Element (Container, Curs) then
raise Constraint_Error; raise Constraint_Error;
end if;
while Curs.Node /= 0 loop else
Node := Curs.Node; while Curs.Node /= 0 loop
Delete (C, Curs); Node := Curs.Node;
Curs := Next (Container, (Node => Node)); Delete (C, Curs);
end loop; Curs := Next (Container, (Node => Node));
end loop;
return C; return C;
end if;
end First_To_Previous; end First_To_Previous;
---------- ----------
...@@ -907,6 +908,7 @@ package body Ada.Containers.Formal_Doubly_Linked_Lists is ...@@ -907,6 +908,7 @@ package body Ada.Containers.Formal_Doubly_Linked_Lists is
if Container.Last = 0 then if Container.Last = 0 then
return No_Element; return No_Element;
end if; end if;
return (Node => Container.Last); return (Node => Container.Last);
end Last; end Last;
...@@ -1192,16 +1194,18 @@ package body Ada.Containers.Formal_Doubly_Linked_Lists is ...@@ -1192,16 +1194,18 @@ package body Ada.Containers.Formal_Doubly_Linked_Lists is
if Container.Length = 0 then if Container.Length = 0 then
return No_Element; return No_Element;
end if;
while CFirst /= 0 loop else
if Container.Nodes (CFirst).Element = Item then while CFirst /= 0 loop
return (Node => CFirst); if Container.Nodes (CFirst).Element = Item then
end if; return (Node => CFirst);
CFirst := Container.Nodes (CFirst).Prev; else
end loop; CFirst := Container.Nodes (CFirst).Prev;
end if;
end loop;
return No_Element; return No_Element;
end if;
end Reverse_Find; end Reverse_Find;
------------ ------------
......
...@@ -242,26 +242,26 @@ package body Ada.Containers.Formal_Hashed_Maps is ...@@ -242,26 +242,26 @@ package body Ada.Containers.Formal_Hashed_Maps is
function Current_To_Last (Container : Map; Current : Cursor) return Map is function Current_To_Last (Container : Map; Current : Cursor) return Map is
Curs : Cursor := First (Container); Curs : Cursor := First (Container);
C : Map (Container.Capacity, Container.Modulus) := C : Map (Container.Capacity, Container.Modulus) :=
Copy (Container, Container.Capacity); Copy (Container, Container.Capacity);
Node : Count_Type; Node : Count_Type;
begin begin
if Curs = No_Element then if Curs = No_Element then
Clear (C); Clear (C);
return C; return C;
end if;
if Current /= No_Element and not Has_Element (Container, Current) then elsif Current /= No_Element and not Has_Element (Container, Current) then
raise Constraint_Error; raise Constraint_Error;
end if;
while Curs.Node /= Current.Node loop else
Node := Curs.Node; while Curs.Node /= Current.Node loop
Delete (C, Curs); Node := Curs.Node;
Curs := Next (Container, (Node => Node)); Delete (C, Curs);
end loop; Curs := Next (Container, (Node => Node));
end loop;
return C; return C;
end if;
end Current_To_Last; end Current_To_Last;
--------------------- ---------------------
...@@ -467,7 +467,7 @@ package body Ada.Containers.Formal_Hashed_Maps is ...@@ -467,7 +467,7 @@ package body Ada.Containers.Formal_Hashed_Maps is
Current : Cursor) return Map is Current : Cursor) return Map is
Curs : Cursor; Curs : Cursor;
C : Map (Container.Capacity, Container.Modulus) := C : Map (Container.Capacity, Container.Modulus) :=
Copy (Container, Container.Capacity); Copy (Container, Container.Capacity);
Node : Count_Type; Node : Count_Type;
begin begin
...@@ -475,19 +475,19 @@ package body Ada.Containers.Formal_Hashed_Maps is ...@@ -475,19 +475,19 @@ package body Ada.Containers.Formal_Hashed_Maps is
if Curs = No_Element then if Curs = No_Element then
return C; return C;
end if;
if not Has_Element (Container, Curs) then elsif not Has_Element (Container, Curs) then
raise Constraint_Error; raise Constraint_Error;
end if;
while Curs.Node /= 0 loop else
Node := Curs.Node; while Curs.Node /= 0 loop
Delete (C, Curs); Node := Curs.Node;
Curs := Next (Container, (Node => Node)); Delete (C, Curs);
end loop; Curs := Next (Container, (Node => Node));
end loop;
return C; return C;
end if;
end First_To_Previous; end First_To_Previous;
---------- ----------
......
...@@ -268,26 +268,26 @@ package body Ada.Containers.Formal_Hashed_Sets is ...@@ -268,26 +268,26 @@ package body Ada.Containers.Formal_Hashed_Sets is
function Current_To_Last (Container : Set; Current : Cursor) return Set is function Current_To_Last (Container : Set; Current : Cursor) return Set is
Curs : Cursor := First (Container); Curs : Cursor := First (Container);
C : Set (Container.Capacity, Container.Modulus) := C : Set (Container.Capacity, Container.Modulus) :=
Copy (Container, Container.Capacity); Copy (Container, Container.Capacity);
Node : Count_Type; Node : Count_Type;
begin begin
if Curs = No_Element then if Curs = No_Element then
Clear (C); Clear (C);
return C; return C;
end if;
if Current /= No_Element and not Has_Element (Container, Current) then elsif Current /= No_Element and not Has_Element (Container, Current) then
raise Constraint_Error; raise Constraint_Error;
end if;
while Curs.Node /= Current.Node loop else
Node := Curs.Node; while Curs.Node /= Current.Node loop
Delete (C, Curs); Node := Curs.Node;
Curs := Next (Container, (Node => Node)); Delete (C, Curs);
end loop; Curs := Next (Container, (Node => Node));
end loop;
return C; return C;
end if;
end Current_To_Last; end Current_To_Last;
--------------------- ---------------------
...@@ -661,28 +661,29 @@ package body Ada.Containers.Formal_Hashed_Sets is ...@@ -661,28 +661,29 @@ package body Ada.Containers.Formal_Hashed_Sets is
function First_To_Previous function First_To_Previous
(Container : Set; (Container : Set;
Current : Cursor) return Set is Current : Cursor) return Set
is
Curs : Cursor := Current; Curs : Cursor := Current;
C : Set (Container.Capacity, Container.Modulus) := C : Set (Container.Capacity, Container.Modulus) :=
Copy (Container, Container.Capacity); Copy (Container, Container.Capacity);
Node : Count_Type; Node : Count_Type;
begin begin
if Curs = No_Element then if Curs = No_Element then
return C; return C;
end if;
if not Has_Element (Container, Curs) then elsif not Has_Element (Container, Curs) then
raise Constraint_Error; raise Constraint_Error;
end if;
while Curs.Node /= 0 loop else
Node := Curs.Node; while Curs.Node /= 0 loop
Delete (C, Curs); Node := Curs.Node;
Curs := Next (Container, (Node => Node)); Delete (C, Curs);
end loop; Curs := Next (Container, (Node => Node));
end loop;
return C; return C;
end if;
end First_To_Previous; end First_To_Previous;
---------- ----------
......
...@@ -336,18 +336,18 @@ package body Ada.Containers.Formal_Ordered_Maps is ...@@ -336,18 +336,18 @@ package body Ada.Containers.Formal_Ordered_Maps is
Clear (C); Clear (C);
return C; return C;
end if; elsif Current /= No_Element and not Has_Element (Container, Current) then
if Current /= No_Element and not Has_Element (Container, Current) then
raise Constraint_Error; raise Constraint_Error;
end if;
while Curs.Node /= Current.Node loop else
Node := Curs.Node; while Curs.Node /= Current.Node loop
Delete (C, Curs); Node := Curs.Node;
Curs := Next (Container, (Node => Node)); Delete (C, Curs);
end loop; Curs := Next (Container, (Node => Node));
end loop;
return C; return C;
end if;
end Current_To_Last; end Current_To_Last;
------------ ------------
...@@ -524,7 +524,8 @@ package body Ada.Containers.Formal_Ordered_Maps is ...@@ -524,7 +524,8 @@ package body Ada.Containers.Formal_Ordered_Maps is
function First_To_Previous function First_To_Previous
(Container : Map; (Container : Map;
Current : Cursor) return Map is Current : Cursor) return Map
is
Curs : Cursor := Current; Curs : Cursor := Current;
C : Map (Container.Capacity) := Copy (Container, Container.Capacity); C : Map (Container.Capacity) := Copy (Container, Container.Capacity);
Node : Count_Type; Node : Count_Type;
...@@ -532,19 +533,19 @@ package body Ada.Containers.Formal_Ordered_Maps is ...@@ -532,19 +533,19 @@ package body Ada.Containers.Formal_Ordered_Maps is
begin begin
if Curs = No_Element then if Curs = No_Element then
return C; return C;
end if;
if not Has_Element (Container, Curs) then elsif not Has_Element (Container, Curs) then
raise Constraint_Error; raise Constraint_Error;
end if;
while Curs.Node /= 0 loop else
Node := Curs.Node; while Curs.Node /= 0 loop
Delete (C, Curs); Node := Curs.Node;
Curs := Next (Container, (Node => Node)); Delete (C, Curs);
end loop; Curs := Next (Container, (Node => Node));
end loop;
return C; return C;
end if;
end First_To_Previous; end First_To_Previous;
----------- -----------
......
...@@ -600,7 +600,8 @@ package body Ada.Containers.Formal_Ordered_Sets is ...@@ -600,7 +600,8 @@ package body Ada.Containers.Formal_Ordered_Sets is
function First_To_Previous function First_To_Previous
(Container : Set; (Container : Set;
Current : Cursor) return Set is Current : Cursor) return Set
is
Curs : Cursor := Current; Curs : Cursor := Current;
C : Set (Container.Capacity) := Copy (Container, Container.Capacity); C : Set (Container.Capacity) := Copy (Container, Container.Capacity);
Node : Count_Type; Node : Count_Type;
...@@ -608,19 +609,19 @@ package body Ada.Containers.Formal_Ordered_Sets is ...@@ -608,19 +609,19 @@ package body Ada.Containers.Formal_Ordered_Sets is
begin begin
if Curs = No_Element then if Curs = No_Element then
return C; return C;
end if;
if not Has_Element (Container, Curs) then elsif not Has_Element (Container, Curs) then
raise Constraint_Error; raise Constraint_Error;
end if;
while Curs.Node /= 0 loop else
Node := Curs.Node; while Curs.Node /= 0 loop
Delete (C, Curs); Node := Curs.Node;
Curs := Next (Container, (Node => Node)); Delete (C, Curs);
end loop; Curs := Next (Container, (Node => Node));
end loop;
return C; return C;
end if;
end First_To_Previous; end First_To_Previous;
----------- -----------
......
...@@ -319,24 +319,25 @@ package body Ada.Containers.Formal_Vectors is ...@@ -319,24 +319,25 @@ package body Ada.Containers.Formal_Vectors is
function Current_To_Last function Current_To_Last
(Container : Vector; (Container : Vector;
Current : Cursor) return Vector is Current : Cursor) return Vector
is
C : Vector (Container.Capacity) := Copy (Container, Container.Capacity); C : Vector (Container.Capacity) := Copy (Container, Container.Capacity);
begin begin
if Current = No_Element then if Current = No_Element then
Clear (C); Clear (C);
return C; return C;
end if;
if not Has_Element (Container, Current) then elsif not Has_Element (Container, Current) then
raise Constraint_Error; raise Constraint_Error;
end if;
while C.Last /= Container.Last - Current.Index + 1 loop else
Delete_First (C); while C.Last /= Container.Last - Current.Index + 1 loop
end loop; Delete_First (C);
end loop;
return C; return C;
end if;
end Current_To_Last; end Current_To_Last;
------------ ------------
...@@ -610,22 +611,24 @@ package body Ada.Containers.Formal_Vectors is ...@@ -610,22 +611,24 @@ package body Ada.Containers.Formal_Vectors is
function First_To_Previous function First_To_Previous
(Container : Vector; (Container : Vector;
Current : Cursor) return Vector is Current : Cursor) return Vector
is
C : Vector (Container.Capacity) := Copy (Container, Container.Capacity); C : Vector (Container.Capacity) := Copy (Container, Container.Capacity);
begin begin
if Current = No_Element then if Current = No_Element then
return C; return C;
end if;
if not Has_Element (Container, Current) then elsif not Has_Element (Container, Current) then
raise Constraint_Error; raise Constraint_Error;
end if;
while C.Last /= Current.Index - 1 loop else
Delete_Last (C); while C.Last /= Current.Index - 1 loop
end loop; Delete_Last (C);
return C; end loop;
return C;
end if;
end First_To_Previous; end First_To_Previous;
--------------------- ---------------------
......
...@@ -759,10 +759,11 @@ package body Ada.Directories is ...@@ -759,10 +759,11 @@ package body Ada.Directories is
if Match (Name (1 .. Last), Search.Value.Pattern) then if Match (Name (1 .. Last), Search.Value.Pattern) then
declare declare
C_Full_Name : constant String := C_Full_Name : constant String :=
Compose (To_String (Search.Value.Name), Name (1 .. Last)) Compose (To_String (Search.Value.Name),
& ASCII.NUL; Name (1 .. Last)) & ASCII.NUL;
Full_Name : String renames C_Full_Name Full_Name : String renames
(C_Full_Name'First .. C_Full_Name'Last - 1); C_Full_Name
(C_Full_Name'First .. C_Full_Name'Last - 1);
Found : Boolean := False; Found : Boolean := False;
Attr : aliased File_Attributes; Attr : aliased File_Attributes;
Exists : Integer; Exists : Integer;
......
...@@ -283,9 +283,9 @@ package body Ada.Tags is ...@@ -283,9 +283,9 @@ package body Ada.Tags is
procedure Set_HT_Link (T : Tag; Next : Tag) is procedure Set_HT_Link (T : Tag; Next : Tag) is
TSD_Ptr : constant Addr_Ptr := TSD_Ptr : constant Addr_Ptr :=
To_Addr_Ptr (To_Address (T) - DT_Typeinfo_Ptr_Size); To_Addr_Ptr (To_Address (T) - DT_Typeinfo_Ptr_Size);
TSD : constant Type_Specific_Data_Ptr := TSD : constant Type_Specific_Data_Ptr :=
To_Type_Specific_Data_Ptr (TSD_Ptr.all); To_Type_Specific_Data_Ptr (TSD_Ptr.all);
begin begin
TSD.HT_Link.all := Next; TSD.HT_Link.all := Next;
end Set_HT_Link; end Set_HT_Link;
...@@ -309,8 +309,9 @@ package body Ada.Tags is ...@@ -309,8 +309,9 @@ package body Ada.Tags is
T : Tag; T : Tag;
E_Tag_Len : constant Integer := E_Tag_Len : constant Integer :=
Integer (strlen (TSD.External_Tag.all'Address)); Integer (strlen (TSD.External_Tag.all'Address));
E_Tag : String (1 .. E_Tag_Len);
E_Tag : String (1 .. E_Tag_Len);
for E_Tag'Address use TSD.External_Tag.all'Address; for E_Tag'Address use TSD.External_Tag.all'Address;
pragma Import (Ada, E_Tag); pragma Import (Ada, E_Tag);
...@@ -344,13 +345,12 @@ package body Ada.Tags is ...@@ -344,13 +345,12 @@ package body Ada.Tags is
function Descendant_Tag (External : String; Ancestor : Tag) return Tag is function Descendant_Tag (External : String; Ancestor : Tag) return Tag is
Int_Tag : constant Tag := Internal_Tag (External); Int_Tag : constant Tag := Internal_Tag (External);
begin begin
if not Is_Descendant_At_Same_Level (Int_Tag, Ancestor) then if not Is_Descendant_At_Same_Level (Int_Tag, Ancestor) then
raise Tag_Error; raise Tag_Error;
else
return Int_Tag;
end if; end if;
return Int_Tag;
end Descendant_Tag; end Descendant_Tag;
-------------- --------------
......
...@@ -628,6 +628,7 @@ package body GNAT.Sockets.Thin is ...@@ -628,6 +628,7 @@ package body GNAT.Sockets.Thin is
when others => Errm := N_OTHERS; when others => Errm := N_OTHERS;
end case; end case;
return Value (Errm); return Value (Errm);
end Socket_Error_Message; end Socket_Error_Message;
......
...@@ -39,23 +39,27 @@ package System.File_Attributes is ...@@ -39,23 +39,27 @@ package System.File_Attributes is
type File_Attributes is private; type File_Attributes is private;
procedure Reset_Attributes (A : access File_Attributes); procedure Reset_Attributes (A : access File_Attributes);
function Error_Attributes (A : access File_Attributes) return Integer; function Error_Attributes (A : access File_Attributes) return Integer;
function File_Exists_Attr function File_Exists_Attr
(N : System.Address; (N : System.Address;
A : access File_Attributes) return Integer; A : access File_Attributes) return Integer;
function Is_Regular_File_Attr function Is_Regular_File_Attr
(N : System.Address; (N : System.Address;
A : access File_Attributes) return Integer; A : access File_Attributes) return Integer;
function Is_Directory_Attr function Is_Directory_Attr
(N : System.Address; (N : System.Address;
A : access File_Attributes) return Integer; A : access File_Attributes) return Integer;
private private
package SOSC renames System.OS_Constants; package SOSC renames System.OS_Constants;
type File_Attributes is new System.Storage_Elements.Storage_Array type File_Attributes is new
(1 .. SOSC.SIZEOF_struct_file_attributes); System.Storage_Elements.Storage_Array
(1 .. SOSC.SIZEOF_struct_file_attributes);
for File_Attributes'Alignment use Standard'Maximum_Alignment; for File_Attributes'Alignment use Standard'Maximum_Alignment;
pragma Import (C, Reset_Attributes, "__gnat_reset_attributes"); pragma Import (C, Reset_Attributes, "__gnat_reset_attributes");
......
...@@ -2376,7 +2376,7 @@ package body Sem_Ch5 is ...@@ -2376,7 +2376,7 @@ package body Sem_Ch5 is
or else (Is_Entity_Name (DS_Copy) or else (Is_Entity_Name (DS_Copy)
and then not Is_Type (Entity (DS_Copy))) and then not Is_Type (Entity (DS_Copy)))
or else (Nkind (DS_Copy) = N_Attribute_Reference or else (Nkind (DS_Copy) = N_Attribute_Reference
and then Attribute_Name (DS_Copy) = Name_Old) and then Attribute_Name (DS_Copy) = Name_Old)
then then
-- This is an iterator specification. Rewrite it as such and -- This is an iterator specification. Rewrite it as such and
-- analyze it to capture function calls that may require -- analyze it to capture function calls that may require
......
...@@ -372,11 +372,13 @@ package body Sem_Ch6 is ...@@ -372,11 +372,13 @@ package body Sem_Ch6 is
-- An expression function that is a completion freezes the -- An expression function that is a completion freezes the
-- expression. This means freezing the return type, and if it is -- expression. This means freezing the return type, and if it is
-- an access type, freezing its designated type as well. -- an access type, freezing its designated type as well.
-- Note that we cannot defer this freezing to the analysis of the -- Note that we cannot defer this freezing to the analysis of the
-- expression itself, because a freeze node might appear in a -- expression itself, because a freeze node might appear in a nested
-- nested scope, leading to an elaboration order issue in gigi. -- scope, leading to an elaboration order issue in gigi.
Freeze_Before (N, Etype (Prev)); Freeze_Before (N, Etype (Prev));
if Is_Access_Type (Etype (Prev)) then if Is_Access_Type (Etype (Prev)) then
Freeze_Before (N, Designated_Type (Etype (Prev))); Freeze_Before (N, Designated_Type (Etype (Prev)));
end if; end if;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment