[gPXE-devel] [PATCH] Some gpxe code issues identified by strict compiler settings

Stefan Hajnoczi stefanha at gmail.com
Fri Apr 2 19:56:16 EDT 2010


On Fri, Apr 2, 2010 at 11:43 PM, Bruce Rogers <brogers at novell.com> wrote:
> In building gpxe for openSUSE Factory (part of kvm package), there were a few problems identified by the compiler.  This patch addresses them.

Is this a specific compiler version or have you customized the
compiler flags?  It would be interesting to know the details so that
we have the option of building in the same way.

> -       ns->cur_rx = ++ns->cur_rx % NR_RX_DESC;

What an odd thing to do :).

> +       ns->cur_rx = ns->cur_rx + 1 % NR_RX_DESC;

I think you mean:
ns->cur_rx = ( ns->cur_rx + 1 ) % NR_RX_DESC;

The '%' operator has higher precedence than '+'.

Stefan


More information about the gPXE-devel mailing list