public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/39996]  New: Double typing of function results not detected
@ 2009-05-01 19:26 burnus at gcc dot gnu dot org
  2009-05-05 20:35 ` [Bug fortran/39996] " janus at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: burnus at gcc dot gnu dot org @ 2009-05-01 19:26 UTC (permalink / raw)
  To: gcc-bugs

Found at c.l.f where Giorgio Pastore reported it.
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/a48b6b038baabd90

gfortran -std=f95 does not detect the following:

  interface
     function square (x) result (s)
     real,intent (in) ::x
     real ::s
     end function square
  end interface

  real :: square ! <<<<<<<<<< Wrong!

ifort prints:
error #6409: This name has already been used as an external procedure name.  
[SQUARE]
 real :: square

And NAG f95:
Error: hjff.f90, line 24: Multiply defined symbol SQUARE
       detected at ::@SQUARE
Error: hjff.f90, line 24: Duplicate type declaration for SQUARE
       detected at ::@SQUARE


-- 
           Summary: Double typing of function results not detected
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


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


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

* [Bug fortran/39996] Double typing of function results not detected
  2009-05-01 19:26 [Bug fortran/39996] New: Double typing of function results not detected burnus at gcc dot gnu dot org
@ 2009-05-05 20:35 ` janus at gcc dot gnu dot org
  2009-05-09 20:53 ` janus at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: janus at gcc dot gnu dot org @ 2009-05-05 20:35 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from janus at gcc dot gnu dot org  2009-05-05 20:35 -------
Extended test case, including six similar cases, of which only the first three
are detected (comment #0 corresponds to case 'E'):

  ! Detected:
  interface
    real function A ()
    end function
  end interface
  real :: A ! Error: Symbol 'a' at (1) already has basic type of REAL

  ! Detected:
  real :: B
  interface
    real function B () ! Error: Function 'b' at (1) already has a type of REAL
    end function
  end interface

  ! Detected:
  interface
    function C ()
      real :: C
    end function
  end interface
  real :: C ! Error: Symbol 'c' at (1) already has basic type of REAL

  ! Not Detected:
  real :: D
  interface
    function D ()
      real :: D
    end function
  end interface

  ! Not Detected:
  interface
    function E () result (s)
      real ::s
    end function
  end interface
  real :: E

  ! Not Detected:
  real :: F
  interface
    function F () result (s)
      real ::s
    end function F
  end interface

end


-- 

janus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2009-05-05 20:35:34
               date|                            |


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


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

* [Bug fortran/39996] Double typing of function results not detected
  2009-05-01 19:26 [Bug fortran/39996] New: Double typing of function results not detected burnus at gcc dot gnu dot org
  2009-05-05 20:35 ` [Bug fortran/39996] " janus at gcc dot gnu dot org
@ 2009-05-09 20:53 ` janus at gcc dot gnu dot org
  2009-05-14  9:42 ` janus at gcc dot gnu dot org
  2009-05-14  9:46 ` janus at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: janus at gcc dot gnu dot org @ 2009-05-09 20:53 UTC (permalink / raw)
  To: gcc-bugs



-- 

janus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |janus at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2009-05-05 20:35:34         |2009-05-09 20:53:00
               date|                            |


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


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

* [Bug fortran/39996] Double typing of function results not detected
  2009-05-01 19:26 [Bug fortran/39996] New: Double typing of function results not detected burnus at gcc dot gnu dot org
  2009-05-05 20:35 ` [Bug fortran/39996] " janus at gcc dot gnu dot org
  2009-05-09 20:53 ` janus at gcc dot gnu dot org
@ 2009-05-14  9:42 ` janus at gcc dot gnu dot org
  2009-05-14  9:46 ` janus at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: janus at gcc dot gnu dot org @ 2009-05-14  9:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from janus at gcc dot gnu dot org  2009-05-14 09:42 -------
Subject: Bug 39996

Author: janus
Date: Thu May 14 09:41:41 2009
New Revision: 147528

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=147528
Log:
2009-05-14  Janus Weil  <janus@gcc.gnu.org>

        PR fortran/39996
        * decl.c (gfc_match_function_decl): Use gfc_add_type.
        * symbol.c (gfc_add_type): Better checking for duplicate types in
        function declarations. And: Always give an error for duplicte types,
        not just a warning with -std=gnu.


2009-05-14  Janus Weil  <janus@gcc.gnu.org>

        PR fortran/39996
        * gfortran.dg/func_decl_2.f90: Modified (replacing warnings by errors).
        * gfortran.dg/duplicate_type_2.f90: Ditto.
        * gfortran.dg/duplicate_type_3.f90: New.


Added:
    trunk/gcc/testsuite/gfortran.dg/duplicate_type_3.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/decl.c
    trunk/gcc/fortran/symbol.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/duplicate_type_2.f90
    trunk/gcc/testsuite/gfortran.dg/func_decl_2.f90


-- 


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


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

* [Bug fortran/39996] Double typing of function results not detected
  2009-05-01 19:26 [Bug fortran/39996] New: Double typing of function results not detected burnus at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2009-05-14  9:42 ` janus at gcc dot gnu dot org
@ 2009-05-14  9:46 ` janus at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: janus at gcc dot gnu dot org @ 2009-05-14  9:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from janus at gcc dot gnu dot org  2009-05-14 09:46 -------
Fixed with r147528. Closing.


-- 

janus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


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

end of thread, other threads:[~2009-05-14  9:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-01 19:26 [Bug fortran/39996] New: Double typing of function results not detected burnus at gcc dot gnu dot org
2009-05-05 20:35 ` [Bug fortran/39996] " janus at gcc dot gnu dot org
2009-05-09 20:53 ` janus at gcc dot gnu dot org
2009-05-14  9:42 ` janus at gcc dot gnu dot org
2009-05-14  9:46 ` janus at gcc dot gnu dot org

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).