summaryrefslogtreecommitdiff
path: root/gcc/ada/freeze.adb
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-12-02 07:31:39 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-12-02 07:31:39 +0000
commit47c16a8cec2c48947e6d85683f5f916777ccc169 (patch)
tree3a8bf827ae1df7e637a2a4ede4dba5f0421ac0d2 /gcc/ada/freeze.adb
parentb27941d363b11d115e30a9676e61c8536a12adf7 (diff)
downloadgcc-47c16a8cec2c48947e6d85683f5f916777ccc169.tar.gz
2009-12-02 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 154895 {after more plugin events from ICI folks} git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@154896 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/freeze.adb')
-rw-r--r--gcc/ada/freeze.adb35
1 files changed, 28 insertions, 7 deletions
diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb
index 85206f7ae8b..7f0f7863824 100644
--- a/gcc/ada/freeze.adb
+++ b/gcc/ada/freeze.adb
@@ -2535,6 +2535,8 @@ package body Freeze is
and then not Has_Warnings_Off (F_Type)
and then not Has_Warnings_Off (Formal)
then
+ -- Qualify mention of formals with subprogram name
+
Error_Msg_Qual_Level := 1;
-- Check suspicious use of fat C pointer
@@ -2543,8 +2545,8 @@ package body Freeze is
and then Esize (F_Type) > Ttypes.System_Address_Size
then
Error_Msg_N
- ("?type of & does not correspond "
- & "to C pointer!", Formal);
+ ("?type of & does not correspond to C pointer!",
+ Formal);
-- Check suspicious return of boolean
@@ -2552,10 +2554,13 @@ package body Freeze is
and then Convention (F_Type) = Convention_Ada
and then not Has_Warnings_Off (F_Type)
and then not Has_Size_Clause (F_Type)
+ and then VM_Target = No_VM
then
Error_Msg_N
- ("?& is an 8-bit Ada Boolean, "
- & "use char in C!", Formal);
+ ("& is an 8-bit Ada Boolean?", Formal);
+ Error_Msg_N
+ ("\use appropriate corresponding type in C "
+ & "(e.g. char)?", Formal);
-- Check suspicious tagged type
@@ -2584,6 +2589,8 @@ package body Freeze is
Formal, F_Type);
end if;
+ -- Turn off name qualification after message output
+
Error_Msg_Qual_Level := 0;
end if;
@@ -2595,6 +2602,11 @@ package body Freeze is
and then Is_Array_Type (F_Type)
and then not Is_Constrained (F_Type)
and then Warn_On_Export_Import
+
+ -- Exclude VM case, since both .NET and JVM can handle
+ -- unconstrained arrays without a problem.
+
+ and then VM_Target = No_VM
then
Error_Msg_Qual_Level := 1;
@@ -2676,13 +2688,22 @@ package body Freeze is
elsif Root_Type (R_Type) = Standard_Boolean
and then Convention (R_Type) = Convention_Ada
+ and then VM_Target = No_VM
and then not Has_Warnings_Off (E)
and then not Has_Warnings_Off (R_Type)
and then not Has_Size_Clause (R_Type)
then
- Error_Msg_N
- ("?return type of & is an 8-bit "
- & "Ada Boolean, use char in C!", E);
+ declare
+ N : constant Node_Id :=
+ Result_Definition (Declaration_Node (E));
+ begin
+ Error_Msg_NE
+ ("return type of & is an 8-bit Ada Boolean?",
+ N, E);
+ Error_Msg_NE
+ ("\use appropriate corresponding type in C "
+ & "(e.g. char)?", N, E);
+ end;
-- Check suspicious return tagged type