C++Guns – RoboBlog

17.01.2015

suppress "unused dummy argument" warning in fortran

Filed under: Allgemein — Tags: — Thomas @ 18:01

Here is my way to supress the "unused dummy argument" warning. I'm searched a long time but did not find a solution which works on any compiler and newer fortran standard.

In C/C++ it is very easy. Just write (void)variable; But this just trigger an "Unclassifiable statement" error.

#define UNUSED(x) if(size( (/(x)/) ) < 0) continue

program main
  implicit none

  type testtype
    integer :: x
  end type

  type(testtype) :: x
  type(testtype), pointer :: y => null()

  integer :: z
  
  UNUSED(x)
  UNUSED(y)
  UNUSED(z)
end program
$ gfortran -Wall -Wextra -fcheck=all -g test.F90
$ ./a.out
$

hf

No Comments

No comments yet.

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Powered by WordPress