From: Eric Botcazou Date: Wed, 27 Jan 2021 06:58:17 +0000 (+0100) Subject: [Ada] Fix type mismatch warnings during LTO bootstrap #1 X-Git-Tag: basepoints/gcc-13~7712 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b0ba442b047dcffd54055c9d0ab591d020a284d8;p=thirdparty%2Fgcc.git [Ada] Fix type mismatch warnings during LTO bootstrap #1 gcc/ada/ * errout.ads (Set_Identifier_Casing): Add pragma Convention C. * eval_fat.ads (Rounding_Mode): Likewise. (Machine): Add WARNING comment line. * exp_code.ads (Clobber_Get_Next): Add pragma Convention C. * fe.h (Compiler_Abort): Fix return type. (Set_Identifier_Casing): Change type of parameters. (Clobber_Get_Next): Change return type. * gcc-interface/trans.c (gnat_to_gnu) : Add cast. --- diff --git a/gcc/ada/errout.ads b/gcc/ada/errout.ads index baec3a74b917..e91c0c5f603f 100644 --- a/gcc/ada/errout.ads +++ b/gcc/ada/errout.ads @@ -987,6 +987,7 @@ package Errout is procedure Set_Identifier_Casing (Identifier_Name : System.Address; File_Name : System.Address); + pragma Convention (C, Set_Identifier_Casing); -- This subprogram can be used by the back end for the purposes of -- concocting error messages that are not output via Errout, e.g. -- the messages generated by the gcc back end. diff --git a/gcc/ada/eval_fat.ads b/gcc/ada/eval_fat.ads index 08e6185eaca1..4947d74b3500 100644 --- a/gcc/ada/eval_fat.ads +++ b/gcc/ada/eval_fat.ads @@ -85,8 +85,8 @@ package Eval_Fat is type Rounding_Mode is (Floor, Ceiling, Round, Round_Even); for Rounding_Mode use (0, 1, 2, 3); + pragma Convention (C, Rounding_Mode); -- Used to indicate rounding mode for Machine attribute - -- Note that C code in gigi knows that Round_Even is 3 -- The Machine attribute is special, in that it takes an extra argument -- indicating the rounding mode, and also an argument Enode that is a @@ -99,6 +99,8 @@ package Eval_Fat is Mode : Rounding_Mode; Enode : Node_Id) return T; + -- WARNING: There is a matching C declaration of this function in urealp.h + procedure Decompose_Int (RT : R; X : T; diff --git a/gcc/ada/exp_code.ads b/gcc/ada/exp_code.ads index 2e37a539499d..474eafc479ec 100644 --- a/gcc/ada/exp_code.ads +++ b/gcc/ada/exp_code.ads @@ -53,6 +53,7 @@ package Exp_Code is -- with subsequent calls to Clobber_Get_Next. function Clobber_Get_Next return System.Address; + pragma Convention (C, Clobber_Get_Next); -- Can only be called after a previous call to Clobber_Setup. The -- returned value is a pointer to a null terminated (C format) string -- for the next register argument. Null_Address is returned when there diff --git a/gcc/ada/fe.h b/gcc/ada/fe.h index 9c4a5723f52b..851e4b3687da 100644 --- a/gcc/ada/fe.h +++ b/gcc/ada/fe.h @@ -55,7 +55,7 @@ extern Nat Serious_Errors_Detected; #define Compiler_Abort comperr__compiler_abort -extern int Compiler_Abort (String_Pointer, String_Pointer, Boolean) ATTRIBUTE_NORETURN; +extern void Compiler_Abort (String_Pointer, String_Pointer, Boolean) ATTRIBUTE_NORETURN; /* debug: */ @@ -103,7 +103,7 @@ extern Node_Id Get_Attribute_Definition_Clause (Entity_Id, unsigned char); extern void Error_Msg_N (String_Pointer, Node_Id); extern void Error_Msg_NE (String_Pointer, Node_Id, Entity_Id); -extern void Set_Identifier_Casing (Char *, const Char *); +extern void Set_Identifier_Casing (void *, const void *); /* err_vars: */ @@ -145,7 +145,7 @@ extern Node_Id Asm_Input_Value (void); extern Node_Id Asm_Output_Constraint (void); extern Node_Id Asm_Output_Variable (void); extern Node_Id Asm_Template (Node_Id); -extern char *Clobber_Get_Next (void); +extern void *Clobber_Get_Next (void); extern void Clobber_Setup (Node_Id); extern Boolean Is_Asm_Volatile (Node_Id); extern void Next_Asm_Input (void); diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c index 61a9d6185a62..719cdec817c6 100644 --- a/gcc/ada/gcc-interface/trans.c +++ b/gcc/ada/gcc-interface/trans.c @@ -7993,7 +7993,7 @@ gnat_to_gnu (Node_Id gnat_node) } Clobber_Setup (gnat_node); - while ((clobber = Clobber_Get_Next ())) + while ((clobber = (char *) Clobber_Get_Next ())) gnu_clobbers = tree_cons (NULL_TREE, build_string (strlen (clobber) + 1, clobber),