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

Harald Kipp harald.kipp at egnite.de
Sun Oct 18 19:22:51 CEST 2009


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

I insist on -Werror. Do we want to end up like binutils, where warnings
are used to show compile progress? ;-)

To Uwe: Almost all drivers use

for (;;) {
  int i;

  for (i = 0; i < sizeof(ifn->if_mac); i++) {
    if (ifn->if_mac[i] && ifn->if_mac[i] != 0xFF) {
      break;
    }
  }
  if (i < sizeof(ifn->if_mac)) {
    break;
  }
  NutSleep(63);
}

which is more complete and may even require less code on 8-bit targets.

I'll add this one.

Harald




More information about the En-Nut-Discussion mailing list