From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 80550 invoked by alias); 18 Jan 2017 14:45:31 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 80532 invoked by uid 89); 18 Jan 2017 14:45:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=Different, H*i:sk:e8c3537, H*f:sk:e8c3537, H*MI:sk:e8c3537 X-HELO: mail-lf0-f67.google.com Received: from mail-lf0-f67.google.com (HELO mail-lf0-f67.google.com) (209.85.215.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 18 Jan 2017 14:45:25 +0000 Received: by mail-lf0-f67.google.com with SMTP id h65so2049084lfi.3 for ; Wed, 18 Jan 2017 06:45:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=oIMid1M+dZMTClyJpfPy+8vBiUu3orhHWKToYJtuECs=; b=IRHBXFBv5xIbJf09R1e63WlFD0QYnPBSagG4kvDjFO9BJnLVjsaF8Ekm8ew64hSUUI 486qitjempYSHWCCIaOzcYkEC4kXBKalvbcUWWzZBHHQ1aqIo81xI2bpAcmewln6nZW2 Gw3kb3lAIUbVu9c78l6WDI4hwBiAyAIHFVW4dPD2nOuE4FH4NOivLu3m9DpWWFOdfpNS r3zI0ud7tMCEnGgNANdLOvowuW4LDjQpvEkmLhU+jDXdS5rl89eSreU5EIrJOMQ1j+ig PqbDkHSiMmM9ws3jr1rCEVBo4avzpmbS1idLX02wkBRD+jtjccSf24V4M0kgEFnL7Mpd Uzag== X-Gm-Message-State: AIkVDXJbNBjLanaRrITnEXExXkVDtZhmS8yM/eBs3h4iw8/9d9KZW8SjMVp2Girl4ochpA== X-Received: by 10.25.193.21 with SMTP id r21mr1366795lff.103.1484750722765; Wed, 18 Jan 2017 06:45:22 -0800 (PST) Received: from E107787-LIN (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id j87sm313392lfi.25.2017.01.18.06.45.20 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 18 Jan 2017 06:45:22 -0800 (PST) Date: Wed, 18 Jan 2017 14:45:00 -0000 From: Yao Qi To: Luis Machado Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 1/6] New function null_stream Message-ID: <20170118144506.GM28060@E107787-LIN> References: <1484051178-16013-1-git-send-email-yao.qi@linaro.org> <1484560977-8693-1-git-send-email-yao.qi@linaro.org> <1484560977-8693-2-git-send-email-yao.qi@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes X-SW-Source: 2017-01/txt/msg00341.txt.bz2 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 (齐尧)