#1178: unused Fortran function arguments (here in EOS_IdealFluid) -----------------------------------+---------------------------------------- Reporter: knarf | Owner: Type: enhancement | Status: new Priority: minor | Milestone: Component: EinsteinToolkit thorn | Version: development version Keywords: | -----------------------------------+---------------------------------------- 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.
#1178: unused Fortran function arguments (here in EOS_IdealFluid) ------------------------------------+--------------------------------------- Reporter: knarf | Owner: Type: enhancement | Status: review Priority: minor | Milestone: Component: EinsteinToolkit thorn | Version: development version Resolution: | Keywords: ------------------------------------+--------------------------------------- Changes (by knarf):
* status: new => review
#1178: unused Fortran function arguments (here in EOS_IdealFluid) ------------------------------------+--------------------------------------- Reporter: knarf | Owner: Type: enhancement | Status: review Priority: minor | Milestone: Component: EinsteinToolkit thorn | Version: development version Resolution: | Keywords: ------------------------------------+---------------------------------------
Comment (by eschnett):
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.
#1178: unused Fortran function arguments (here in EOS_IdealFluid) ------------------------------------+--------------------------------------- Reporter: knarf | Owner: Type: enhancement | Status: review Priority: minor | Milestone: Component: EinsteinToolkit thorn | Version: development version Resolution: | Keywords: ------------------------------------+---------------------------------------
Comment (by knarf):
Good point. These macros however don't handle Fortran 77 (only 90), and these files are Fortran 77.
#1178: unused Fortran function arguments (here in EOS_IdealFluid) ------------------------------------+--------------------------------------- Reporter: knarf | Owner: Type: enhancement | Status: review Priority: minor | Milestone: Component: EinsteinToolkit thorn | Version: development version Resolution: | Keywords: ------------------------------------+---------------------------------------
Comment (by eschnett):
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.
#1178: unused Fortran function arguments (here in EOS_IdealFluid) ------------------------------------+--------------------------------------- Reporter: knarf | Owner: Type: enhancement | Status: closed Priority: minor | Milestone: Component: EinsteinToolkit thorn | Version: development version Resolution: fixed | Keywords: ------------------------------------+--------------------------------------- Changes (by knarf):
* status: review => closed * resolution: => fixed
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.
trac@lists.einsteintoolkit.org