C Attribute on Named Common

Product Version(s): 3.30
Operating System:   MS-DOS
Flags: ENDUSER |
Last Modified: 12-MAY-1988    ArticleIdent: Q11664

Problem:
   The C attribute on a named common apparently has no effect. Because
of this limitation, you must actually call a FORTRAN routine to access
FORTRAN common from a C program. This will return a pointer to the first
element in common.
   The following is a code sample that demonstrates this behavior:

   subroutine test
   common/stmt [C]/j(3)
   j(1)=3
   j(2)=5
   j(3)=8
   stop
   end

Response:
   You can work around this problem by using the "ALIAS" attribute,
which gives your variable a lowercase name preceded by an underscore.
The following is an example:

   SUBROUTINE TEST
   COMMON /STMT [ alias:'_stmt' ] / j(3)
   j(1)=3
   j(2)=5
   j(3)=8
   STOP
   END

   Microsoft confirmed this to be a problem in Version 3.30 of the
FORTRAN compiler.
   The problem was corrected in Version 3.31.