On Wed, 2004-03-31 at 14:50, Alex S Moore wrote:
> On Solaris with Sun's compilers and latest CVS source I get the
> following error on configure. I have not seen this error before and I
> have been building clamav with Sun's compiler for many months from the
> released source and occasionally from CVS source.
>
> | int main(int argc, char **argv) {
> | #pragma pack(1) /* has to be in column 1 ! */
> | struct { char c; long l; } s;
> | return sizeof(s)==sizeof(s.c)+sizeof(s.l) ? 0:1;
> }
> configure:11667: result: no
> configure:11677: error: Need to know how to pack structures with this
> compilerHave you changed the compiler version? Which version is it? What architecture are you using (generic, v7, v8, v8a, v8plus, v8plusa, v9, v9a) > > For sparc, there is a #pragma pack(n) directive and (n) has to be a > power of 2, so that may be cause of the error. I am not sure about x86, > but I also need that architecture. n can also be 1. It's probably giving a SIGBUS error when executed. > > What info do I need to supply to get this sorted? I have a section in > the compiler manual regarding '#pragma pack(n)', but it is over my head. > Could you try compiling the attachment, and running it, and noting the output. Then do it again with each of the following compiler flags added, one per re-compile: -xmemalign=1s -xmemalign=8i -xmemalign=2i Cheers, -trog
int main(int argc, char **argv) {
#pragma pack(1)
struct { char c; long l; } s;
if (sizeof(s)==sizeof(s.c)+sizeof(s.l)) {
printf("ok\n");
} else {
printf("not ok\n");
}
}
signature.asc
Description: This is a digitally signed message part
