Fix bootstrap

View: New views
4 Messages — Rating Filter:   Alert me  

Fix bootstrap

by Richard Guenther-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Committed as obvious.

Richard.

2009-11-03  Richard Guenther  <rguenther@...>

        * c-common.c (fold_offsetof_1): Use HOST_WIDE_INT_PRINT_DEC.

Index: gcc/c-common.c
===================================================================
*** gcc/c-common.c (revision 153844)
--- gcc/c-common.c (working copy)
*************** fold_offsetof_1 (tree expr, tree stop_re
*** 8403,8409 ****
          HOST_WIDE_INT index = int_cst_value (t);
  if (index > int_cst_value (nelts))
   warning (OPT_Warray_bounds,
!   "index %ld denotes an offset greater than size of %qT",
    index, TREE_TYPE (TREE_OPERAND (expr, 0)));
        }
        break;
--- 8403,8410 ----
          HOST_WIDE_INT index = int_cst_value (t);
  if (index > int_cst_value (nelts))
   warning (OPT_Warray_bounds,
!   "index " HOST_WIDE_INT_PRINT_DEC " denotes an offset "
!   "greater than size of %qT",
    index, TREE_TYPE (TREE_OPERAND (expr, 0)));
        }
        break;

Re: Fix bootstrap

by Joseph S. Myers :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, 3 Nov 2009, Richard Guenther wrote:

> Committed as obvious.
>
> Richard.
>
> 2009-11-03  Richard Guenther  <rguenther@...>
>
> * c-common.c (fold_offsetof_1): Use HOST_WIDE_INT_PRINT_DEC.

This is not obvious.  You can't use HOST_WIDE_INT_PRINT_* in diagnostics
as:

(a) HOST_WIDE_INT_PRINT_* are host printf formats, not necessarily
understood by GCC's pretty-printing code.

(b) A single text for each diagnostic, not depending on the host, gets
extracted to gcc.pot, so it can't involve concatenation with
host-dependent macros.

You should be using %wd, which the pretty-printing code will map to
formatting a HOST_WIDE_INT in the appropriate way.

--
Joseph S. Myers
joseph@...

Re: Fix bootstrap

by Jakub Jelinek :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Nov 03, 2009 at 04:55:54PM +0000, Joseph S. Myers wrote:
> You should be using %wd, which the pretty-printing code will map to
> formatting a HOST_WIDE_INT in the appropriate way.

I've committed this to trunk/4.4:

2009-11-04  Jakub Jelinek  <jakub@...>

        * c-common.c (fold_offsetof_1): Use %wd instead of
        HOST_WIDE_INT_PRINT_DEC.

--- gcc/c-common.c.jj 2009-11-03 23:33:32.000000000 +0100
+++ gcc/c-common.c 2009-11-04 08:22:02.000000000 +0100
@@ -8403,8 +8403,7 @@ fold_offsetof_1 (tree expr, tree stop_re
         HOST_WIDE_INT index = int_cst_value (t);
  if (index > int_cst_value (nelts))
   warning (OPT_Warray_bounds,
-   "index " HOST_WIDE_INT_PRINT_DEC " denotes an offset "
-   "greater than size of %qT",
+   "index %wd denotes an offset greater than size of %qT",
    index, TREE_TYPE (TREE_OPERAND (expr, 0)));
       }
       break;


        Jakub

Re: Fix bootstrap

by Richard Guenther-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, 4 Nov 2009, Jakub Jelinek wrote:

> On Tue, Nov 03, 2009 at 04:55:54PM +0000, Joseph S. Myers wrote:
> > You should be using %wd, which the pretty-printing code will map to
> > formatting a HOST_WIDE_INT in the appropriate way.
>
> I've committed this to trunk/4.4:

Thanks.

Richard.