]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Remove const qualifier on a couple of pointed-to types
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 8 Feb 2021 11:00:19 +0000 (12:00 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Tue, 15 Jun 2021 10:19:22 +0000 (06:19 -0400)
gcc/ada/

* argv.c: Add include of <stdlib.h> for the runtime.
(gnat_argv): Change type to char ** and initialize to NULL.
(gnat_envp): Likewise.
* argv-lynxos178-raven-cert.c: Add include of <stdlib.h>.
(gnat_argv): Change type to char ** and initialize to NULL.
(gnat_envp): Likewise.

gcc/ada/argv-lynxos178-raven-cert.c
gcc/ada/argv.c

index 64850f163ba1ebb0a6c74b9670ac8e98cde3de9f..21cead39a3e8379eaa5c90dee393bf1ea046e22d 100644 (file)
@@ -41,6 +41,7 @@
    minimal support for Ada.Command_Line.Command_Name */
 
 #include <sys/types.h>
+#include <stdlib.h>
 #include <string.h>
 
 #ifdef __cplusplus
@@ -53,8 +54,8 @@ extern "C" {
    the binder-generated file so they need to be defined here */
 
 int gnat_argc = 0;
-const char **gnat_argv = (const char **) 0;
-const char **gnat_envp = (const char **) 0;
+char **gnat_argv = NULL;
+char **gnat_envp = NULL;
 
 int
 __gnat_len_arg (int arg_num)
index b5ec0df447759966a155530ca3046d423178b9a8..4734415960dbe902116fd2905f26664acade9ee5 100644 (file)
@@ -44,6 +44,7 @@
 
 #ifdef IN_RTS
 #include "runtime.h"
+#include <stdlib.h>
 #include <string.h>
 #else
 #include "config.h"
@@ -60,14 +61,13 @@ extern "C" {
    envp of the main program is saved under gnat_envp.  */
 
 int gnat_argc = 0;
-const char **gnat_argv = (const char **) 0;
-const char **gnat_envp = (const char **) 0;
+char **gnat_argv = NULL;
+char **gnat_envp = NULL;
 
 #if defined (_WIN32) && !defined (RTX)
 /* Note that on Windows environment the environ point to a buffer that could
    be reallocated if needed. It means that gnat_envp needs to be updated
    before using gnat_envp to point to the right environment space */
-#include <stdlib.h>
 /* for the environ variable definition */
 #define gnat_envp (environ)
 #endif