bug-coreutils
[Top][All Lists]
Advanced

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

bug#9064: coreutils-8.12 compiler warning


From: Eric Blake
Subject: bug#9064: coreutils-8.12 compiler warning
Date: Wed, 13 Jul 2011 07:11:22 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110621 Fedora/3.1.11-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.11

On 07/13/2011 03:05 AM, Pádraig Brady wrote:
> On 13/07/11 08:55, Joachim Schmitz wrote:
>> I found this in mktemp.c, line344 (well, my compiler found it for me and
>> warned about 'possible use of "=" where "==" was intended'):
>>
>>       if (!dry_run && (stdout_closed = true) && close_stream (stdout) != 0)
>>
>> Not sure whether this is bug or feature ;-)
> 
> Well it's a feature.
> We could reorganize but it would add a few more lines.

Does this avoid the warning?

if (!dry_run && ((stdout_closed = true), close_stream (stdout) != 0))

That is, using the comma operator rather than an always-true conditional
since we always want the assignment to occur at that part of the expression?

-- 
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]