public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/34495]  New: [4.3 Regression] accepts invalid initialization expressions with -std=f95
@ 2007-12-16 13:38 tkoenig at gcc dot gnu dot org
  2007-12-16 14:35 ` [Bug fortran/34495] " burnus at gcc dot gnu dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2007-12-16 13:38 UTC (permalink / raw)
  To: gcc-bugs

Adapted from a test case from c.l.f, from James van Buskirk
:
$ cat foo.f90 
program main
   integer, parameter :: ipi = 1078530011
   real pi
   parameter(pi=transfer(ipi,pi))
   real, parameter :: z = transfer(ipi,z)
   real, parameter :: y = real(1,kind(y))

   write(*,*) pi, z, y
end
$ gfortran -std=f95 -pedantic foo.f90 
$ ./a.out
   3.1415927       3.1415927      1.00000000 

JvB's explanation:

# the second
# and third treat transfer as a specification inquiry even thought
# that is not permitted even in f03, and the fourth has that pesky
# REAL intrinsic, which is not an elemental function of type integer
# or character.

gfortran 4.2 still generates some error messages:

$ gfortran-4.2 foo.f90 
foo.f90:4.29:

   parameter(pi=transfer(ipi,pi))
                            1
Error: Parameter 'pi' at (1) has not been declared or is a variable, which does
not reduce to a constant expression
foo.f90:5.35:

   real, parameter :: z = transfer(ipi,z)
                                  1
Error: TRANSFER intrinsic not implemented for initialization at (1)


-- 
           Summary: [4.3 Regression] accepts invalid initialization
                    expressions with -std=f95
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid, diagnostic
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tkoenig at gcc dot gnu dot org


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


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

end of thread, other threads:[~2007-12-18 23:42 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-16 13:38 [Bug fortran/34495] New: [4.3 Regression] accepts invalid initialization expressions with -std=f95 tkoenig at gcc dot gnu dot org
2007-12-16 14:35 ` [Bug fortran/34495] " burnus at gcc dot gnu dot org
2007-12-16 15:15 ` burnus at gcc dot gnu dot org
2007-12-16 22:13 ` burnus at gcc dot gnu dot org
2007-12-16 22:14 ` burnus at gcc dot gnu dot org
2007-12-17 14:35 ` burnus at gcc dot gnu dot org
2007-12-17 18:45 ` burnus at gcc dot gnu dot org
2007-12-17 19:01 ` burnus at gcc dot gnu dot org
2007-12-17 22:34 ` [Bug fortran/34495] [4.3 Regression] accepts invalid initialization expressions withTRANSFER dfranke at gcc dot gnu dot org
2007-12-18 23:40 ` dfranke at gcc dot gnu dot org
2007-12-18 23:41 ` dfranke at gcc dot gnu dot org
2007-12-18 23:42 ` 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).