[M3devel] Target.Allow_packed_byte_aligned const or var per target?
Rodney M. Bates
rodney_bates at lcwb.coop
Sun Sep 20 23:00:35 CEST 2015
Hmm, this sounds like a mechanism we had a discussion of several years ago.
I don't remember how it ended, but I think there was a general consensus that
it was an idea with some unresolved problems.
However, one big class of use cases for packing things is to make it possible
to define a record layout that matches one already specified externally, a network
protocol packet, for example. We had a much bigger problem with that regarding
different endianness, which we never did anything about. I have some unimplemented
notes somewhere on how to do opposite-endian record layout. It was mind-boggling,
to put it gently, and left me even more negative on so-called "little endian" than
previously.
Anyway, this is where different rules for different records on the same target
may be wanted.
On 09/20/2015 03:41 PM, Jay K wrote:
> containsLazyAlignments
>
> m3front/Module.m3:
>
> PROCEDURE SetLazyAlignment (on: BOOLEAN) =
> BEGIN
> IF curModule # NIL THEN
> curModule.lazyAligned := on;
> IF on THEN
> curModule.containsLazyAlignments := TRUE;
> END;
> END;
> END SetLazyAlignment;
>
>
> PROCEDURE Compile (t: T) =
> VAR save: T; zz: Scope.T; yy: Revelation.Set;
> BEGIN
> (* ETimer.Push (M3Timers.emit); *)
> Target.Allow_packed_byte_aligned := t.containsLazyAlignments;
>
>
> This feels wrong.
> Surely, Allow_packed_byte_aligned should be constant for any given target?
> Surely a pragma cannot change a target's characteristics?
> Or, rather, I found this by changing it to a constant false for all targets.
>
>
> - Jay
>
>
> _______________________________________________
> M3devel mailing list
> M3devel at elegosoft.com
> https://mail.elegosoft.com/cgi-bin/mailman/listinfo/m3devel
>
--
Rodney Bates
rodney.m.bates at acm.org
More information about the M3devel
mailing list