This is the mail archive of the 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]
Other format: [Raw text]

[Ada] fix processing of wide_value'value

Tested on i686-linux, committed on trunk.

The approach in GNAT to processing Wide_Value'Value (wide_string) (and
same for the wide_wide case) is to convert the wide string to a standard
string with encodings. Then the routine for Wide_Value'Value (string) is
called. Unfortunately the latter did not properly handle the resulting
string of the form quote-encoded_wide_character-quote and raised an
incorrect exception. This patch corrects that omission.

gnat.dg/wide_test.adb must execute without raising an exception
when compiled with -gnatW8.

2006-10-31  Robert Dewar  <>

	* exp_imgv.adb (Expand_Image_Attribute): For Wide_[Wide_]Character
	cases, pass the encoding method, since it is now required by the run

	*, s-valwch.adb (Value_Wide_Wide_Character): Avoid
	assumption that Str'First = 1.
	(Value_Wide_Character): Takes EM (encoding method) parameter and passes
	it on to the Value_Wide_Wide_Character call.
	(Value_Wide_Wide_Character): Takes EM (encoding method) parameter and
	properly handles a string of the form quote-encoded_wide_char-quote.

	* s-wchcnv.adb: Minor reformatting

Attachment: difs
Description: Text document

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