[En-Nut-Discussion] SVN compilation fix: lanc111.c

Thiago A. Corrêa thiago.correa at gmail.com
Mon Oct 5 18:46:22 CEST 2009


Hi,


On Mon, Oct 5, 2009 at 1:34 PM, Uwe Bonnes
<bon at elektron.ikp.physik.tu-darmstadt.de> wrote:
> -        if (*((uint32_t *) (ifn->if_mac)) && *((uint32_t *) (ifn->if_mac)) != 0xFFFFFFFFUL) {
> +      uint32_t test_NULL = 0UL;
> +      uint32_t test_MAX = 0xFFFFFFFFUL;
> +
> +      if ((memcmp(ifn->if_mac, &test_NULL, 4)) && (memcmp(ifn->if_mac, &test_MAX, 4))) {
>             break;


This was quite valid code. A bit ugly, maybe, but it wouldn't reserve
memory just for the sake of knowing if mac address is different than 0
or all bits 1. Perhaps we are using more strict compile flags than we
should?

Kind Regards,
    Thiago A. Correa



More information about the En-Nut-Discussion mailing list