develooper Front page | perl.perl5.porters | Postings from September 2017

[perl #132153] perl-5.26.1/doio.c:1529]: (style) Suspiciouscondition

Thread Next
From:
David Binderman
Date:
September 24, 2017 05:45
Subject:
[perl #132153] perl-5.26.1/doio.c:1529]: (style) Suspiciouscondition
Message ID:
rt-4.0.24-28277-1506206587-62.132153-75-0@perl.org
# New Ticket Created by  David Binderman 
# Please include the string:  [perl #132153]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=132153 >


Hello there,


perl-5.26.1/doio.c:1529]: (style) Suspicious condition (assignment + comparison); Clarify expression with parentheses.


Source code is


    if ( (  (SvROK(sv) && (  isGV_with_GP(SvRV(sv))
                          || (isio = SvTYPE(SvRV(sv)) == SVt_PVIO)  )


Maybe better code


    if ( (  (SvROK(sv) && (  isGV_with_GP(SvRV(sv))
                          || ((isio = SvTYPE(SvRV(sv))) == SVt_PVIO)  )


Regards


David Binderman


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About