- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
With ifort 12.0.5 and this program:
[fortran]! ifort /check:all /warn:all /standard-semantics xxxx.f90 PROGRAM automatically_broken IMPLICIT NONE TYPE some_type INTEGER :: some_number END TYPE some_type TYPE(some_type) :: st_array(2) INTEGER :: fn_result(2) !**** st_array = [some_type(1), some_type(2)] fn_result = do_some_counting(st_array, 2) PRINT "('Out of the function the result is: ',99(I0,:,','))", fn_result CONTAINS FUNCTION do_some_counting(st_arg, idx) RESULT(res) TYPE(some_type), INTENT(IN) :: st_arg(:) INTEGER, INTENT(IN) :: idx INTEGER :: res(st_arg(idx)%some_number) !---- INTEGER :: i !**** res = [(i, i = 1, SIZE(res))] PRINT "('In the function st_arg(idx)%some_number is ',I0)", & st_arg(idx)%some_number PRINT "('In the function the result is: ',99(I0,:,','))", res END FUNCTION do_some_counting END PROGRAM automatically_broken [/fortran]
I got:
[fortran]In the function st_arg(idx)%some_number is 2 In the function the result is: 0,4635040 Out of the function the result is: 0,0[/fortran] which made me address the compiler with rather strong language earlier today.
Link Copied
- 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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This was fixed in the 13.0 (Composer XE 2013 initial release) compiler, but I didn't find out about that until today.

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