std C/C++ patch #9

Eddie Kohler kohler at icir.org
Mon Apr 29 13:48:14 EDT 2002


Hi Scott,

> Considering the above, and that KCC, Sun CC, and g++ on Solaris all
> generate #pragma-free code satisfying your sizeof criteria (category
> 1, below) for ether, ip, etc.,

Really?!?

This would imply that

     click_ether e[2];
     assert(((uint8_t *)(e + 1)) != ((uint8_t *)e + sizeof(click_ether)));

which would really weird me out. (Presumably the click_ether structures are
laid out with 2 bytes of padding, so ((uint8_t*)(e + 1) - (uint8_t*)e) == 16.
But you're saying that sizeof(click_ether) == 14.)

Eddie



More information about the click mailing list