This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH v2] gcov: Runtime configurable destination output
- From: Nathan Sidwell <nathan at acm dot org>
- To: Aaron Conole <aconole at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Jan Hubicka <hubicka at ucw dot cz>, Nathan Sidwell <nathan at codesourcery dot com>
- Date: Thu, 19 May 2016 19:17:18 -0400
- Subject: Re: [PATCH v2] gcov: Runtime configurable destination output
- Authentication-results: sourceware.org; auth=none
- References: <1456350732-8272-1-git-send-email-aconole at bytheb dot org> <df966285-a4fe-34f8-6643-92d1d4c37048 at acm dot org> <f7th9dt7uxw dot fsf at redhat dot com>
On 05/19/16 14:40, Aaron Conole wrote:
Nathan Sidwell <nathan@acm.org> 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