[prev in list] [next in list] [prev in thread] [next in thread] 

List:       perl6-internals
Subject:    Pay attention to your compiler warnings
From:       Andy Lester <andy () petdance ! com>
Date:       2010-08-17 15:42:41
Message-ID: 28F6CBF8-C10F-4111-9204-013FDAB00FCA () petdance ! com
[Download RAW message or body]


Here's a swell little bug that GCC came across today:

src/string/primitives.c: In function ‘INTVAL Parrot_char_digit_value(Parrot_Interp, \
UINTVAL)’: src/string/primitives.c:332:50: warning: logical ‘or’ of collectively \
exhaustive tests is always true [-Wlogical-op]

The offending code:

    if ((character >= 0x30) || (character <= 0x39))
        return character - 0x30;

That || should have been an &&.  As written, it is always true.

I know that the compiler warnings are often a nuisance, and we can be tempted to Just \
Make Them Shut Up, but there's often good diagnostic information in there as well.

xoxo,
Andy

--
Andy Lester => andy@petdance.com => www.theworkinggeek.com => AIM:petdance




_______________________________________________
http://lists.parrot.org/mailman/listinfo/parrot-dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic