develooper Front page | perl.perl5.porters | Postings from November 2018

[perl #133703] sv.c: Eliminate LGTM warning Comparison result isalways the same

Thread Previous
From:
James E Keenan
Date:
November 29, 2018 20:47
Subject:
[perl #133703] sv.c: Eliminate LGTM warning Comparison result isalways the same
Message ID:
rt-4.0.24-1735-1543524442-800.133703-75-0@perl.org
# New Ticket Created by  James E Keenan 
# Please include the string:  [perl #133703]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=133703 >


This ticket will hold a patch intended to suppress a warning reporting 
by LGTM.com analysis of the Perl 5 core distribution.

The relevant part of sv.c is:

#####
  8486     if (rspara) {       /* have to do this both before and after */
  8487     do {            /* to make sure file boundaries work right */
  8488         if (PerlIO_eof(fp))
  8489         return 0;
  8490         i = PerlIO_getc(fp);
  8491         if (i != '\n') {
  8492         if (i == -1)
  8493             return 0;
  8494         PerlIO_ungetc(fp,i);
  8495         break;
  8496         }
  8497     } while (i != EOF);
  8498     }
#####

Warning: "Comparison result is always the same"
Analysis: 
https://lgtm.com/projects/g/Perl/perl5/alerts/?mode=tree&ruleFocus=2154840804
Warnings rule: https://lgtm.com/rules/2154840804/

I'll attach the patch once I get an RT number.

Thank you very much.
Jim Keenan

Thread Previous


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