This is a common C-idiom for avoiding implicit type conversions by the compiler, between types with the same runtime representation. Alexander On Wed, Jan 28, 2015 at 4:20 PM, David Greve < david.greve@rockwellcollins.com> wrote:
One more and then I'll stop .. I promise.
There appear to be numerous instances of the following design pattern:
struct message_info { uint32_t words[1]; };
Where the above structure is then allocated locally, initialized and returned by a procedure.
Seems like a lot of work to return a uint32_t.
I originally assumed that all/much of this code was generated automatically from Haskell .. so I figured it was some odd corner case in the translator. Subsequent discussions, however, have suggested that this assumption is false and that the code was actually written by hand.
I could understand using structures to present a unique, statically checkable procedure type signature .. but I can't rationalize the use of the single element array.
So .. is there a reason for this curious design pattern?
Thanks, Dave
_______________________________________________ Devel mailing list Devel@sel4.systems https://sel4.systems/lists/listinfo/devel