Re: Stack corruption and memory leak problems in c++/Fortran application



On Oct 31, 7:47 pm, Anndy <see.n...@xxxxxxxxx> wrote:
On Oct 31, 7:12 pm, Louis Krupp <lkr...@xxxxxxxxxxxxxxxxxxxxxxx>
wrote:



Anndy wrote:

<snip>

for more clarity i am attaching signature of fortran subroutine and
calling of it from C++.

C++ calling fortran Subroutine :
========================================================================
Fortran Subroutine :
subroutine func(mcode,nbtarb,nufen,nuws,error)

character*(*) mcode
integer error,nufen,nuws,nbtarb

Calling From C++ :

void SomeFunc(void){

int type_obj = 1, ibid = 0, nuws = 1, nufen = 1, ierr = 0;
char code_menu[] = {"ANNDY"};

FUNC(code_menu, &ibid, &nufen, &nuws, &ierr, strlen(code_menu));

}
=============================================================================

How is FUNC declared?

Louis

declaration of FUNC is : void FUNC(char *menu,MY_INT *ibid,MY_INT
*nufen,MY_INT *nuws,MY_INT *ierr, size_t length);

as you pointed out this may be is one of the source for problem. i'll
check this and get back to you guys.

Anndy

there is one more interesting thing what i have noticed. if I put a
WRITE statement in
fortran subroutine, it will take some memory for it.

is this memory is also going on stack?

Anndy

.



Relevant Pages