PATCH for bad error message

Tom Tromey tromey@cygnus.com
Wed Sep 9 14:39:00 GMT 1998


Mark> we used to say:

Mark>   test5.C:4: parameter type `int (&)[]' includes pointer to array of
Mark>   unknown bound

Mark> Pointers, what pointers?  This patch causes us to use
Mark> `reference' instead, if appropriate.

FYI, code like that in your patch is i18n-unfriendly.  This will have
to be rewritten once the gettextization changes go in.

Mark> ! 			cp_error ("parameter type `%T' includes %s to array of unknown bound",
Mark> ! 				  type,
Mark> ! 				  TYPE_PTR_P (type) ? "pointer" : "reference");

The i18n-friendly way is to use two messages.

	if (TYPE_PTR_P (type))
	  cp_error ("parameter type `%t' includes pointer ...")
	else
	  ...

Tom



More information about the Gcc-patches mailing list