This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch ada]: Fix bootstrap for Ada
2011/5/24 Arnaud Charlet <charlet@adacore.com>:
>> > 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 :-)
>>
>> No, static vars are implicitly zero initialized when not explicitly
>> initialized.
>
> Hmm I see. Still, the above code is not easy to read IMO.
>
> I'd suggest instead the following which is easier to read and understand:
>
> __gnat_to_canonical_file_list_next (void)
> {
> ?static char empty[] = "";
> ?return empty;
> }
>
> That's actually a change I was about to commit since we've done it recently
> at AdaCore, so OK with the above variant.
>
> Arno
Ok applied patch as you suggested at revision 174185. Not sure that
sure if this is more readable, but anyway.
Regards,
Kai