[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#93481: pragma pack works on x86; ignored on arm



Package: gcc
Version: 1:2.95.3-7
Severity: normal

Pragma pack works as expected on x86, but is ignored on arm (test case at the
end of this mail, verified on rameau.debian.org).  I understand that pragmas
are deprecated in favor of __attribute__, but this breaks quite a bit of
existing code (see, for example, bug #91911).  I think this should at
least be consistent across all platforms supported by Debian.

Thanks,
-Ben

#pragma pack(2)
struct foo {
	short a;
	long b;
};

int main() {
	/* prints 6 on x86, 8 on arm */
	printf("%d\n", sizeof(struct foo));
	return 0;
};

-- System Information
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux bgdarnel 2.4.1 #10 Fri Feb 23 14:57:57 EST 2001 i686

Versions of packages gcc depends on:
ii  cpp                          1:2.95.3-7  The GNU C preprocessor.           
ii  cpp-2.95                     1:2.95.3-10 The GNU C preprocessor.           
ii  gcc-2.95                     1:2.95.3-10 The GNU C compiler.               




Reply to: