Re: disabling warn_unused_result attribute with FORTIFY_SOURCE?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Mamoru Tasaka <mtasaka <at> ioa.s.u-tokyo.ac.jp> writes:
> I may be wrong, however, my recognition is that this warning
> cannot be got rid of by casting to void.

You're right, I didn't know that. That's pretty stupid, (void) has always 
meant "I intentionally throw away this value and I mean it". :-/

What works is:
int dummy=foo1();
(void)dummy;
or:
static inline __attribute__((always_inline)) int ignore(int x) {return x;}
ignore(foo1());
but it's annoying you have to go to such lengths. There are always valid 
reasons to ignore a return value. (But don't get me wrong, most often it is NOT 
a good idea to ignore return values. When you're used to programming on 
calculators, where ignoring an error can mean locking up the entire calculator 
on the next instruction and having to press that reset combo once again, you 
quickly learn to always check return values. ;-) You're getting spoiled by high 
quality computer operating systems like Fedora which catch application errors 
properly. ;-) )

        Kevin Kofler

-- 
fedora-devel-list mailing list
fedora-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-devel-list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux