From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29656 invoked by alias); 5 Jan 2007 14:46:02 -0000 Received: (qmail 29148 invoked by alias); 5 Jan 2007 14:45:46 -0000 Date: Fri, 05 Jan 2007 14:46:00 -0000 Message-ID: <20070105144546.29142.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/27996] Compile time warn for: character(2) :: str = 'ABC' (expression truncated) In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "pault at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-01/txt/msg00287.txt.bz2 ------- Comment #3 from pault at gcc dot gnu dot org 2007-01-05 14:45 ------- Subject: Bug 27996 Author: pault Date: Fri Jan 5 14:45:20 2007 New Revision: 120485 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=120485 Log: 2007-01-05 Paul Thomas PR fortran/23232 * decl.c (gfc_in_match_data, gfc_set_in_match_data): New functions to signal that a DATA statement is being matched. (gfc_match_data): Call gfc_set_in_match_data on entry and on exit. * gfortran.h : Add prototypes for above. * expr.c (check_init_expr): Avoid check on parameter or variable if gfc_in_match_data is true. (gfc_match_init_expr): Do not call error on non-reduction of expression if gfc_in_match_data is true. PR fortran/27996 PR fortran/27998 * decl.c (gfc_set_constant_character_len): Add boolean arg to flag array constructor resolution. Warn if string is being truncated. Standard dependent error if string is padded. Set new arg to false for all three calls to gfc_set_constant_character_len. * match.h : Add boolean arg to prototype for gfc_set_constant_character_len. * gfortran.h : Add warn_character_truncation to gfc_options. * options.c (set_Wall): Set warn_character_truncation if -Wall is set. * resolve.c (resolve_code): Warn if rhs string in character assignment has to be truncated. * array.c (gfc_resolve_character_array_constructor): Set new argument to true for call to gfc_set_constant_character_len. 2007-01-05 Paul Thomas PR fortran/23232 * gfortran.dg/data_implied_do_1.f90: New test. PR fortran/27996 PR fortran/27998 * gfortran.dg/char_length_1.f90: New test. Added: trunk/gcc/testsuite/gfortran.dg/data_implied_do_1.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/array.c trunk/gcc/fortran/decl.c trunk/gcc/fortran/expr.c trunk/gcc/fortran/gfortran.h trunk/gcc/fortran/match.h trunk/gcc/fortran/options.c trunk/gcc/fortran/resolve.c trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gfortran.dg/char_length_1.f90 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27996