piet@cs.ruu.nl (Piet van Oostrum) (07/13/90)
I am still trying to get the whole scoop on bit-field alignment in the HP-UX cc compiler on HP9000/300. I detected another case where the bit-field was aligned, which is actually more in line with what others do - if there were not a case that I don't understand - struct test { /* char p;*/ int a:14; int b:20; short c:5; } x; This case (with the char p commented out) aligns b on a 2-byte boundary, presumably because it would otherwise cross a 4-byte boundary, although 4-byte boundaries are not special in records. But if the char p is inserted, no padding is done, the field a doesn't even start on a 2-byte boundary. Now I don't understand what the underlying algorithm is. This might even be a bug. -- Piet* van Oostrum, Dept of Computer Science, Utrecht University, Padualaan 14, P.O. Box 80.089, 3508 TB Utrecht, The Netherlands. Telephone: +31-30-531806 Uucp: uunet!mcsun!ruuinf!piet Telefax: +31-30-513791 Internet: piet@cs.ruu.nl (*`Pete')