gm2
[Top][All Lists]
Advanced

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

[Gm2] Re: data alignment is now possible


From: Gaius Mulley
Subject: [Gm2] Re: data alignment is now possible
Date: Sat, 19 Jun 2010 11:10:28 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]