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

Re: disabling warn_unused_result attribute with FORTIFY_SOURCE?



Kevin Kofler <kevin.kofler <at> chello.at> writes:
> What works is:
> int dummy=foo1();
> (void)dummy;
> or:
> static inline __attribute__((always_inline)) int ignore(int x) {return x;}
> ignore(foo1());

Found another way:
__builtin_expect(foo1(),0);
The __builtin_expect hint is of course thrown away because the result is, but 
it gets rid of the warning.

        Kevin Kofler


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