> > 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