This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: intrinsic statement


On Tue, May 05, 2009 at 11:40:14PM +0200, Daniel Franke wrote:
> 
> Dear all,
> 
> while eliminating warnings from a dated fortran source, I extracted the 
> example below. I believe the the warnings are incorrect, but I'm not sure?!
> 
> $> cat foo.f
>       INTRINSIC   ABS, MAX
>       a(n) = MAX(ABS(2),ABS(3),n)
>       END
> 
> $> gfortran-svn -Wall -Wextra foo.f
> foo.f:1.21:
> 
>       INTRINSIC   ABS, MAX
>                      1
> Warning: Type specified for intrinsic function 'abs' at (1) is ignored
> foo.f:1.26:
> 
>       INTRINSIC   ABS, MAX
>                           1
> Warning: Type specified for intrinsic function 'max' at (1) is ignored
> 
> 
> Simply removing the intrinsic statement cures this, of course, but that's not 
> the point :)
> 
> Pointers and comments welcome!
> 

I think you might be running into the second sentence of 5.1.2.8:

  The INTRINSIC attribute confirms that a name is the specific
  name (13.6) or generic name (13.5) of an intrinsic procedure.
  The INTRINSIC attribute allows the specific name of an intrinsic
  procedure that is listed in 13.6 and not marked with a bullet (·)
  to be used as an actual argument (12.4).

The specific name ABS() takes a default real and returns a default
real.

-- 
Steve


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]