[Python-Dev] cpython (3.2): Avoid the compiler warning about the unused return value.

Benjamin Peterson benjamin at python.org
Sat Jan 21 23:53:17 CET 2012


2012/1/21 Stefan Krah <stefan at bytereef.org>:
> Benjamin Peterson <benjamin at python.org> wrote:
>> > Can't that give you another warning about the ssize_t being truncated to
>> > int?
>> > How about the following instead?
>> >
>> >   (void) write(...);
>>
>> Also, if you use a recent enough version of gcc, ./configure will
>> disable the warning. I would prefer if stop using these kinds of
>> hacks.
>
> Do you mean (void)write(...)? Many people think this is good practice,
> since it indicates to the reader that the return value is deliberately
> ignored.

Not doing anything with it seems fairly deliberate to me.



-- 
Regards,
Benjamin


More information about the Python-Dev mailing list