GNU bug report logs - #9064
coreutils-8.12 compiler warning

Previous Next

Package: coreutils;

Reported by: "Joachim Schmitz" <jojo <at> schmitz-digital.de>

Date: Wed, 13 Jul 2011 07:57:01 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eric Blake <eblake <at> redhat.com>
To: Pádraig Brady <P <at> draigBrady.com>
Cc: Joachim Schmitz <jojo <at> schmitz-digital.de>, 9064 <at> debbugs.gnu.org
Subject: bug#9064: coreutils-8.12 compiler warning
Date: Wed, 13 Jul 2011 07:11:22 -0600
[Message part 1 (text/plain, inline)]
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   eblake <at> redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

[signature.asc (application/pgp-signature, attachment)]

This bug report was last modified 13 years and 313 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.