Re: [PATCH 1/6] New function null_stream

Yao Qi
2017-01-18T14:45:31Z

On 17-01-17 07:49:07, Luis Machado wrote:
> >
> >+struct ui_file *
> >+null_stream (void)
> >+{
> >+ static struct ui_file *stream = NULL;
> >+
> >+ if (stream == NULL)
> >+ {
> >+ stream = ui_file_new ();
> >+ make_final_cleanup (do_ui_file_delete, stream);
> >+ }
>
> Since we're explicitly setting stream to NULL, we will always
> execute the conditional block, so it is not needed. Unless this is
> supposed to reuse a stream, but in that case the code would be
> incorrect.
>

It is a reused null stream. Different parts of gdb can use it. Why
is it incorrect?

--
Yao (é½å°§)