Commit cce283c7 by Toon Moene Committed by Toon Moene

re PR fortran/26054 (Gratuitous warning about Fortran 2003 features w/o -std=...)

2006-02-15  Toon Moene  <toon@moene.indiv.nluug.nl>

	PR fortran/26054
	* fortran/options.c: Do not warn for Fortran 2003 features
	by default.
	* testsuite/gfortran.dg/enum_8.f90: Remove check for warning.
	* testsuite/gfortran.dg/iomsg_1.f90: Ditto.
	* testsuite/gfortran.dg/enum_1.f90: Ditto.
	* testsuite/gfortran.dg/enum_9.f90: Ditto.
	* testsuite/gfortran.dg/enum_2.f90: Ditto.
	* testsuite/gfortran.dg/enum_10.f90: Ditto.
	* testsuite/gfortran.dg/enum_3.f90: Ditto.
	* testsuite/gfortran.dg/flush_1.f90: Ditto.
	* testsuite/gfortran.dg/enum_4.f90: Ditto.
	* testsuite/gfortran.dg/array_constructor_1.f90: Ditto.
	* testsuite/gfortran.dg/enum_5.f90: Ditto.
	* testsuite/gfortran.dg/enum_6.f90: Ditto.
	* testsuite/gfortran.dg/enum_7.f90: Ditto.

