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

[UDUNITS #SLV-499270]: udunits-2.1.24/lib/xml.c:1576: possible bad if test ?

This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.


  • Subject: [UDUNITS #SLV-499270]: udunits-2.1.24/lib/xml.c:1576: possible bad if test ?
  • Date: Tue, 29 Oct 2013 13:46:14 -0600

David,

Good catch! Thanks.

> Hello there,
> 
> I just compiled udunits-2.1.24 with extra Linux gcc flag -Wlogical-op
> 
> It said
> 
> xml.c:1576:5: warning: logical 'or' of collectively exhaustive tests is 
> always true [-Wlogical-op]
> 
> Source code is
> 
>     if (currFile->context != UNIT_NAME || currFile->context != ALIAS_NAME) {
> 
> Suggest swap || for &&
> 
> Regards
> 
> David Binderman


Regards,
Steve Emmerson

Ticket Details
===================
Ticket ID: SLV-499270
Department: Support UDUNITS
Priority: Normal
Status: Closed