From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26767 invoked by alias); 8 Jan 2007 23:03:37 -0000 Received: (qmail 26759 invoked by uid 22791); 8 Jan 2007 23:03:37 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 08 Jan 2007 23:03:33 +0000 Received: (qmail 24722 invoked from network); 8 Jan 2007 23:03:31 -0000 Received: from unknown (HELO localhost) (jimb@127.0.0.2) by mail.codesourcery.com with ESMTPA; 8 Jan 2007 23:03:31 -0000 To: qinwei@sunnorth.com.cn CC: gdb-patches@sourceware.org Subject: RFA: score-tdep.c: avoid mixed declarations and statements From: Jim Blandy Date: Mon, 08 Jan 2007 23:03:00 -0000 Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-01/txt/msg00249.txt.bz2 We recently added -Wdeclaration-after-statement to GDB's set of build warnings, which caught the new S+core port. Okay to commit? gdb/ChangeLog: 2007-01-08 Jim Blandy * score-tdep.c (score_push_dummy_call): Don't mix declarations and statements. ? gdb/autom4te.cache Index: gdb/score-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/score-tdep.c,v retrieving revision 1.1 diff -u -p -r1.1 score-tdep.c --- gdb/score-tdep.c 4 Jan 2007 07:09:54 -0000 1.1 +++ gdb/score-tdep.c 8 Jan 2007 22:57:33 -0000 @@ -435,14 +435,15 @@ score_push_dummy_call (struct gdbarch *g { struct value *arg = args[argnum]; struct type *arg_type = check_typedef (value_type (arg)); - arglen = TYPE_LENGTH (arg_type); enum type_code typecode = TYPE_CODE (arg_type); const gdb_byte *val = value_contents (arg); int downward_offset = 0; + int odd_sized_struct_p; + int arg_last_part_p = 0; - int odd_sized_struct_p = (arglen > SCORE_REGSIZE + arglen = TYPE_LENGTH (arg_type); + odd_sized_struct_p = (arglen > SCORE_REGSIZE && arglen % SCORE_REGSIZE != 0); - int arg_last_part_p = 0; /* If a arg should be aligned to 8 bytes (long long or double), the value should be put to even register numbers. */