-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2006, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2007, 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 Exp_Tss; use Exp_Tss;
with Exp_Util; use Exp_Util;
with Lib; use Lib;
+with Namet; use Namet;
with Nlists; use Nlists;
with Nmake; use Nmake;
with Opt; use Opt;
("static string required for tag name!", Nam);
end if;
- Set_Has_External_Tag_Rep_Clause (U_Ent);
+ if VM_Target = No_VM then
+ Set_Has_External_Tag_Rep_Clause (U_Ent);
+ else
+ Error_Msg_Name_1 := Attr;
+ Error_Msg_N
+ ("% attribute unsupported in this configuration", Nam);
+ end if;
end External_Tag;
-----------
-- type Q is access Float;
-- for Q'Storage_Size use T'Storage_Size; -- incorrect
- if Base_Type (T) = RTE (RE_Stack_Bounded_Pool) then
- Error_Msg_N ("non-sharable internal Pool", Expr);
+ if RTE_Available (RE_Stack_Bounded_Pool)
+ and then Base_Type (T) = RTE (RE_Stack_Bounded_Pool)
+ then
+ Error_Msg_N ("non-shareable internal Pool", Expr);
return;
end if;
Size : constant Uint := Static_Integer (Expr);
begin
+ if Ada_Version <= Ada_95 then
+ Check_Restriction (No_Implementation_Attributes, N);
+ end if;
+
if Has_Stream_Size_Clause (U_Ent) then
Error_Msg_N ("Stream_Size already given for &", Nam);
-- that the back-end can compute and back-annotate properly the
-- size and alignment of types that may include this record.
+ -- This seems dubious, this destroys the source tree in a manner
+ -- not detectable by ASIS ???
+
if Operating_Mode = Check_Semantics
and then ASIS_Mode
then
return;
end if;
- -- If a tag is present, then create a component clause that places
- -- it at the start of the record (otherwise gigi may place it after
- -- other fields that have rep clauses).
+ -- If a tag is present, then create a component clause that places it
+ -- at the start of the record (otherwise gigi may place it after other
+ -- fields that have rep clauses).
Fent := First_Entity (Rectype);
Next_Component_Or_Discriminant (Comp);
end loop;
+
+ -- If no Complete_Representation pragma, warn if missing components
+
+ elsif Warn_On_Unrepped_Components
+ and then not Warnings_Off (Rectype)
+ then
+ declare
+ Num_Repped_Components : Nat := 0;
+ Num_Unrepped_Components : Nat := 0;
+
+ begin
+ -- First count number of repped and unrepped components
+
+ Comp := First_Component_Or_Discriminant (Rectype);
+ while Present (Comp) loop
+ if Present (Component_Clause (Comp)) then
+ Num_Repped_Components := Num_Repped_Components + 1;
+ else
+ Num_Unrepped_Components := Num_Unrepped_Components + 1;
+ end if;
+
+ Next_Component_Or_Discriminant (Comp);
+ end loop;
+
+ -- We are only interested in the case where there is at least one
+ -- unrepped component, and at least half the components have rep
+ -- clauses. We figure that if less than half have them, then the
+ -- partial rep clause is really intentional.
+
+ if Num_Unrepped_Components > 0
+ and then Num_Unrepped_Components < Num_Repped_Components
+ then
+ Comp := First_Component_Or_Discriminant (Rectype);
+ while Present (Comp) loop
+ if No (Component_Clause (Comp)) then
+ Error_Msg_Sloc := Sloc (Comp);
+ Error_Msg_NE
+ ("?no component clause given for & declared #",
+ N, Comp);
+ end if;
+
+ Next_Component_Or_Discriminant (Comp);
+ end loop;
+ end if;
+ end;
end if;
end Analyze_Record_Representation_Clause;
Specification => Build_Spec);
-- For a tagged type, there is always a visible declaration for each
- -- stream TSS (it is a predefined primitive operation), and the for the
+ -- stream TSS (it is a predefined primitive operation), and the
-- completion of this declaration occurs at the freeze point, which is
-- not always visible at places where the attribute definition clause is
-- visible. So, we create a dummy entity here for the purpose of
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2006, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2007, 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 Hostparm;
-with Namet; use Namet;
-with Opt; use Opt;
-with Osint; use Osint;
-with Output; use Output;
+with Targparm; use Targparm;
+with Namet; use Namet;
+with Opt; use Opt;
+with Osint; use Osint;
+with Output; use Output;
+
with System.WCh_Con; use System.WCh_Con;
procedure Usage is
-- than 5 characters, the maximum allowed, Write_Switch_Char will
-- always output exactly 12 characters.
+ -----------------------
+ -- Write_Switch_Char --
+ -----------------------
+
procedure Write_Switch_Char (Sw : String; Prefix : String := "gnat") is
begin
Write_Str (" -");
Write_Eol;
- -- Common GCC switches not available in JGNAT
+ -- Common GCC switches not available in JGNAT/MGNAT
- if not Hostparm.Java_VM then
+ if VM_Target = No_VM then
Write_Switch_Char ("fstack-check ", "");
Write_Line ("Generate stack checking code");
"(not multiple of small)");
Write_Line (" c turn on warnings for constant conditional");
Write_Line (" C* turn off warnings for constant conditional");
+ Write_Line (" .c turn on warnings for unrepped components");
+ Write_Line (" .C* turn off warnings for unrepped components");
Write_Line (" d turn on warnings for implicit dereference");
Write_Line (" D* turn off warnings for implicit dereference");
Write_Line (" e treat all warnings as errors");
Write_Line (" n* normal warning mode (cancels -gnatws/-gnatwe)");
Write_Line (" o* turn on warnings for address clause overlay");
Write_Line (" O turn off warnings for address clause overlay");
- Write_Line (" p turn on warnings for ineffective pragma Inline");
- Write_Line (" P* turn off warnings for ineffective pragma Inline");
+ Write_Line (" p turn on warnings for ineffective pragma " &
+ "Inline in frontend");
+ Write_Line (" P* turn off warnings for ineffective pragma " &
+ "Inline in frontend");
Write_Line (" q* turn on warnings for questionable " &
"missing parentheses");
Write_Line (" Q turn off warnings for questionable " &
"missing parentheses");
Write_Line (" r turn on warnings for redundant construct");
Write_Line (" R* turn off warnings for redundant construct");
+ Write_Line (" .r turn on warnings for object renaming function");
+ Write_Line (" .R* turn off warnings for object renaming function");
Write_Line (" s suppress all warnings");
Write_Line (" t turn on warnings for tracking deleted code");
Write_Line (" T* turn off warnings for tracking deleted code");
Write_Line (" d check no DOS line terminators");
Write_Line (" e check end/exit labels present");
Write_Line (" f check no form feeds/vertical tabs in source");
+ Write_Line (" g check standard GNAT style rules");
Write_Line (" h check no horizontal tabs in source");
Write_Line (" i check if-then layout");
Write_Line (" I check mode in");