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 |
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.R | Title | User | Personal Name | Date | Lines |
---|---|---|---|---|---|
3864.1 | Known issue; Default for exporting strings is now dop vector, not descriptor | KMOOSE::CMCCUTCHEON | Charlie McCutcheon | Thu Apr 17 1997 11:27 | 30 |
> 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.2 | RE: .1 Thanks Charlie | AXPMCS::BRUTTIN | Armand Bruttin MCS Geneva | Thu Apr 17 1997 14:37 | 5 |
Charlie, Thanks, Armand Bruttin |