You can see a result of inlining with this little program below.  On the
CRTCMOD, optimize at 30 or higher, turn on inlining, turn off debug view,
turn on keep intermediate language data.  Compile with comment before
#pragma, run the program and observe the call stack; then remove the
comment before #pragma, compile and run and observe the call stack and
notice the difference.

Dump the two versions of the modules with DMPSYSOBJ and their w-code
streams will appear under the heading "secondary associated space".
Compare the two versions of w-code and you'll notice the only difference
between the dumps is *ONE* single bit flag.  So it seems inlining occurs
down in the optimizing translator, not in RPG or C.

// CRTCMOD +
//    OPTIMIZE(30) +
//    INLINE(*ON *NOAUTO) +
//    DBGVIEW(*NONE) +
//    MODCRTOPT(*KEEPILDTA)

#include <stdlib.h>
void show( void );
// #pragma inline( show )
void main( void )
{ show();
  return;
}
void show( void )
{ system( "DSPJOB OPTION(*PGMSTK)" );
}


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2021 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.