[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] ignore-value: new module
From: |
Jim Meyering |
Subject: |
Re: [PATCH] ignore-value: new module |
Date: |
Fri, 17 Oct 2008 10:53:04 +0200 |
Paolo Bonzini <address@hidden> wrote:
> Jim Meyering wrote:
>> Paolo Bonzini <address@hidden> wrote:
>>> Jim Meyering wrote:
>>>> I wanted to ignore some new warnings in coreutils,
>>>> but a "(void)" cast no longer does the job with the latest gcc
>>>> and libc headers.
>>> Do you have a reduced testcase?
>>
>> No, but I will add one.
>
> I meant a testcase for (void) not doing its job.
Sure. Just change the above to use "(void)" in place
of the call to ignore_value:
$ cat in.c
int f (void) __attribute__ ((__warn_unused_result__));
void g (void) { (void) f (); }
$ gcc -Werror -c in.c
cc1: warnings being treated as errors
in.c: In function 'g':
in.c:2: error: ignoring return value of 'f', declared with attribute
warn_unused_result
- [PATCH] ignore-value: new module, Jim Meyering, 2008/10/17
- Re: [PATCH] ignore-value: new module, Paolo Bonzini, 2008/10/17
- Re: [PATCH] ignore-value: new module, Jim Meyering, 2008/10/17
- pragma GCC diagnostic, Bruno Haible, 2008/10/17
- Re: pragma GCC diagnostic, Manuel López-Ibáñez, 2008/10/17
- Re: pragma GCC diagnostic, Jim Meyering, 2008/10/17
- Re: pragma GCC diagnostic, Jim Meyering, 2008/10/17
- Re: [PATCH] ignore-value: new module, Paolo Bonzini, 2008/10/17
- Re: [PATCH] ignore-value: new module, Jim Meyering, 2008/10/17
Re: [PATCH] ignore-value: new module, Jim Meyering, 2008/10/17
Re: [PATCH] ignore-value: new module, Bruno Haible, 2008/10/17