[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::ada

Title:DEC Ada
Notice:Ada is no longer a trademark of the US Government
Moderator:KMOOSE::CMCCUTCHEON
Created:Mon Jan 27 1986
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:3874
Total number of notes:16668

3864.0. "DEC ADA V3.3-23 Problem Passing Descriptor From FORTRAN" by AXPMCS::BRUTTIN (Armand Bruttin MCS Geneva) Thu Apr 17 1997 06:35

    Hi,
    
    Error When Passing Descriptor From FORTRAN to Ada Procedure
    
    After the installation of ADAAE23033 ( DEC ADA V3.3-23 ). The following
    program fail to pass Descriptor From FORTRAN to Ada Procedure.
    The same program works as expected with DEC ADA V3.3-7
    
    ***********************************************************************
    
    BUG.FOR
    ----------------------------------------
            PROGRAM Bug
            CHARACTER*8 name /'ABCDEFGH'/
            CALL Initialize_MMI_Node (name)
            END
    -----------------------------------------
    
    ADA_PKG.ADA
    -------------------------------------------------------------------------
    WITH System;
    PACKAGE Ada_Pkg IS
       PROCEDURE Initialize_MMI_Node (node : IN STRING);
       PRAGMA Export_Procedure (Initialize_MMI_Node);
    END Ada_Pkg;
    --------------------------
    WITH Text_IO; USE Text_IO;
    PACKAGE BODY Ada_Pkg IS
       PROCEDURE Initialize_MMI_Node (node : IN STRING) IS BEGIN
          Put_Line ("In Ada, string'Length =" & Integer'Image
    (node'Length));
          Put_Line ("In Ada, String = """ & node & """");
       END Initialize_MMI_Node;
    END Ada_Pkg;
    --------------------------------------------------------------------------
                          
    $ ADA Ada_Pkg
    $ ACS EXPORT Ada_Pkg /nOmAIN /oBJECT=Ada_Pkg.obj
    $ FORTRAN Bug.FOR
    $ LINK Bug, Ada_Pkg
    $
    $ RUN BUG
    In Ada, string'Length = 0       ! wrong should be 8
    In Ada, String = ""             ! wrong should be "ABCDEFGH"
                                                                  
    
    Results with DEC ADA V3.3-7
    ***************************
    
    $ run bug
    In Ada, string'Length = 8
    In Ada, String = "ABCDEFGH"
    
    Thanks,
    
    Armand Bruttin
T.RTitleUserPersonal
Name
DateLines
3864.1Known issue; Default for exporting strings is now dop vector, not descriptorKMOOSE::CMCCUTCHEONCharlie McCutcheonThu Apr 17 1997 11:2730
>    After the installation of ADAAE23033 ( DEC ADA V3.3-23 ). The following
>    program fail to pass Descriptor From FORTRAN to Ada Procedure.
>    The same program works as expected with DEC ADA V3.3-7

Yes.  This is a known issue.

Please read the release notes, section 2.1.2.  Due to many problem
reports in this area DEC Ada had to change.  We have changed the product
"several" times, found several unexpected results from the changes, and
do not plan to change it again.

Your user has several options:

  1)	Add "MECHANISM => DESCRIPTOR(SB)" to the export_procedure
	pragma in the users program.

	       PRAGMA Export_Procedure (
			Initialize_MMI_Node,
			mechanism => descriptor(sb) );

	This is the preferred fix, as it tells DEC Ada exactly what
	passing mechanisms you want, so we don't try to guess.

  2)	Compile unchanged program with new compiler switch
	/EXPORT_INTERFACE=FORTRAN.

	Note that this compiler switch may effect other exported subprograms,
	unless they have passing mechanisms specified.

Charlie
3864.2RE: .1 Thanks CharlieAXPMCS::BRUTTINArmand Bruttin MCS GenevaThu Apr 17 1997 14:375
    Charlie,
    
    Thanks,
    
    Armand Bruttin