On Fri, 23 Sept 2022 at 19:10, Paul Gilmartin < [email protected]> wrote:
Far worse is the attempt to use OO techniques in non-OO languages. > "Where is this function called?" > "A pointer to it is saved in a struct." > After that, it's anyone's guess. > Years ago I inherited a good size (~200 kLOC) assembler program that had a lot of old-fashioned techniques. But at the same time it had a structured macro scheme that was quite advanced, and included an internal subroutine call/stack mechanism. I updated the macros to generate symbols for the assembler xref/ADATA about what was being called and from where, and only then discovered that the subcall macro had the option to load the "function pointer" (address) from a field in a "struct" (DSECT), thus making a complete static xref of calls impossible. The best that could be done (other than a complete control/data flow analysis) was to also log what updated those pointers in the struct, but correlating them was almost impossible. Bad code can be written using just about any programming paradigm in any language. Tony H. ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
