> The following patch eliminates an alignment warning in packfile.c, and
> adds a comment to packfile.h about alignment assumptions underlying the
> size of the packfile header.

Applied, thanks.

> I wonder if we ought to have a Configure "sanity section" wherein various
> assumptions are tested prior to build time.  Two candidates for such a
> section would be
>
>       sizeof(INTVAL) >= sizeof(void *)
>       PACKFILE_HEADER_BYTES % sizeof(opcode_t) == 0
>
> I'm sure there are other assumptions too.

Anyone else have any ideas on where the best place to put the above?
Configure currently doesn't know about PACKFILE_HEADER_BYTES, since it's a
macro in packfile.h. We could check them in Parrot's initialization, but I
don't know if that's a good idea.

We could create a C file which contains the above assumpts with asserts,
and includes parrot.h. Then the main() function could assert on all of the
necessary conditions. Configure would compile and run this program to
ensure correctness.

Thoughts? Anyone want to take a crack at it?

Mike Lambert

Reply via email to