On Sat, 19 Mar 2016 12:22:44 -0700, Charles Mills wrote:
>Off the wall question: IBM ships EDCDSECT, which will convert an assembler
>DSECT (actually, the ADATA from assembling a DSECT) to a C struct.
>
I had heard of such utilities from ISVs; I had been unaware of this from IBM.
Like Samuel Johnson's politically-incorrect dog, it surprises me that this is
done at all. Some challenges:
o Indiscriminate use of ORG, not always readily rendered as "union".
o Weakness of assembler typing. For example, should:
A DC A(SYMBOL)
be rendered as which of:
char *A = &SYMBOL; /* or: */
long A = SYMBOL;
One can take a guess according to whether SYMBOL is relocatable or
absolute and be right some of the time.
>Is there anything, or combination of things, that will go the other
>direction? Convert a C struct into a DSECT?
>
Backward? Likewise challenges:
o Similar member names in different structs. Qualify them?
o References to typedefs and structure tags from earlier headers.
o Judicious reliance on case-sensitivity. Ok; I'll grant that I'm a partisan\
and I'd not be surprised to encounter nor loath to use in a C program
such as:
char *Auml = "Ä"
char *auml = "ä"
Hmmm... are those UTF-8 strings, just to make it interesting?
(After the fashion of HTML entities, not an arbitrary example.)
It's not my dog.
-- gil
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN