Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Warning messages

ferrad1
New Contributor I
406 Views

I have just upgraded to latest version of Intel Fortran and am now getting a few of these warnings:

1>saq.f90
1>F:\src\saq\saq.f90: warning #6178: The return value of this FUNCTION has not been defined. [CP]
1>F:\src\saq\saq.f90: warning #6178: The return value of this FUNCTION has not been defined. [C_COPY]

There are no such variables CP or C_COPY in this file.  Whilst they are just warnings, I would rather not have them.  Any idea what is causing them and how to remove them?

 

<Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.6.0 Build 20220226_000000>

0 Kudos
3 Replies
Steve_Lionel
Black Belt Retired Employee
382 Views

Those are the names of functions, not variables. It would help if you attached a copy of the source file named in the message (saq.f90). You can disable all warnings with /warn:nogeneral, but I would not recommend it.

0 Kudos
ferrad1
New Contributor I
376 Views

Thanks Steve,

I can attach the file, however it is not compilable without a whole slew of modules.  Here is a subset example of the file which still shows the problem:

       subroutine saq_start_recording_internal(fpref,ierr)

         use baq_sets_mod

         character(*), intent(in ) :: fpref
         integer     , intent(out) :: ierr

         character(:), allocatable :: fname, bit
         character(8)              :: date
         character(10)             :: time
         integer ll

         call date_and_time(date,time)

         record = .true.
         ll = len_trim(fpref)
         if(fpref(ll:ll) == char(0)) ll = max(1,ll-1)

         bit = '.'
         if(fpref(ll:ll) == '/' .or. fpref(ll:ll) == '\') bit = ''

         fname = fpref(1:ll) // bit // date // '.' // time // '.saq_record'

         open(newunit=lun_record,file=fname, iostat=ierr)

         call util_record_set_lun(lun_record)
         call baq_internal_startrecording()

       end subroutine

 The use'd module baq_sets_mod contains c_copy here:

      function baq_CopyFluid(c_orig) result(c_copy) bind(c, name= 'baq_CopyFluid' )
        type(c_ptr), value, intent(in) :: c_orig  ! original fluid
        type(c_ptr     )               :: c_copy  ! copy fluid

        type(t_bo_fluid), pointer :: f_orig, f_copy
        call c_f_pointer(c_orig, f_orig)

        allocate(f_copy)
        f_copy = f_orig
        c_copy = c_loc(f_copy)
        if(record) call baq_record(22,1108,'baq_CopyFluid', fl=c_copy, fl_orig=c_orig)
      end function

(cp is contained elsewhere in the file, but let me concentrate on c_copy for now)

 

0 Kudos
Steve_Lionel
Black Belt Retired Employee
351 Views

Write back when you have a reproducible example we can look at. I tried massaging your snippet into something I could compile, got no warning.

0 Kudos
Reply