Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Warning bug? (unused module procedure)

0 views
Skip to first unread message

Bil Kleb

unread,
Nov 21, 2008, 12:37:01 PM11/21/08
to
Hi,

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

Bil Kleb

unread,
Nov 21, 2008, 12:45:28 PM11/21/08
to
Bil Kleb wrote:
>
> In the program included after my signature, [..]

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

Bil Kleb

unread,
Nov 23, 2008, 8:49:16 PM11/23/08
to
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.

Regards,
--
http://twitter.com/bil_kleb

Gary Scott

unread,
Nov 23, 2008, 9:33:41 PM11/23/08
to
Bil Kleb wrote:

> 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

0 new messages