This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
pp_formline(): add empty body to empty while loop
authorDavid Mitchell <davem@iabyn.com>
Sat, 18 Feb 2017 14:00:56 +0000 (14:00 +0000)
committerDavid Mitchell <davem@iabyn.com>
Sat, 18 Feb 2017 14:00:56 +0000 (14:00 +0000)
my previous commit in this function added a block that happened
to follow directly after a bodiless while loop, i.e. 'while(...);'.
clang spotted this and warned. So add an empty body '{}' after the
while to visually disambiguate it.

pp_ctl.c

index c4c8bcd..44498bc 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -878,7 +878,9 @@ PP(pp_formline)
 
        case FF_NEWLINE: /* delete trailing spaces, then append \n */
            f++;
-           while (t-- > (SvPVX(PL_formtarget) + linemark) && *t == ' ') ;
+           while (t-- > (SvPVX(PL_formtarget) + linemark) && *t == ' ')
+            {}
+
             {
                 STRLEN cur = t - SvPVX_const(PL_formtarget);
                 t = SvGROW(PL_formtarget, cur + 1 + 1) + cur;