unused Fortran function arguments (here in EOS_IdealFluid)

Issue #1178 closed
Frank Löffler created an issue

In an effort to get rid of some of the warnings I wonder what the best way in Fortran is to suppress warnings about unused function arguments. Is there an 'unused' keyword?

I any case: the quick solution I came up with is in the patch: 'var=var' - hopefully optimized away by the compiler. It silences the warning. See attached patch.

Keyword:

Comments (6)

  1. Erik Schnetter
    • removed comment

    I suggest to use the macros defined in cctk_Types.h:

    CCTK_DECLARE(CCTK_REAL, rest_mass_density, )

    In the future, these macros may be made more intelligent or compiler specific.

  2. Frank Löffler reporter
    • removed comment

    Good point. These macros however don't handle Fortran 77 (only 90), and these files are Fortran 77.

  3. Erik Schnetter
    • removed comment

    No, these files are Fortran 90. Cactus requires a .F77 extension for Fortran 77 files.

    There is basically no reason at all to use Fortran 77 these days. This is equivalent to having K&R C code in Cactus that cannot be compiled with an ANSI C compiler.

  4. Frank Löffler reporter
    • changed status to resolved
    • removed comment

    You are right. I must have done something wrong when I tested it; it now works. And yes, .F files are 'fixed format Fortan 90, to be preprocessed' for Cactus.

  5. Log in to comment