This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[gfortran] Silence GNU extension warnings with -std=gnu
- From: Roger Sayle <roger at eyesopen dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: fortran at gcc dot gnu dot org
- Date: Sat, 22 May 2004 21:06:27 -0600 (MDT)
- Subject: [gfortran] Silence GNU extension warnings with -std=gnu
I'd like to propose the single line patch to the gfortran front-end.
Currently the gfortran compiler issues a warning for each use of a
GNU fortran extension, both by default and also when the user explicitly
specifies -std=gnu. This behaves differently from -std=f2003, for
example, where we warn about use of f2003 extensions by default, but
silence them when the -std=f2003 command line option is given. The
single line change below, keeps these options consistent and prevents
warning about GNU extensions when using -std=gnu.
The following patch has been tested on i686-pc-linux-gnu with a full
bootstrap, including gfortran, and regression tested with a top-level
"make -k check" with no new failures.
Thoughts? Ok for mainline?
2004-05-22 Roger Sayle <roger@eyesopen.com>
* options.c (gfc_handle_option): Don't warn about the use of
GNU extensions when the user explicitly specifies -std=gnu.
Index: options.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/options.c,v
retrieving revision 1.4
diff -c -3 -p -r1.4 options.c
*** options.c 16 May 2004 21:10:24 -0000 1.4
--- options.c 22 May 2004 23:59:27 -0000
*************** gfc_handle_option (size_t scode, const c
*** 313,319 ****
gfc_option.allow_std = GFC_STD_F95_OBS | GFC_STD_F95_DEL
| GFC_STD_F2003_OBS | GFC_STD_F2003_DEL | GFC_STD_F2003 | GFC_STD_GNU;
gfc_option.warn_std = GFC_STD_F95_OBS | GFC_STD_F95_DEL
! | GFC_STD_F2003_OBS | GFC_STD_F2003_DEL | GFC_STD_GNU;
break;
}
--- 313,319 ----
gfc_option.allow_std = GFC_STD_F95_OBS | GFC_STD_F95_DEL
| GFC_STD_F2003_OBS | GFC_STD_F2003_DEL | GFC_STD_F2003 | GFC_STD_GNU;
gfc_option.warn_std = GFC_STD_F95_OBS | GFC_STD_F95_DEL
! | GFC_STD_F2003_OBS | GFC_STD_F2003_DEL;
break;
}
Roger
--
Roger Sayle, E-mail: roger@eyesopen.com
OpenEye Scientific Software, WWW: http://www.eyesopen.com/
Suite 1107, 3600 Cerrillos Road, Tel: (+1) 505-473-7385
Santa Fe, New Mexico, 87507. Fax: (+1) 505-473-0833