public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/18111] New: [gfortran] spurious warnings with -W -Wall
@ 2004-10-22 14:04 martin at mpa-garching dot mpg dot de
  2004-10-22 14:05 ` [Bug fortran/18111] [gfortran] spurious warnings with -W -Wunused martin at mpa-garching dot mpg dot de
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: martin at mpa-garching dot mpg dot de @ 2004-10-22 14:04 UTC (permalink / raw)
  To: gcc-bugs

When compiling the code below, gfortran emits warnings about unused
variables which are not defined by the user:

module misc_utils
implicit none

interface toString
  module procedure toString_i, toString_sp
end interface

contains

function toString_i (num)
  integer, intent(in) :: num
  character (len=30) :: toString_i

  write(toString_i,*) num
  toString_i = trim(adjustl(toString_i))
end function

function toString_sp (num)
  real, intent(in) :: num
  character (len=30) :: toString_sp

  write(toString_sp,*) num
  toString_sp = trim(adjustl(toString_sp))
end function

end module misc_utils


~/tmp>gfortran -Wunused -W -v -c misc_utils.f90
Reading specs from /afs/mpa/data/martin/ugcc/lib/gcc/i686-pc-linux-gnu/4.0.0/specs
Configured with: /scratch/gcc/configure --quiet
--prefix=/afs/mpa/data/martin/ugcc --enable-languages=c++,f95
--with-gmp=/afs/mpa/data/martin/mygmp
Thread model: posix
gcc version 4.0.0 20041021 (experimental)
 /afs/mpa/data/martin/ugcc/libexec/gcc/i686-pc-linux-gnu/4.0.0/f951
misc_utils.f90 -quiet -dumpbase misc_utils.f90 -mtune=pentiumpro -auxbase
misc_utils -Wunused -W -version -o /tmp/ccSekDLb.s
GNU F95 version 4.0.0 20041021 (experimental) (i686-pc-linux-gnu)
        compiled by GNU C version 4.0.0 20041021 (experimental).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
misc_utils.f90:5: warning: unused parameter '.__result'
misc_utils.f90:5: warning: unused parameter '.__result'


Interestingly, the warnings are issued for line 5, which only contains
the interface description.

-- 
           Summary: [gfortran] spurious warnings with -W -Wall
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: martin at mpa-garching dot mpg dot de
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18111


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug fortran/18111] [gfortran] spurious warnings with -W -Wunused
  2004-10-22 14:04 [Bug fortran/18111] New: [gfortran] spurious warnings with -W -Wall martin at mpa-garching dot mpg dot de
@ 2004-10-22 14:05 ` martin at mpa-garching dot mpg dot de
  2004-10-22 14:09 ` [Bug fortran/18111] " pinskia at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: martin at mpa-garching dot mpg dot de @ 2004-10-22 14:05 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
            Summary|[gfortran] spurious warnings|[gfortran] spurious warnings
                   |with -W -Wall               |with -W -Wunused


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18111


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug fortran/18111] spurious warnings with -W -Wunused
  2004-10-22 14:04 [Bug fortran/18111] New: [gfortran] spurious warnings with -W -Wall martin at mpa-garching dot mpg dot de
  2004-10-22 14:05 ` [Bug fortran/18111] [gfortran] spurious warnings with -W -Wunused martin at mpa-garching dot mpg dot de
@ 2004-10-22 14:09 ` pinskia at gcc dot gnu dot org
  2004-10-23 19:41 ` tobi at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-22 14:09 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-10-22 14:09 -------
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-10-22 14:09:47
               date|                            |
            Summary|[gfortran] spurious warnings|spurious warnings with -W -
                   |with -W -Wunused            |Wunused


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18111


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug fortran/18111] spurious warnings with -W -Wunused
  2004-10-22 14:04 [Bug fortran/18111] New: [gfortran] spurious warnings with -W -Wall martin at mpa-garching dot mpg dot de
  2004-10-22 14:05 ` [Bug fortran/18111] [gfortran] spurious warnings with -W -Wunused martin at mpa-garching dot mpg dot de
  2004-10-22 14:09 ` [Bug fortran/18111] " pinskia at gcc dot gnu dot org
@ 2004-10-23 19:41 ` tobi at gcc dot gnu dot org
  2004-10-26 11:15 ` martin at mpa-garching dot mpg dot de
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: tobi at gcc dot gnu dot org @ 2004-10-23 19:41 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From tobi at gcc dot gnu dot org  2004-10-23 19:41 -------
Patch here: http://gcc.gnu.org/ml/fortran/2004-10/msg00183.html

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18111


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug fortran/18111] spurious warnings with -W -Wunused
  2004-10-22 14:04 [Bug fortran/18111] New: [gfortran] spurious warnings with -W -Wall martin at mpa-garching dot mpg dot de
                   ` (2 preceding siblings ...)
  2004-10-23 19:41 ` tobi at gcc dot gnu dot org
