From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10377 invoked by alias); 19 May 2016 23:17:35 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 10334 invoked by uid 89); 19 May 2016 23:17:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=reactivated, pay X-HELO: mail-qg0-f46.google.com Received: from mail-qg0-f46.google.com (HELO mail-qg0-f46.google.com) (209.85.192.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 19 May 2016 23:17:21 +0000 Received: by mail-qg0-f46.google.com with SMTP id f92so52218483qgf.0 for ; Thu, 19 May 2016 16:17:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:to:references:cc:from:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=yUaKLBblGIL593V0G7JRExNxiTAOXPFUq0RKxtHgFRE=; b=I+CzmmXFsyyxfWGHQb6TtV7raJJZbYSt7ppkYLy1OJ6v8c1ihN20ycbpNPQQ9D0lIH UYcT8GyEp13U1B2h2zt9KBoTpdFXgc5caWZt+l4LV7WYDOZnRBaG/uLihNlTII+O0E6K iR8BhkJtkWFNjOVSbnlGdSnDHpp7tMxR6yb4T+v4kwe1OFVc6tjB8KrxVR6tGr6sYwzV aXslVJb94dmemhm92XCKBIyMpxQm/BrdYWkgjCS8I8wsqvVoMAX3cIddiCt/15EXzQ3T Pf7ZbdxZY2UkS/nYGEP0BxlUa2IHot5RFhc6ufUwfoijXRTbE1gjzEZgbhJmaUR0HUfW zJuw== X-Gm-Message-State: AOPr4FV3eKG+2eBGed/G6aUSJtV6B+vOpz8iF5zJME2fcDxU5hXXlfCTcBby02cekf4x2Q== X-Received: by 10.140.87.116 with SMTP id q107mr16442390qgd.61.1463699839854; Thu, 19 May 2016 16:17:19 -0700 (PDT) Received: from ?IPv6:2601:181:c003:1930:a2a8:cdff:fe3e:b48? ([2601:181:c003:1930:a2a8:cdff:fe3e:b48]) by smtp.googlemail.com with ESMTPSA id 1sm7670796qkl.20.2016.05.19.16.17.18 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 19 May 2016 16:17:19 -0700 (PDT) Subject: Re: [PATCH v2] gcov: Runtime configurable destination output To: Aaron Conole References: <1456350732-8272-1-git-send-email-aconole@bytheb.org> Cc: gcc-patches@gcc.gnu.org, Jan Hubicka , Nathan Sidwell From: Nathan Sidwell Message-ID: <8040ea19-7c4f-03ab-ba90-d82b35abcb32@acm.org> Date: Thu, 19 May 2016 23:17:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2016-05/txt/msg01589.txt.bz2 On 05/19/16 14:40, Aaron Conole wrote: > Nathan Sidwell writes: >>> +FILE *__gcov_error_file = NULL; >> >> Unless I'm missing something, isn't this only accessed from this file? >> (So could be static with a non-underbarred name) > > Ack. I have a vague memory that perhaps the __gcov_error_file is seen from other dynamic objects, and one of them gets to open/close it? I think the closing function needs to reset it to NULL though? (In case it's reactivated before the process exits) >> And this protection here, makes me wonder what happens if one is >> IN_GCOV_TOOL. Does it pay attention to GCOV_ERROR_FILE? That would >> seem incorrect, and thus the above should be changed so that stderr is >> unconditionally used when IN_GCOV_TOOL? > > You are correct. I will fix it. thanks. >>> +static void >>> +gcov_error_exit(void) >>> +{ >>> + if (__gcov_error_file && __gcov_error_file != stderr) >>> + { >> >> Braces are not needed here. Unless of course my speculation about setting it to NULL is right. nathan