Re: [PATCH] Re: 'make' warning
[email protected] (Nicholas Clark)
| Newsgroups | perl.perl5.porters |
|---|---|
| Message-ID | <[email protected]> |
On Mon, Jun 07, 2010 at 05:11:36PM -0400, Jerry D. Hedden wrote: > Attached patch fixes this. > > On Mon, Jun 7, 2010 at 14:42, Jerry D. Hedden <[email protected]> wrote: > > Warning during 'make': > > > > `sh  cflags "optimize='-Os -pipe -funit-at-a-time -march=pentium4 > > -mfpmath=sse -mieee-fp -mmmx -msse -msse2'" utf8.o`  utf8.c > >      CCCMD =  gcc -DPERL_CORE -c -DPERL_USE_SAFE_PUTENV > > -U__STRICT_ANSI__ -DNO_MATHOMS -fno-strict-aliasing -pipe  -Os -pipe > > -funit-at-a-time -march=pentium4 -mfpmath=sse -mieee-fp -mmmx -msse > > -msse2 -Wall -W -Wextra -Wdeclaration-after-statement -Wendif-labels > > utf8.c: In function `Perl_foldEQ_utf8': > > utf8.c:2591: warning: empty body in an else-statement > > utf8.c:2598: warning: empty body in an else-statement Good catch. Thanks for the proposed patch, but I think the code would be clearer if the warnings are silenced by using a { } block rather than the pre-processor. Does the appended patch also silence the warnings on your system? Nicholas Clark diff --git a/utf8.c b/utf8.c index 1f4192f..53085e6 100644 --- a/utf8.c +++ b/utf8.c @@ -2588,14 +2588,18 @@ Perl_foldEQ_utf8(pTHX_ const char *s1, char **pe1, register UV l1, bool u1, cons * only go as far as the goal */ e1 = g1; } - else assert(e1); /* Must have an end for looking at s1 */ + else { + assert(e1); /* Must have an end for looking at s1 */ + } /* Same for goal for s2 */ if (g2) { assert(! e2 || e2 >= g2); e2 = g2; } - else assert(e2); + else { + assert(e2); + } /* Look through both strings, a character at a time */ while (p1 < e1 && p2 < e2) {