@ 2004-10-26 11:15 ` martin at mpa-garching dot mpg dot de
  2004-10-26 11:23 ` martin at mpa-garching dot mpg dot de
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: martin at mpa-garching dot mpg dot de @ 2004-10-26 11:15 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From martin at mpa-garching dot mpg dot de  2004-10-26 11:15 -------
The patch indeed supresses the warnings about .__result.
But the problem appears to be more general. The following code
still generates a warning:

module linebufmod
implicit none
private

public linebuf_set

contains

subroutine linebuf_set (orig)
  character(len=80), dimension(:), intent(in) :: orig
  print *,orig
end subroutine linebuf_set

end module linebufmod

~/tmp>gfortran -W -Wunused -c gfbug.f90
gfbug.f90:5: warning: unused parameter '_orig'

It seems that it is issued for all array-shaped arguments of a
subroutine/function which is referenced in an interface statement or
something similar.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18111


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug fortran/18111] spurious warnings with -W -Wunused
  2004-10-22 14:04 [Bug fortran/18111] New: [gfortran] spurious warnings with -W -Wall martin at mpa-garching dot mpg dot de
                   ` (3 preceding siblings ...)
  2004-10-26 11:15 ` martin at mpa-garching dot mpg dot de
@ 2004-10-26 11:23 ` martin at mpa-garching dot mpg dot de
  2004-10-26 17:32 ` tobi at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: martin at mpa-garching dot mpg dot de @ 2004-10-26 11:23 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From martin at mpa-garching dot mpg dot de  2004-10-26 11:23 -------
Here is a more comprehensive example:

module foo
implicit none

contains

subroutine bar(arg1, arg2, arg3, arg4)
  character(len=80), intent(in) :: arg1
  character(len=80), dimension(:), intent(in) :: arg2
  integer, dimension(:), intent(in) :: arg3
  integer, intent(in) :: arg4

  print *, arg1, arg2, arg3, arg4
end subroutine bar

end module foo


~/tmp>gfortran -W -Wunused -c -O2 gfbug.f90
gfbug.f90:6: warning: unused parameter 'arg2'
gfbug.f90:6: warning: unused parameter 'arg3'
gfbug.f90:6: warning: unused parameter '_arg1'
gfbug.f90:6: warning: unused parameter '_arg2'

Note that there is no warning for arg4.
Note also that some of the warnings are only triggered with -O2.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18111


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug fortran/18111] spurious warnings with -W -Wunused
  2004-10-22 14:04 [Bug fortran/18111] New: [gfortran] spurious warnings with -W -Wall martin at mpa-garching dot mpg dot de
                   ` (4 preceding siblings ...)
  2004-10-26 11:23 ` martin at mpa-garching dot mpg dot de
@ 2004-10-26 17:32 ` tobi at gcc dot gnu dot org
  2004-11-05  8:31 ` martin at mpa-garching dot mpg dot de
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: tobi at gcc dot gnu dot org @ 2004-10-26 17:32 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From tobi at gcc dot gnu dot org  2004-10-26 17:32 -------
Updated patch which removes the warning for the string length parameters here:
http://gcc.gnu.org/ml/gcc-patches/2004-10/msg02210.html

I'm not yet sure why the other warnings happen.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18111


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug fortran/18111] spurious warnings with -W -Wunused
  2004-10-22 14:04 [Bug fortran/18111] New: [gfortran] spurious warnings with -W -Wall martin at mpa-garching dot mpg dot de
                   ` (5 preceding siblings ...)
  2004-10-26 17:32 ` tobi at gcc dot gnu dot org
@ 2004-11-05  8:31 ` martin at mpa-garching dot mpg dot de
  2004-11-05 11:20 ` Tobias dot Schlueter at physik dot uni-muenchen dot de
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: martin at mpa-garching dot mpg dot de @ 2004-11-05  8:31 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From martin at mpa-garching dot mpg dot de  2004-11-05 08:31 -------
Since the patch has been approved  
(http://gcc.gnu.org/ml/gcc-patches/2004-10/msg02547.html),  
could someone please commit it?  
Or is it better to wait for the complete fix?  
  

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18111


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug fortran/18111] spurious warnings with -W -Wunused
  2004-10-22 14:04 [Bug fortran/18111] New: [gfortran] spurious warnings with -W -Wall martin at mpa-garching dot mpg dot de
                   ` (6 preceding siblings ...)
  2004-11-05  8:31 ` martin at mpa-garching dot mpg dot de
