[BusyBox] compare structs without comparing all the fields ?

Firewall bug1 at optushome.com.au
Sun Apr 21 09:27:03 UTC 2002


On Sat, 20 Apr 2002 15:16:10 -0600
"Manuel Novoa III" <mjn3 at codepoet.org> wrote:

> Glen,
> 

> Since you have some excess uninitialized bits, you shouldn't expect the
> above to work.  Now, if we assume that CHAR_BIT==8 and the compiler
> honors the packed attribute and sizeof(package_version_t)==5, then
> you could do the following and expect your memcmp test to work.
> 

That makes sense now, i may as well just round up the fields to the next
byte.

Thanks for that


Glenn



More information about the busybox mailing list