On Wed, Oct 09, 2002 at 02:14:50AM -0400, Tanton Gibbs wrote: > There were a number of warnings which read something like > "structure padded for alignment of member value in debug.h" > > This can be trivially fixed by reordering the structure members ( I hope). > This patch works fine on cygwin, but I would like to see some other > platforms (especially 64 bit) try it out to see > 1.) does it compile without those warnings (although, there will be > structure padding warnings, just not for individual members).
on ARM, lots of these two: In file included from ../include/parrot/register.h:16, from ../include/parrot/interpreter.h:42, from ../include/parrot/parrot.h:160, from array.c:27: .../include/parrot/string.h:59: warning: padding struct size to alignment boundary In file included from ../include/parrot/interpreter.h:51, from ../include/parrot/parrot.h:160, from array.c:27: .../include/parrot/debug.h:55: warning: padding struct size to alignment boundary /usr/local/bin/perl5.8.0 pmc2c.pl boolean.pmc string.h: 56 /* Tail added to end of string buffers; used for COW GC */ 57 struct Buffer_Tail { 58 unsigned char flags; 59 }; on ARM structures all align on 4 bytes, and so pad to a multiple of 4 bytes Even that one. Yep. legal ANSI C. Likewise debug.c: 50 typedef struct PDB_condition { 51 void *value; 52 PDB_condition_ptr next; 53 unsigned short type; 54 unsigned char reg; 55 } PDB_condition_t; In order, the other significant compiler warnings I see are: perlhash.pmc: In function `Parrot_PerlHash_get_pmc_keyed': perlhash.pmc:192: warning: passing arg 2 of pointer to function from incompatible pointer type 191 return entry->val.pmc_val->vtable->get_pmc_keyed(INTERP, 192 entry, nextkey); No idea All 4 structs end with char members: include/parrot/jit.h:36: warning: padding struct size to alignment boundary include/parrot/jit.h:128: warning: padding struct size to alignment boundary include/parrot/jit.h:150: warning: padding struct size to alignment boundary include/parrot/jit.h:205: warning: padding struct size to alignment boundary resources.c: In function `mem_allocate': resources.c:147: warning: cast increases required alignment of target type resources.c: In function `compact_pool': resources.c:231: warning: cast increases required alignment of target type resources.c:261: warning: cast increases required alignment of target type resources.c:288: warning: cast increases required alignment of target type resources.c:307: warning: cast increases required alignment of target type 147 ((struct Buffer_Tail*)((char *)return_val + size - 1))->flags = 0; 231 (struct Buffer_Tail *)((char *)b->bufstart +b->buflen); 259 struct Buffer_Tail *new_tail = 260 (struct Buffer_Tail *)((char *)cur_spot + 261 b->buflen); 288 b = (Buffer *)((char*)b + object_size); 307 (struct Buffer_Tail *)((char *)cur_spot + b->buflen); headers.c: In function `add_extra_buffer_header': headers.c:424: warning: cast increases required alignment of target type 424 ptr = (void**)((char*)headers->bufstart + headers->buflen - sizeof(void*)); dod.c: In function `free_unused_buffers': dod.c:431: warning: cast increases required alignment of target type 431 b = (Buffer *)((char *)b + object_size); > 2.) does it pass all tests Yes. (well, no change - there's one failure I really must find tuits to investigate, which I put down either to compiler or local hardware bug, but your patch doesn't change that) Nicholas Clark -- Even better than the real thing: http://nms-cgi.sourceforge.net/