Home » U++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » Compiling Fortran sources in TheIde
Re: Compiling Fortran sources in TheIde [message #52146 is a reply to message #52138] |
Mon, 29 July 2019 10:03   |
 |
koldo
Messages: 3437 Registered: August 2008
|
Senior Veteran |
|
|
An additional detail.
Actual demo launches a SEGFAULT using gfortran 64 bits.
To fix it, this could be done:
- In Fortran code, declare string as
character(len=80) :: cc = char(0)
- In C code, remove
cc[ll--] = '\0'; // NULL terminate the string
This is due in void writelog_( char *cc, int ll ), ll has the original dimension (80), but as gfortran seems to trim the length to the real string, returned string is shorter so assigning a '\0' to 80-1 access to non allocated memory, creatintg the SEGFAULT
- Assign the class pointer in the constructor:
tfp = this;
If not, calling tfp->WriteLog(cc); may fail.
Best regards
IƱaki
|
|
|
Goto Forum:
Current Time: Mon Jun 09 01:49:50 CEST 2025
Total time taken to generate the page: 0.05611 seconds
|