- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
i have a 1024 character.
i call int x = getcwd(DIR)
dir = "/home/mydirectory/"
If i run the same code, the only difference is, i use the assume nounderscore flag,
dir = "home/mydirectory " with spaces all the way up to 1024.
Why does the flag make a difference? Is there a way i can get the assume nounderscore flag,
make it have the spaces just like without the assume nounderscore flag?
i call int x = getcwd(DIR)
dir = "/home/mydirectory/"
If i run the same code, the only difference is, i use the assume nounderscore flag,
dir = "home/mydirectory " with spaces all the way up to 1024.
Why does the flag make a difference? Is there a way i can get the assume nounderscore flag,
make it have the spaces just like without the assume nounderscore flag?
링크가 복사됨
5 응답
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
My guess is that with assume nounderscore, you're getting a C library version of the routine, rather than the Fortran version. I recommend against using assume nounderscore - use an interface block and BIND(C,NAME="namegoeshere") if you need to call an external routine with non-Fortran conventions.
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Quoting - Steve Lionel (Intel)
My guess is that with assume nounderscore, you're getting a C library version of the routine, rather than the Fortran version. I recommend against using assume nounderscore - use an interface block and BIND(C,NAME="namegoeshere") if you need to call an external routine with non-Fortran conventions.
im having to use assume nounderscore since its part of a whole library, i just isolated the problem to this. for some reason also, with the assume nounderscore flag, the value returns is non 0, but with the flag it returns 0.
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
As I said, you're calling the wrong routine. Try adding USE IFPORT in the routine that calls getcwd.
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Quoting - Steve Lionel (Intel)
As I said, you're calling the wrong routine. Try adding USE IFPORT in the routine that calls getcwd.
you were right, i traced both version of the code, one with the assume nounderscore and one without it, and looked at the assembly level calls to getcwd, and they were calling different functions. So i added a underscore to the getcwd call and it worked. Thanks Steve, btw, how was japan?
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
I suppose that's another way to do it, though it's not what I would recommend. I hope you add a comment explaining it.
Japan was wonderful. Pictures are here - I'm still working on a travelogue.
Japan was wonderful. Pictures are here - I'm still working on a travelogue.