@ 2004-11-05 11:20 ` Tobias dot Schlueter at physik dot uni-muenchen dot de
  2004-11-05 19:52 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Tobias dot Schlueter at physik dot uni-muenchen dot de @ 2004-11-05 11:20 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From Tobias dot Schlueter at physik dot uni-muenchen dot de  2004-11-05 11:20 -------
Subject: Re:  spurious warnings with -W -Wunused

martin at mpa-garching dot mpg dot de wrote:
> ------- Additional Comments From martin at mpa-garching dot mpg dot de  2004-11-05 08:31 -------
> Since the patch has been approved  
> (http://gcc.gnu.org/ml/gcc-patches/2004-10/msg02547.html),  
> could someone please commit it?  
> Or is it better to wait for the complete fix?  
>   
> 
I hope to get there today, I've had very little time for gfortran work recently.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18111


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug fortran/18111] spurious warnings with -W -Wunused
  2004-10-22 14:04 [Bug fortran/18111] New: [gfortran] spurious warnings with -W -Wall martin at mpa-garching dot mpg dot de
                   ` (7 preceding siblings ...)
  2004-11-05 11:20 ` Tobias dot Schlueter at physik dot uni-muenchen dot de
@ 2004-11-05 19:52 ` cvs-commit at gcc dot gnu dot org
  2004-11-05 20:03 ` tobi at gcc dot gnu dot org
  2005-01-09  4:46 ` giovannibajo at libero dot it
  10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-11-05 19:52 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-11-05 19:52 -------
Subject: Bug 18111

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	tobi@gcc.gnu.org	2004-11-05 19:52:06

Modified files:
	gcc/fortran    : ChangeLog trans-decl.c 

Log message:
	PR fortran/18111
	*  trans-decl.c (create_function_arglist): Set DECL_ARTIFICIAL for
	hidden parameters.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/ChangeLog.diff?cvsroot=gcc&r1=1.248&r2=1.249
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/trans-decl.c.diff?cvsroot=gcc&r1=1.47&r2=1.48



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18111


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug fortran/18111] spurious warnings with -W -Wunused
  2004-10-22 14:04 [Bug fortran/18111] New: [gfortran] spurious warnings with -W -Wall martin at mpa-garching dot mpg dot de
                   ` (8 preceding siblings ...)
  2004-11-05 19:52 ` cvs-commit at gcc dot gnu dot org
@ 2004-11-05 20:03 ` tobi at gcc dot gnu dot org
  2005-01-09  4:46 ` giovannibajo at libero dot it
  10 siblings, 0 replies; 12+ messages in thread
From: tobi at gcc dot gnu dot org @ 2004-11-05 20:03 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From tobi at gcc dot gnu dot org  2004-11-05 20:03 -------
The commit fixes the original issue, but not all of those mentioned in comment
#4. The remaining issues are related to arrays with descriptors.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18111


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug fortran/18111] spurious warnings with -W -Wunused
  2004-10-22 14:04 [Bug fortran/18111] New: [gfortran] spurious warnings with -W -Wall martin at mpa-garching dot mpg dot de
                   ` (9 preceding siblings ...)
  2004-11-05 20:03 ` tobi at gcc dot gnu dot org
@ 2005-01-09  4:46 ` giovannibajo at libero dot it
  10 siblings, 0 replies; 12+ messages in thread
From: giovannibajo at libero dot it @ 2005-01-09  4:46 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2005-01-09 04:46 -------
This breaks -Werror builds.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18111


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2005-01-09  4:46 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-22 14:04 [Bug fortran/18111] New: [gfortran] spurious warnings with -W -Wall martin at mpa-garching dot mpg dot de
2004-10-22 14:05 ` [Bug fortran/18111] [gfortran] spurious warnings with -W -Wunused martin at mpa-garching dot mpg dot de
2004-10-22 14:09 ` [Bug fortran/18111] " pinskia at gcc dot gnu dot org
2004-10-23 19:41 ` tobi at gcc dot gnu dot org
2004-10-26 11:15 ` martin at mpa-garching dot mpg dot de
2004-10-26 11:23 ` martin at mpa-garching dot mpg dot de
2004-10-26 17:32 ` tobi at gcc dot gnu dot org
2004-11-05  8:31 ` martin at mpa-garching dot mpg dot de
2004-11-05 11:20 ` Tobias dot Schlueter at physik dot uni-muenchen dot de
2004-11-05 19:52 ` cvs-commit at gcc dot gnu dot org
2004-11-05 20:03 ` tobi at gcc dot gnu dot org
2005-01-09  4:46 ` giovannibajo at libero dot it

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).