[DFDL-WG] Possible DFDL spec errata

Mike Beckerle mbeckerle.dfdl at gmail.com
Tue May 29 13:08:21 EDT 2012


On Tue, May 29, 2012 at 12:03 PM, Steve Hanson <smh at uk.ibm.com> wrote:

> These were on the agenda for today's cancelled call.
>
> *2. Is parent/child alignment rule too strict?*
>  Spec property description for alignment says "The alignment of a child
> component must be less than
>  or equal the alignment of its parent element, sequence or choice".
> Experiments with creating DFDL schema
>  from C structures have shown that this rule is violated. It seems
> unnecessary.  Specifically, C ensures that the alignment
>  of objects in a repeating structure is preserved by rounding up the
> length of the structure, rather than aligning it.
>

I think the point of this restriction was to insure that we didin't have
conflicting alignments. Where the begining of the structure was aligned,
say 64, but the first element was aligned at some incompatible boundary.
Like 128. It would almost certainly be an error if the first element in a
structure has a larger alignment constraint than the overall structure, and
the user should pick where to place the constraint, and not constrain both,
except when the constraints on one are implied by the constraints of
another.

Example: I have a 4k page aligned structure. The first element is some type
of double float coming from a global simple type def. The global simple
type definition that says my specific kind of double floats are always
8-byte aligned. The 4k page is obviously 4096 byte aligned. There should be
no conflict here. The page alignment "Wins" and the begining of the
structure is 4k aligned, and that satisifies the 8-byte alignment of my
specialized double float.

The point of having any restriction at all, is to catch conflicts. Eg.,
what if I had something that was 64-byte aligned, and I put it inside a
structure that has only 2-byte alignment....., this is probably an error.

If this isn't going to catch any errors, then this restriction is
unnecessary.


>
> * 3. Does DFDL need to support signed integer types with lengthUnits
> 'bits'?*
>  Spec only allows unsigned integers to have lengthUnits 'bits', but it is
> possible in C structures to delare
>  bit fields for signed integers. They behave like two's complement. It
> looks like the spec is being
>  too restrictive in its types for 'bits'.
>

I missed this over restriction. Signed are definitely needed.


-- 
Mike Beckerle | OGF DFDL WG Co-Chair
Tel:  781-330-0412
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ogf.org/pipermail/dfdl-wg/attachments/20120529/f86daf9e/attachment.html>


More information about the dfdl-wg mailing list