G95 is issuing a warning about an unused module procedure that,
as far as I can tell, is being used:
% g95 -c -Wunused-module-procs test.f90
In file test.f90:16
subroutine mp_character(string)
1
Warning (167): PRIVATE module procedure 'mp_character' at (1) is
never invoked
In the program included after my signature, a private generic
interface,
mp_interface, is called by the public subroutine 'use_mp_interface',
which in turns calls (uses) the private module procedure. If you
remove
the private declaration, no warning.
Am I missing something, or is this a warning bug?
% g95 --version | head -1
G95 (GCC 4.0.3 (g95 0.92!) Nov 19 2008)
Regards,
--
Bil Kleb
http://fun3d.larc.nasa.gov
% cat << EOF > test.f90
module unused_module_proc_bug
private
public :: use_mp_interface
interface mp_interface
module procedure mp_character
end interface mp_interface
contains
subroutine use_mp_interface
call mp_interface('hello world subroutine mp_character(string)
character(*) :: string
write(*,*) "character module procedure called: ", string
end subroutine mp_character
end module unused_module_proc_bug
EOF
Appears to have had some cut-n-paste difficulties.
Here's another attempt in the body of the message:
% cat << EOF > test.f90
module unused_module_proc_bug
private
public :: use_mp_interface
interface mp_interface
module procedure mp_character
end interface mp_interface
contains
subroutine use_mp_interface
call mp_interface('hello world')
end subroutine use_mp_interface
subroutine mp_character(string)
character(*) :: string
write(*,*) "character module procedure called: ", string
end subroutine mp_character
end module unused_module_proc_bug
EOF
Regards,
--
Bil
Andy reports this has been repaired.
Regards,
--
http://twitter.com/bil_kleb
> Bil Kleb wrote:
>
>>G95 is issuing a warning about an unused module procedure that,
>>as far as I can tell, is being used:
>
>
> Andy reports this has been repaired.
I hope he didn't fix it over the weekend, he deserves some time off.
>
> Regards,
> --
> http://twitter.com/bil_kleb
--
Gary Scott
mailto:garylscott@sbcglobal dot net
Fortran Library: http://www.fortranlib.com
Support the Original G95 Project: http://www.g95.org
-OR-
Support the GNU GFortran Project: http://gcc.gnu.org/fortran/index.html
If you want to do the impossible, don't hire an expert because he knows
it can't be done.
-- Henry Ford