Skip to main content

MFPLI00394E,MFPLI00395E ,MFPLI00396E

  • November 6, 2015
  • 0 replies
  • 0 views

Problem:


The errors shown below occur in ED 2.3, but not in ED 2.2:
Error MFPLI00394E : $ on ADDR("x") is an invalid DEFINED overlay
Error MFPLI00395E : $ on ADDR("x") is declared as DEFINED but requires more storage than its base variable
Error MFPLI00396E : $ on ADDR("x") but requires more storage than its based reference
“$” is variable name the compiler inserts into the message at compile-time

Solutions:


Best Solution Section:


Examine the code points where E-level diagnostics MFPLI00396E (and MFPLI394E & MFPLI00395E) occur. Be sure there are no data structure overlays which exceed storage requirements and that underlying data types are compatible (or are intended). Fix any discrepancies and recompile in order to reduce or eliminate occurrences of these diagnostic(s).
If the diagnostic(s) persist, this may be due to differences in data type, structure members overlaid on other structure members of differing type or size, or other possible size & type incompatibilities. Open-PLI criteria for generating these diagnostics is a bit more stringent than Mainframe PL/I because we feel this can be useful in tracking memory stomps which this type of defined-overlay coding style can lend itself to.
If desired, these diagnostics may be turned off using the –laxbased (and –laxdefined) compiler options. Note these options are the Open-PLI defaults, but –systemmvs, -systemcics, and –systemims automatically imply –nolaxased and –nolaxdefined for compiling mainframe originating code.
Alternate Solution:
Lowering the Severity of these diagnostics to W-level or I-Level might be preferable and advantageous over –laxbased (and –laxdefined) as any possible new occurrences of these constructs will flagged by the compiler. The PL/I Message User Exit can be used for this purpose (described in the Open-PL/I User Guide), and shown below, as well.

As an alternative, you can also modify the built-in User-Exit called, mfplilctx.pli, as described below.  If you elect this option, please back up the existing member before doing this:


Using the PL/I Message User Exit:
The PL/I message user exit allows an installation to monitor compile-time and run-time issued messages. You can modify and rebuild the Micro Focus provided sample user exit to suit your installation’s needs. Every message that is issued by various PL/I components is presented to the user exit. If it is a compiler issued message, it is subjected to the -f compile-time option after it has been presented to the user exit.

The user exit can:
• Do nothing and allow the message to be processed by PL/I as is.
• Change the severity of the message one severity level up or down. Note that I-level (severity level 0) cannot be lowered and U-level (severity level 4) cannot be raised. Thereafter, the message will be issued as is (with the same exact text, including severity level) with a " " (for raised severity) or "-" (for lowered severity) indication but the new severity will be used for return code purposes.


Example:
plisql1.pp (0,0) : Error MPLIE00042W : Errors have ...
If the severity is lowered, the message will be shown as:
plisql1.pp (0,0) : Warning MPLIE00042W-: Errors have ...
The return code will be 4 instead of 8.


If the severity is raised, the message will be shown as:
plisql1.pp (0,0) : Severe MPLIE00042W : Errors have ...
The return code will be 12 instead of 8.


Upon return from the exit, the message is not subjected to the -f option. Note the and – after MPLIE00042W indicating change in severity.


• Suppress the message altogether. The severity of the suppressed message still carries through and participates in return code evaluation. It strongly recommended that you do not suppress the run-time messages.


Note: The user exit API is a trusted interface and is running as part of PL/I and therefore could affect the stability of the run-time system and of the compiler and other components involved.


A default user exit that does nothing is shipped with the product. You can modify the provided user exit to suit your needs. It can be used to gather compile-time information for later or real-time analysis. Please make sure that your version of the user exit takes precedence or replaces the default one provided by Micro Focus.
Let’s say that your installation wanted to modify the user exit to lower the severity of the compiler message 396 from Error level to Warning level. You would replace the compiler message table (table name ending in MFPLI, the prefix for compiler messages) from


   dcl msg_tab_mfpli   ( 1)   char(6) static init('99999x');
to
   dcl msg_tab_mfpli   ( 2)   char(6) static init(‘00396-‘, /* note the – after message number */
                                                                                '99999x');


Then rebuild and replace the Micro Focus provided “.dll” or “.so” (UNIX).


The compile-time user exit should be built as follows:


• On Windows:
mfplx mfplictx.pli -macro -dll -native -opt -nolaxdcl -vax  -sysdef -pp mfplictx.pp”
• On UNIX:
mfplx mfplictx.pli -macro -dll -native -opt -nolaxdcl -vax  -sysdef -pp mfplictx.pp -o mfplictx.so


It must have an executable name of mfplictx (lowercase) and be placed in a directory that is on the search path (PATH on Windows, LD_LIBRARY_PATH on Linux and Solaris SPARC, and LIBPATH on AIX).
****** End of User-Exit ******

Explanation:


Compiling the code shown below with the IBM PLI compiler, e.g. –cics, does not produce any diagnostic. In ED 2.3, as part of RPI 1101764, we made a conscious decision to strengthen the requirements on allowing BASED(ADDR()) over IBM..
FOO: PROC;
/* TRANSLATION DATASET IO AREA         */
    DCL 1 TRANSLATION_AREA,
         2 TR_COMP             CHAR(2),
         2 TR_TYPE             CHAR(4),
         2 TR_VALUE            CHAR(14),
         2 TR_RECORD_LENGTH    FIXED BIN(15),
         2 TR_DESCRIPTION(240) CHAR(1);

    DCL 1 TRANSLATION_RECORD_AREA    BASED(ADDR(TRANSLATION_AREA))
                                     UNALIGNED,
         2 FILLER              CHAR(22),
         2 TR_DESCRIPTION_REC  CHAR(256);
  END;


This error, MFPLI00396E : TRANSLATION_RECORD_AREA is BASED on ADDR("x") but requires more storage than its based reference, is absolutely true. 


TRANSLATION_AREA and TRANSLATION_ARE_RECORD are structures of differing sizes (262 bytes vs. 278 bytes). The point of the code this is to overlay TR_DESCRIPTION_REC char (256) over TRANSLATION_REC (240) char (1), which is error-prone coding, and will produce an overrun if any indexing beyond 240 is done.


#MFPLI00394E
#PLI
#MFDS
#MFPLI00395E
#EnterpriseDeveloper
#MFPLI00396E

0 replies

Be the first to reply!