From-SVN: r111117
parent 01ea23f3
2006-02-15 Toon Moene <toon@moene.indiv.nluug.nl>
PR fortran/26054
* options.c: Do not warn for Fortran 2003 features by default.
2006-02-15 Tobias Schlter <tobias.schlueter@physik.uni-muenchen.de>
* check.c: Update copyright years.
......
......@@ -90,7 +90,7 @@ gfc_init_options (unsigned int argc ATTRIBUTE_UNUSED,
| GFC_STD_F2003 | GFC_STD_F95 | GFC_STD_F77 | GFC_STD_GNU
| GFC_STD_LEGACY;
gfc_option.warn_std = GFC_STD_F95_OBS | GFC_STD_F95_DEL
| GFC_STD_F2003 | GFC_STD_LEGACY;
| GFC_STD_LEGACY;
gfc_option.warn_nonstd_intrinsics = 0;
......
2006-02-15 Toon Moene <toon@moene.indiv.nluug.nl>
PR fortran/26054
* gfortran.dg/enum_8.f90: Remove check for warning.
* gfortran.dg/iomsg_1.f90: Ditto.
* gfortran.dg/enum_1.f90: Ditto.
* gfortran.dg/enum_9.f90: Ditto.
* gfortran.dg/enum_2.f90: Ditto.
* gfortran.dg/enum_10.f90: Ditto.
* gfortran.dg/enum_3.f90: Ditto.
* gfortran.dg/flush_1.f90: Ditto.
* gfortran.dg/enum_4.f90: Ditto.
* gfortran.dg/array_constructor_1.f90: Ditto.
* gfortran.dg/enum_5.f90: Ditto.
* gfortran.dg/enum_6.f90: Ditto.
* gfortran.dg/enum_7.f90: Ditto.
2006-02-15 Jakub Jelinek <jakub@redhat.com>
PR middle-end/26300
......@@ -4,12 +4,12 @@ program bracket_array_constructor
implicit none
integer :: a(4), i
a = [ 1, 2, 3, 4 ] ! { dg-warning "array constructor" }
a = [ 1, 2, 3, 4 ]
do i = 1, size(a)
if (a(i) /= i) call abort()
end do
a = [ (/ 1, 2, 3, 4 /) ] ! { dg-warning "array constructor" }
a = [ (/ 1, 2, 3, 4 /) ]
do i = 1, size(a)
if (a(i) /= i) call abort()
end do
......
......@@ -3,7 +3,7 @@
program main
implicit none
enum, bind (c) ! { dg-warning "New in Fortran 2003" }
enum, bind (c)
enumerator :: red, black
enumerator blue
end enum
......
......@@ -5,15 +5,15 @@
! corresponding C type.
module enum_10
enum, bind( c ) ! { dg-warning "New in Fortran 2003" }
enum, bind( c )
enumerator :: one1 = 1, two1, max1 = huge(1_1)
end enum
enum, bind( c ) ! { dg-warning "New in Fortran 2003" }
enum, bind( c )
enumerator :: one2 = 1, two2, max2 = huge(1_2)
end enum
enum, bind( c ) ! { dg-warning "New in Fortran 2003" }
enum, bind( c )
enumerator :: one4 = 1, two4, max4 = huge(1_4)
end enum
end module enum_10
......
......@@ -3,7 +3,7 @@
program main
implicit none
enum, bind (c) ! { dg-warning "New in Fortran 2003" }
enum, bind (c)
enumerator :: red, black
integer :: x ! { dg-error "Unexpected data declaration" }
enumerator blue = 1 ! { dg-error "Syntax error in ENUMERATOR definition" }
......
......@@ -3,7 +3,7 @@
program main
implicit none
enum, bind (c) ! { dg-warning "New in Fortran 2003" }
enum, bind (c)
enumerator :: red, black = 2.2 ! { dg-error "initialized with integer expression" }
enumerator :: blue = "x" ! { dg-error "initialized with integer expression" }
end enum ! { dg-error "has no ENUMERATORS" }
......
......@@ -3,12 +3,12 @@
program main
implicit none
enum, bind (c) ! { dg-warning "New in Fortran 2003" }
enum, bind (c)
enumerator :: red, black = 2
enumerator :: blue = 1, red ! { dg-error "already" }
end enum
enum, bind (c) ! { dg-warning "New in Fortran 2003" }
enum, bind (c)
enumerator :: r, b(10) = 2 ! { dg-error "cannot be array" }
enumerator , save :: g = 1 ! { dg-error "cannot have attributes" }
end ! { dg-error " END ENUM" }
......
......@@ -5,7 +5,7 @@ program main
implicit none
integer :: i = 1
enum, bind (c) ! { dg-warning "New in Fortran 2003" }
enum, bind (c)
enumerator :: red, black = i ! { dg-error "is a variable" }
enumerator :: blue = 1
end enum junk ! { dg-error "Syntax error" }
......
......@@ -5,7 +5,7 @@ program main
implicit none
integer :: i = 1
enum, bind (c) ! { dg-warning "New in Fortran 2003" }
enum, bind (c)
enumerator :: sun, mon = 2
i = 2 ! { dg-error "Unexpected" }
enumerator :: wed = 1
......
......@@ -4,7 +4,7 @@
program main
implicit none
enum, bind (c) ! { dg-warning "New in Fortran 2003" }
enum, bind (c)
enumerator :: sun, mon = 2
enum, bind (c) ! { dg-error "Unexpected" }
enumerator :: apple, mango
......
......@@ -4,11 +4,11 @@
program main
implicit none
enum, bind (c) ! { dg-warning "New in Fortran 2003" }
enum, bind (c)
enumerator :: pp , qq = 4294967295, rr ! { dg-error "not initialized with integer" }
end enum ! { dg-error "has no ENUMERATORS" }
enum, bind (c) ! { dg-warning "New in Fortran 2003" }
enum, bind (c)
enumerator :: p , q = 4294967299_8, r ! { dg-error "Arithmetic overflow" }
end enum ! { dg-error "has no ENUMERATORS" }
......
......@@ -4,7 +4,7 @@
program main
implicit none
enum, bind (c) ! { dg-warning "New in Fortran 2003" }
enum, bind (c)
enumerator :: red, black = 127
enumerator blue
end enum
......
......@@ -8,17 +8,17 @@ program flush_1
open (unit=10, access='SEQUENTIAL', status='SCRATCH')
write (10, *) 42
flush 10 ! { dg-warning "Fortran 2003: FLUSH statement" }
flush 10
write (10, *) 42
flush(10) ! { dg-warning "Fortran 2003: FLUSH statement" }
flush(10)
write (10, *) 42
flush(unit=10, iostat=ios) ! { dg-warning "Fortran 2003: FLUSH statement" }
flush(unit=10, iostat=ios)
if (ios /= 0) call abort
write (10, *) 42
flush (unit=10, err=20) ! { dg-warning "Fortran 2003: FLUSH statement" }
flush (unit=10, err=20)
goto 30
20 call abort
30 continue
......
......@@ -5,24 +5,24 @@ program iomsg_test
! Test that iomsg is left unchanged with no error
ch = 'asdf'
open(10, status='scratch', iomsg=ch, iostat=i) ! { dg-warning "Fortran 2003: IOMSG tag" }
open(10, status='scratch', iomsg=ch, iostat=i)
if (ch .ne. 'asdf') call abort
! Test iomsg with data transfer statement
read(10,'(I2)', iomsg=ch, end=100) k ! { dg-warning "Fortran 2003: IOMSG tag" }
read(10,'(I2)', iomsg=ch, end=100) k
call abort
100 continue
if (ch .ne. 'End of file') call abort
! Test iomsg with open
open (-3, err=200, iomsg=ch) ! { dg-warning "Fortran 2003: IOMSG tag" }
open (-3, err=200, iomsg=ch)
call abort
200 continue
if (ch .ne. 'Bad unit number in OPEN statement') call abort
! Test iomsg with close
close(23,status="no_idea", err=500, iomsg=ch) ! { dg-warning "Fortran 2003: IOMSG tag" }
close(23,status="no_idea", err=500, iomsg=ch)
500 continue
if (ch .ne. "Bad STATUS parameter in CLOSE statement") call abort
end program iomsg_test
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment