[Ada] Remove const qualifier on a couple of pointed-to types

Pierre-Marie de Rodat derodat@adacore.com
Tue Jun 15 10:20:52 GMT 2021


gnat_argv is defined as pointer to const memory in argv.c but declared
and accessed as pointer to mutable memory in rtinit.c, which breaks the
One Definition Rule in C++.  Its initialization is also non-standard.

Tested on x86_64-pc-linux-gnu, committed on trunk

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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 1472 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20210615/4d549812/attachment-0001.bin>


More information about the Gcc-patches mailing list