Fortran return statement

前端 未结 3 1624
情书的邮戳
情书的邮戳 2021-01-20 10:36

I\'m trying to get some code compiled under gfortran that compiles fine under g77. The problem seems to be from a return statement:

ffuncs.f:934.13:

         


        
3条回答
  •  無奈伤痛
    2021-01-20 11:18

    I think @Carl Smotricz has the answer. Does argument list of ffuncs has dummy arguments that are asterisks (to match the asterisk-label in the calls)? Or was this used without there being alternative returns? If there were no alternative returns, just delete the "E". If there are alternative returns, the big question is what the program was doing before at run time since the variable was of the wrong type and uninitialized. If the variable didn't have an integer value matching one of the expected branches, perhaps the program took the regular return branch -- but that's just a guess -- if so, the easy fix is to again to delete the "E".

    The "alternate return" feature is considered "obsolescent" by the language standard and could be deleted in a future standard; compilers would likely continue to support it if it were removed because of legacy code. For new code, one simple alternative is to return an integer status variable and use a "select case" statement in the caller.

提交回复
热议问题