Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.
27158 Discussions

Intel Fortran: defined operator names limited to 31 characters

Harald1
Novice
404 Views

The following code is invalidly rejected by ifort:

 

module m
  implicit none
  interface operator (.timestimestimestimestimestimestimes.)
     module procedure f
  end interface
contains
  real function f (x, y)
    real, intent(in) :: x, y
    f = x*y
  end function
end module

Compiling:

% ifort -V ifort-uop.f90
Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.1.2 Build 20201208_000000
Copyright (C) 1985-2020 Intel Corporation.  All rights reserved.

 Intel(R) Fortran 2021.1.2-2085
ifort-uop.f90(3): error #6018: A defined op has more than 31 characters.   [TIMESTIMESTIMESTIMESTIMESTIMESTIMES]
  interface operator (.timestimestimestimestimestimestimes.)
------------^
compilation aborted for ifort-uop.f90 (code 1)

 

 

I couldn't find the location in the standard where it states a number for the length of the name of a defined operator, but I think it should be the same as for other symbols (63).  This is what other compilers accept.

 

Labels (1)
0 Kudos
2 Replies
Steve_Lionel
Black Belt Retired Employee
357 Views

It's an oversight. The standard says:

C1004 (R1003) A defined-unary-op shall not contain more than 63 letters and shall not be the same as any intrinsic-operator or logical-literal-constant.

If you can, report it through the Online Service Center, or hope that an Intel support engineer picks it up from here.

 
Harald1
Novice
333 Views

Ah yes, now I see it, too:

C1005 (R1023) A defined-binary-op shall not contain more than 63 letters and shall not be the same as any intrinsic-operator or logical-literal-constant.

 

It appears that someone already picked up the report, but thanks for mentioning it.

 

Reply