From: Eric Botcazou Date: Tue, 28 Apr 2020 18:51:51 +0000 (+0200) Subject: [Ada] Remove second warning for convention C_Variadic_n X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a5835f304466352bf180d851591df6975dcb42b8;p=gcc.git [Ada] Remove second warning for convention C_Variadic_n 2020-06-19 Eric Botcazou gcc/ada/ * sem_prag.adb (Process_Convention): Revert previous change. --- diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index e9cfb13a830..b3d128b37b3 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;