[pcre-dev] [Bug 1049] Add support for UTF-16

Top Page
Delete this message
Author: Gertjan Halkes
Date:  
To: pcre-dev
Old-Topics: [pcre-dev] [Bug 1049] New: Add support for UTF-16
Subject: [pcre-dev] [Bug 1049] Add support for UTF-16
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=1049




--- Comment #32 from Gertjan Halkes <eximbugz@???> 2011-11-17 19:32:04 ---
(In reply to comment #31)
> However, the standard also does not specify (as far as I can tell) the expected
> behaviour for accessing through a different union member, which means that it
> is undefined. Relying on undefined behaviour is definately playing with fire.


OK, I should have updated my local copy of the C99 standard to TC3, because it
added a footnote (#82 on page 73):

'If the member used to access the contents of a union object is not the same as
the member last used to store a value in the object, the appropriate part of
the object representation of the value is reinterpreted as an object
representation in the new type as described in 6.2.6 (a process sometimes
called "type punning"). This might be a trap representation.'

To me this means the union trick is actually valid. But that's the last I'll
add on this subject, because I get the feeling we're getting sidetracked here.

Gertjan


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email