public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Aaron Conole <aconole@redhat.com>
To: Nathan Sidwell <nathan@acm.org>
Cc: gcc-patches@gcc.gnu.org, Jan Hubicka <hubicka@ucw.cz>,
	       Nathan Sidwell <nathan@codesourcery.com>
Subject: Re: [PATCH v2] gcov: Runtime configurable destination output
Date: Thu, 19 May 2016 18:40:00 -0000	[thread overview]
Message-ID: <f7th9dt7uxw.fsf@redhat.com> (raw)
In-Reply-To: <df966285-a4fe-34f8-6643-92d1d4c37048@acm.org> (Nathan Sidwell's	message of "Fri, 6 May 2016 09:18:01 -0400")

Nathan Sidwell <nathan@acm.org> writes:

> On 02/24/16 16:52, Aaron Conole wrote:
>> The previous gcov behavior was to always output errors on the stderr channel.
>> This is fine for most uses, but some programs will require stderr to be
>> untouched by libgcov for certain tests. This change allows configuring
>> the gcov output via an environment variable which will be used to open
>> the appropriate file.
>
> this is ok in principle.  I have a couple of questions & nits below though.

Thank you for the consideration.  I will be submitting a new patch that
I hope fully addresses your comments below, either tomorrow or Monday.

Thanks so much for the review.

> I don't see a previous commit from you -- do you have a copyright
> assignment with the FSF? (although this patch is simple, my guess is
> the idea it implements is sufficiently novel to need one).  We can
> handle that off list.

I'm happy to report that I did send in some FSF paperwork this week.
Hopefully it is on record now, but even if it isn't I live a train ride
away from the FSF headquarters so I'd be happy to take the time to make
sure it's all signed correctly.

>> diff --git a/libgcc/libgcov-driver-system.c b/libgcc/libgcov-driver-system.c
>> index 4e3b244..0eb9755 100644
>> --- a/libgcc/libgcov-driver-system.c
>> +++ b/libgcc/libgcov-driver-system.c
>> @@ -23,6 +23,24 @@ a copy of the GCC Runtime Library Exception along
>> with this program;
>>  see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
>>  <http://www.gnu.org/licenses/>.  */
>>
>> +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.

>> @@ -30,12 +48,27 @@ gcov_error (const char *fmt, ...)
>>  {
>>    int ret;
>>    va_list argp;
>> +
>> +  if (!__gcov_error_file)
>> +    __gcov_error_file = get_gcov_error_file();
>
> Needs space before ()

Ack.

>> +
>>    va_start (argp, fmt);
>> -  ret = vfprintf (stderr, fmt, argp);
>> +  ret = vfprintf (__gcov_error_file, fmt, argp);
>>    va_end (argp);
>>    return ret;
>>  }
>>
>> +#if !IN_GCOV_TOOL
>
> 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.

>> +static void
>> +gcov_error_exit(void)
>> +{
>> +  if (__gcov_error_file && __gcov_error_file != stderr)
>> +    {
>
> Braces are not needed here.

Ack.

>> --- a/libgcc/libgcov-driver.c
>> +++ b/libgcc/libgcov-driver.c
>> @@ -46,6 +46,10 @@ void __gcov_init (struct gcov_info *p
>> __attribute__ ((unused))) {}
>
>> +  gcov_error_exit();
>
> Needs space before ().

Ack.

> nathan

  reply	other threads:[~2016-05-19 18:40 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-24 21:52 Aaron Conole
2016-04-15 19:02 ` Aaron Conole
2016-04-27 20:59 ` Aaron Conole
2016-04-28 13:25   ` Nathan Sidwell
2016-04-29 15:08     ` Aaron Conole
2016-05-04 15:22       ` Nathan Sidwell
2016-05-04 15:25         ` Jan Hubicka
2016-05-06 13:18 ` Nathan Sidwell
2016-05-19 18:40   ` Aaron Conole [this message]
2016-05-19 19:25     ` Jeff Law
2016-05-19 23:14       ` Nathan Sidwell
2016-05-20  1:11         ` Jeff Law
2016-05-19 23:17     ` Nathan Sidwell
2016-05-23 18:16       ` Aaron Conole
2016-06-03 15:00         ` H.J. Lu
2016-06-03 15:31           ` Aaron Conole
2016-06-04 12:12           ` Aaron Conole
2016-06-06 15:25             ` Nathan Sidwell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f7th9dt7uxw.fsf@redhat.com \
    --to=aconole@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hubicka@ucw.cz \
    --cc=nathan@acm.org \
    --cc=nathan@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).