In article <cak4o1wwm2txkpdo_dhdmw-wxii_nlf+dypzc6turtdmz+-5...@mail.gmail.com>, Justin Cormack <[email protected]> wrote: >On 28 February 2015 at 11:17, Patrick Welche <[email protected]> wrote: >> The surprise is that when building rump, gcc complains with: >> >> >> /usr/src/sys/rump/net/lib/libnet/../../../../net/route.c:1010:21: >error: initializer element is not constant >> static const struct in_addr inmask32 = {.s_addr = INADDR_BROADCAST}; >> ^ >> /usr/src/sys/rump/net/lib/libnet/../../../../net/route.c:1010:21: >error: (near initialization for 'inmask32.s_addr') >> >> >> which certainly looks constant. Problem is that INADDR_BROADCAST may >> contain a call to htonl(), e.g. try > >> Given that 0xffffffff is the same in either order, there is an obvious >> kludge, but any thoughts on an elegant solution? > >Hmm, I hadnt seen that. Maybe define an HTONL macro that uses shifts >and masks ifdef little endian so it is all done at compile time?
Are you trying to compile without optimization? christos
