This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


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

Re: PATCH for bad error message


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


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