]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Fix type mismatch warnings during LTO bootstrap #1
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 27 Jan 2021 06:58:17 +0000 (07:58 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Fri, 7 May 2021 09:29:12 +0000 (05:29 -0400)
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) <N_Code_Statement>: Add cast.

gcc/ada/errout.ads
gcc/ada/eval_fat.ads
gcc/ada/exp_code.ads
gcc/ada/fe.h
gcc/ada/gcc-interface/trans.c

index baec3a74b917cd249ca35393fb0bd3663a439fbb..e91c0c5f603f099657ba4c5d0e642bd01f173a05 100644 (file)
@@ -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.
index 08e6185eaca1cd2b6eb4f6618b26d2d855336afd..4947d74b3500eccbc713ff67140df96bd5d25634 100644 (file)
@@ -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;
index 2e37a539499d62235e1c073a39c428538977117f..474eafc479ec30a952d70f92d3e50460ced3fc07 100644 (file)
@@ -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
index 9c4a5723f52b3405d58e0ee8562666b5d76ec885..851e4b3687da661d3ec9158678aaf6957872ee4e 100644 (file)
@@ -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);
index 61a9d6185a6291b877f4e59ff78e32409e6eeea5..719cdec817c6bbc65600e18a9ca03d9891b804d2 100644 (file)
@@ -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),