We updated Intel Visual Fortran Composer XE 2011 to XE 2013 SP1 and Visual Studio 2008 to 2010 Premium.
It seems that the VALUE attribute is not working anymore and it's not recognized as a special word in Visual Studio.
Here's small sample:
integer(4) function csta_sect_num(selected, mode) use, intrinsic :: ISO_C_BINDING use CSE_STA_USER IMPLICIT NONE LOGICAL(C_BOOL), VALUE, intent(in) :: selected integer(C_INT), optional, intent(in) :: mode ...
interface csta_sect_num function csta_sect_num (selected, mode) result (num) use, intrinsic :: ISO_C_BINDING implicit none logical(C_BOOL), VALUE, intent(in) :: selected integer(C_INT), optional, intent(in) :: mode integer(C_INT) :: num end function csta_sect_num end interface csta_sect_num
extern "C" int csta_sect_num (bool selected, int * mode = 0);
C++ function call:
bool sel = false; int num = csta_sect_num(sel);
The selected argument gets passed by reference and will crash the program.
If I add
to the function definition and to its interface, it will work, or if I add the
!DIR$ ATTRIBUTES VALUE :: selected
compiler directive to the parameter, it will also work.
Shouldn't the VALUE attribute work also without neither of these additions?