A few compilers support a 'no arg check' compiler directive which tells the
compiler to ignore type/kind/rank checking on specified arguments.  This is
useful when routines have 'generic' arguments which are simply passed on to
other routines.  Two compilers which support this feature are ifort, with the
'!dec$ attributes no_arg_check' directive, and MIPSpro f90, with the '!dir$
ignore_tkr' directive.

For example, in the Message Passing Interface (MPI), the send and receive
buffer arguments are typically 'choice' arguments which can have any type. 
This makes it difficult to write interface blocks to help validate the
remaining arguments (and allow keyword=value usage for better self-documenting
code.)  Using the Intel compiler directive, an interface block could be written
as follows:

  interface
    subroutine mpi_send (BUF, COUNT, DATATYPE, DEST, TAG, COMM, IERROR)
      implicit none
      integer :: BUF(*)
!dec$ attributes no_arg_check::buf
      integer, intent(in)  :: COUNT, DATATYPE, DEST, TAG, COMM
      integer, intent(out) :: IERROR
    end subroutine
  end interface

The alternative to this is to do as OpenMPI does and generate dozens of
specific 'glue' routines, and tie them together under a generic name. 
(Tedious, less so by using a preprocessor.)  Or to not have explicit interfaces
at all, at least for routines with 'choice' arguments, and get no argument
checking at all.  (In most cases, the current status quo.)


-- 
           Summary: Consider a 'no arg check' directive
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: w6ws at earthlink dot net


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39505

Reply via email to