public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/30668]  New: catch function of wrong type
@ 2007-02-01 14:54 vivekrao4 at yahoo dot com
  2007-02-02  7:51 ` [Bug fortran/30668] " burnus at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: vivekrao4 at yahoo dot com @ 2007-02-01 14:54 UTC (permalink / raw)
  To: gcc-bugs

In the following program it would be nice if gfortran reported that two() has
type REAL in the main program because of implicit typing but actually has type
DOUBLE PRECISION. Below is what gfortran says and then what g95 says for
comparison.

U:\vrao\fortran>type bug_print.f90 
double precision function two()
two = 2.0d0
end function two

program xx
print*,two(),kind(two())
end program xx

U:\vrao\fortran>gfortran -v 
Using built-in specs.
Target: i386-pc-mingw32
Configured with: ../trunk/configure --prefix=/mingw
--enable-languages=c,fortran --with-gmp=/home/coudert/local --disable-nls
--with-ld=/mingw/bin/ld --with-as=/mingw/bin/as --disable-werror
--enable-bootstrap --enable-threads --host=i386-pc-mingw32 --disable-shared
--enable-libgomp
Thread model: win32
gcc version 4.3.0 20061021 (experimental)

U:\vrao\fortran>gfortran -W -Wall -pedantic-errors -std=f2003 -fbounds-check
-Werror bug_print.f90 

U:\vrao\fortran>a.exe
   2.000000               4

U:\vrao\fortran>g95 -v 
Using built-in specs.
Target: 
Configured with: /src/G95/gcc-4.0-20060302/configure --with-gcc --with-gnu-ld
--with-ld=/mingw/bin/ld --with-gnu-as --with-as=/mingw/bin/as --host=mingw32
--target=mingw32 --prefix=/mingw --enable-threads --disable-nls
--enable-languages=c --disable-win32-registry --disable-shared --without-x
--disable-libmudflap --disable-libssp
Thread model: win32
gcc version 4.0.3 (g95 0.91!) Jan 23 2007

U:\vrao\fortran>g95 -Wall -pedantic -fbounds-check -ftrace=full bug_print.f90 
In file bug_print.f90:1

double precision function two()
                          1
In file bug_print.f90:6

print*,two(),kind(two())
       2
Error: FUNCTION 'two' is of type REAL(8) at (1) and type REAL(4) at (2)

This program was discussed in the gg95 newsgroup in a thread "bug with double
precision function" at
http://groups.google.com/group/gg95/browse_frm/thread/73ea96b2925195f0?hl=en


-- 
           Summary: catch function of wrong type
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: vivekrao4 at yahoo dot com


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


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

end of thread, other threads:[~2010-07-18 21:13 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-01 14:54 [Bug fortran/30668] New: catch function of wrong type vivekrao4 at yahoo dot com
2007-02-02  7:51 ` [Bug fortran/30668] " burnus at gcc dot gnu dot org
2007-03-18 17:53 ` fxcoudert at gcc dot gnu dot org
2009-04-09 17:15 ` pinskia at gcc dot gnu dot org
2009-05-03 13:53 ` [Bug fortran/30668] -fwhole-file should " fxcoudert at gcc dot gnu dot org
2009-12-15  8:44 ` burnus at gcc dot gnu dot org
2010-05-25 18:10 ` dfranke at gcc dot gnu dot org
2010-07-18 20:50 ` dfranke at gcc dot gnu dot org
2010-07-18 21:13 ` dfranke 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).