From: Ian Lance Taylor <iant@golang.org>
To: Uros Bizjak <ubizjak@gmail.com>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH, libiberty]: Avoid "enum conversion when passing argument 1 of ‘getrusage’ is invalid in C++" warning
Date: Thu, 09 Jul 2015 14:32:00 -0000 [thread overview]
Message-ID: <CAKOQZ8ysmEsqWjJBeYccW8W6OC0Oev+jGxWwZV+1+ja_nnpBEw@mail.gmail.com> (raw)
In-Reply-To: <CAFULd4Zk=Rva-Yrwi9QQ-hBEAeeS6aW_HGXUZxMTiYkbs1m8kg@mail.gmail.com>
On Thu, Jul 9, 2015 at 7:15 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
> On Thu, Jul 9, 2015 at 3:00 PM, Ian Lance Taylor <iant@golang.org> wrote:
>> On Wed, Jul 1, 2015 at 3:07 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
>>>
>>> This patch avoids "enum conversion when passing argument 1 of
>>> ‘getrusage’ is invalid in C++" warning when compiling getruntime.c.
>>> The condition is copied from sys/resource.h.
>>
>> Sorry, I've been on vacation.
>>
>> I think it would be a lot nicer to always use RUSAGE_SELF in the
>> function, and earlier in the file write
>>
>> #ifndef RUSAGE_SELF
>> #define RUSAGE_SELF 0
>> #endif
>
> Indeed, attached patch builds without warning.
>
> 2015-07-09 Uros Bizjak <ubizjak@gmail.com>
>
> * getruntime.c (RUSAGE_SELF): Define if not already defined.
> (get_runtime): Use RUSAGE_SELF as argument 1 of getrusage call.
>
> Bootstrapped on x86_64-linux-gnu.
>
> OK for mainline SVN?
This is OK. Thanks for following up.
Ian
prev parent reply other threads:[~2015-07-09 14:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-01 10:07 Uros Bizjak
2015-07-08 7:06 ` Uros Bizjak
2015-07-09 13:00 ` Ian Lance Taylor
2015-07-09 14:15 ` Uros Bizjak
2015-07-09 14:32 ` Ian Lance Taylor [this message]
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=CAKOQZ8ysmEsqWjJBeYccW8W6OC0Oev+jGxWwZV+1+ja_nnpBEw@mail.gmail.com \
--to=iant@golang.org \
--cc=gcc-patches@gcc.gnu.org \
--cc=ubizjak@gmail.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).