SiTex Graphics<address@hidden> writes:
Thanks. That will be handy.
I see now that my original question was poorly worded. What I was
really after is a way to pack fields in a record as tightly as
possible. Both XDS and StonyBrook have a global option for that.
Here's a simple example (source code attached). With the following
type declaration:
Test = RECORD
a : CARDINAL8;
b : CARDINAL32;
c : CARDINAL8;
END;
GM2 reports SIZE(Type) as 12, whereas StonyBrook and XDS report 6 with
packed field alignment. With the other compilers changing the field
alginment does not require modificiation of the source code, and that
would be highly desirable. Maybe there's already a gcc-based
command-line option for field alignment?
In any case the ability to specify variable alignment will be useful
in its own right.
Thanks,
Scott
Hi Scott,
Sure I see no problem adding the __attribute__((packed)) concept that
gcc uses into gm2. This also provides continuity with the gcc family.
Alas there is no command line option to specify field alignment -
quite a few to warn if (packed) makes no difference. I guess it is
safer to insist on minor code changes rather than remembering which
module was compiled with which option. A global ISO Modula-2 comment
directive might be another approach..
regards,
Gaius
_______________________________________________
gm2 mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/gm2