Subject: Re: CVS commit: basesrc/usr.bin/file
To: None <tech-userlevel@netbsd.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-userlevel
Date: 06/05/2002 10:11:19
>> have attribute(packed) to struct magic to make it packed in the same
>> way across different archs.

> This works fine with gcc, but the problem is that this code is
> compiled with HOST_CC (to cross-build the magic file using mkmagic).
> HOST_CC may not be gcc, and thus not know the packed attribute.

> So, it most be solved in another way, probably by padding struct file
> in such a way that it's the same on all archs.

That's only a better-guess "solution" (ie, it works on more hosts but
still is not C-guaranteed to work).  If you really want to generate the
same data on all arches, you have to pack and unpack it yourself,
rather than depending on overlaying a struct onto it.

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse@rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B