[patch ada]: Fix bootstrap for Ada

Arnaud Charlet charlet@adacore.com
Tue May 24 11:20:00 GMT 2011


> this patch fixes an obvious bootstrap issue caused by trying to assign
> a constant pointer to an none-constant.
> 
> Index: adaint.c
> ===================================================================
> 
> --- adaint.c    (revision 174060)
> +++ adaint.c    (working copy)
> @@ -3367,8 +3367,8 @@
>  char *
>  __gnat_to_canonical_file_list_next (void)
>  {
> -  static char *empty = "";
> -  return empty;
> +  static char empty[1];
> +  return &empty[0];
>  }

I'm confused. The above looks wrong to me: it does not return an empty string,
it returns a pointer to an uninitialized string, which cannot be right (and
should generate a warning :-)

Arno



More information about the Gcc-patches mailing list