Bootstrap failure (Re: [Patch] Java: Prepare for %q, %< and %> in diagnostic messages)

Ulrich Weigand weigand@i1.informatik.uni-erlangen.de
Tue Oct 5 20:12:00 GMT 2004


Hello,

this causes bootstrap failure on s390(x) and presumably all other
platforms where va_list is an array type.

Note that if va_list is an array type, it decays to a pointer
when used a formal parameter like here:
>@@ -3141,7 +3143,7 @@ issue_warning_error_from_context (
>+				  const char *msgid, va_list ap)

and thus &ap does *not* have type va_list *, so this assignment
>+  text.args_ptr = ≈
fails due to type mismatch.

The patch below fixes the problem by passing in a va_list *
to issue_warning_error_from_context in the first place.

Bootstrapped/regtested on s390-ibm-linux and s390x-ibm-linux.
OK for mainline?

Bye,
Ulrich


ChangeLog:

	* parse.y (issue_warning_error_from_context): Use va_list *
	instead of va_list parameter.
	(parse_error_context): Update call.
	(parse_warning_context): Likewise.

Index: gcc/java/parse.y
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/parse.y,v
retrieving revision 1.515
diff -c -p -r1.515 parse.y
*** gcc/java/parse.y	5 Oct 2004 17:07:14 -0000	1.515
--- gcc/java/parse.y	5 Oct 2004 18:24:06 -0000
*************** static void parse_warning_context (tree 
*** 101,109 ****
    ATTRIBUTE_PRINTF_2;
  #ifdef USE_MAPPED_LOCATION
  static void issue_warning_error_from_context
!   (source_location, const char *msg, va_list) ATTRIBUTE_PRINTF (2, 0);
  #else
! static void issue_warning_error_from_context (tree, const char *msg, va_list)
    ATTRIBUTE_PRINTF (2, 0);
  #endif
  static void parse_ctor_invocation_error (void);
--- 101,109 ----
    ATTRIBUTE_PRINTF_2;
  #ifdef USE_MAPPED_LOCATION
  static void issue_warning_error_from_context
!   (source_location, const char *msg, va_list *) ATTRIBUTE_PRINTF (2, 0);
  #else
! static void issue_warning_error_from_context (tree, const char *msg, va_list *)
    ATTRIBUTE_PRINTF (2, 0);
  #endif
  static void parse_ctor_invocation_error (void);
*************** issue_warning_error_from_context (
*** 3143,3149 ****
  #else
  				  tree cl,
  #endif
! 				  const char *msgid, va_list ap)
  {
  #ifdef USE_MAPPED_LOCATION
    source_location saved_location = input_location;
--- 3143,3149 ----
  #else
  				  tree cl,
  #endif
! 				  const char *msgid, va_list *ap)
  {
  #ifdef USE_MAPPED_LOCATION
    source_location saved_location = input_location;
*************** issue_warning_error_from_context (
*** 3156,3162 ****
    text_info text;
  
    text.err_no = errno;
!   text.args_ptr = ≈
    text.format_spec = msgid;
    pp_format_text (global_dc->printer, &text);
    strncpy (buffer, pp_formatted_text (global_dc->printer), sizeof (buffer) - 1);
--- 3156,3162 ----
    text_info text;
  
    text.err_no = errno;
!   text.args_ptr = ap;
    text.format_spec = msgid;
    pp_format_text (global_dc->printer, &text);
    strncpy (buffer, pp_formatted_text (global_dc->printer), sizeof (buffer) - 1);
*************** parse_error_context (tree cl, const char
*** 3204,3212 ****
    va_list ap;
    va_start (ap, msgid);
  #ifdef USE_MAPPED_LOCATION
!   issue_warning_error_from_context (EXPR_LOCATION (cl), msgid, ap);
  #else
!   issue_warning_error_from_context (cl, msgid, ap);
  #endif
    va_end (ap);
  }
--- 3204,3212 ----
    va_list ap;
    va_start (ap, msgid);
  #ifdef USE_MAPPED_LOCATION
!   issue_warning_error_from_context (EXPR_LOCATION (cl), msgid, &ap);
  #else
!   issue_warning_error_from_context (cl, msgid, &ap);
  #endif
    va_end (ap);
  }
*************** parse_warning_context (tree cl, const ch
*** 3222,3230 ****
  
    do_warning = 1;
  #ifdef USE_MAPPED_LOCATION
!   issue_warning_error_from_context (EXPR_LOCATION (cl), msgid, ap);
  #else
!   issue_warning_error_from_context (cl, msgid, ap);
  #endif
    do_warning = 0;
    va_end (ap);
--- 3222,3230 ----
  
    do_warning = 1;
  #ifdef USE_MAPPED_LOCATION
!   issue_warning_error_from_context (EXPR_LOCATION (cl), msgid, &ap);
  #else
!   issue_warning_error_from_context (cl, msgid, &ap);
  #endif
    do_warning = 0;
    va_end (ap);
-- 
  Dr. Ulrich Weigand
  weigand@informatik.uni-erlangen.de



More information about the Gcc-patches mailing list