- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When calling
c_f_pointer(cptr, fptr [, shape])
I made an typo by calling this subroutine with the shape specified but with fptr being a scalar instead of an array. The compiler did not complain but run the program . I have added a small reproducer.
For your info: this holds for both compilers in the most recent versions. A previous version of ifx did produce an internal compiler error.
Robert
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for reporting this. I like succinct reproducers and so does the compiler team!
I see what you see that both ifx and ifort run ok, but they shouldn't.
I tried an early version of the next version of ifx and it gets a runtime segmentation fault!
I filed a bug report to get the compiler to report an error, CMPLRLLVM-49870.
The Fortran standard does not require an error message for this instance, but it would certainly be a nice-to-have instead of debugging a segmentation fault!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
With the compiler that will be released in late March or April an error message will print, "ERROR: Size of SHAPE in C_F_POINTER must be equal to the rank of FPTR".
Thanks again for reporting this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The compiler with the fix was released last week. Please try it!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page