From a5835f304466352bf180d851591df6975dcb42b8 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Tue, 28 Apr 2020 20:51:51 +0200 Subject: [Ada] Remove second warning for convention C_Variadic_n 2020-06-19 Eric Botcazou gcc/ada/ * sem_prag.adb (Process_Convention): Revert previous change. --- gcc/ada/sem_prag.adb | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'gcc/ada') diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index e9cfb13..b3d128b 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -8304,7 +8304,8 @@ package body Sem_Prag is ("??C_Variadic_0 cannot be used for an 'I'S'O C function", Get_Pragma_Arg (Arg2)); - -- Now check the number of parameters of the subprogram + -- Now check the number of parameters of the subprogram and give + -- an error if it is lower than n. elsif Present (Subp) then declare @@ -8323,21 +8324,11 @@ package body Sem_Prag is Next_Formal (Formal); end loop; - -- Error out if the number of parameters is lower than n - if Count < Minimum then Error_Msg_Uint_1 := UI_From_Int (Minimum); Error_Pragma_Arg ("argument of pragma% must have at least" & "^ parameters", Arg2); - - -- But warn if it is exactly n because this is useless - - elsif Count = Minimum then - Error_Msg_Uint_1 := UI_From_Int (Minimum + 1); - Error_Msg_N - ("??subprogram should have at least ^ parameters", - Get_Pragma_Arg (Arg2)); end if; end; end if; -- cgit v1.1