This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFA: score-tdep.c: avoid mixed declarations and statements


> 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  <jimb@codesourcery.com>
> 
>    * 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.  */

OK.

Best regards,
Qinwei
Mail  qinwei@sunnorth.com.cn
Phone +86-010-62981668-2708
Fax   +86-010-62985972


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]