public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/67096] New: libstdc++ testsuite, codecvt: many UTF-8 tests illegal (testing bytes 5 and 6)
@ 2015-08-02 13:57 gnugcc at marino dot st
  2015-08-02 14:07 ` [Bug libstdc++/67096] " gnugcc at marino dot st
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: gnugcc at marino dot st @ 2015-08-02 13:57 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67096

            Bug ID: 67096
           Summary: libstdc++ testsuite, codecvt: many UTF-8 tests illegal
                    (testing bytes 5 and 6)
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gnugcc at marino dot st
  Target Milestone: ---

Using the pending locale patch set for DragonFly[1], I've been running
testsuite frequently.  After an update to libc to support LC_CTYPE better, we
suffered a large test regression.

For example, 22_locale/codecvt/length/wchar_t/4.cc started failing.

I modified the test noting that as long as int_type is limited to < 0x200000,
the test passes.  If it's over 0x200000, it fails.  This test, and many similar
to it tests:
  0x200000
  0x400000
  0x800000
  0x1000000
  0x2000000
  0x4000000
  0x8000000
  0x10000000
  0x20000000
  0x40000000

The reason for the failure is the libc rejects > 4 bytes as illegal, as it
should.

According to wiki[2]: 
"The original specification covered numbers up to 31 bits (the original limit
of the Universal Character Set). In November 2003, UTF-8 was restricted by RFC
3629 to end at U+10FFFF, in order to match the constraints of the UTF-16
character encoding. This removed all 5- and 6-byte sequences, and about half of
the 4-byte sequences."

The test is setting the locale to "en_US.UTF-8" which by definition is limited
to 4-byte numbers.  Thus, testing any number 0x200000 or greater is illegal and
should not be done.  This probably affects several tests that are making the
same mistake.

[1] https://gcc.gnu.org/ml/gcc-patches/2015-07/msg02678.html
[2] https://en.wikipedia.org/wiki/UTF-8


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-09-13 16:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-02 13:57 [Bug libstdc++/67096] New: libstdc++ testsuite, codecvt: many UTF-8 tests illegal (testing bytes 5 and 6) gnugcc at marino dot st
2015-08-02 14:07 ` [Bug libstdc++/67096] " gnugcc at marino dot st
2015-08-03 15:23 ` redi at gcc dot gnu.org
2015-09-11 12:11 ` redi at gcc dot gnu.org
2015-09-11 13:07 ` redi at gcc dot gnu.org
2015-09-11 13:12 ` redi at gcc dot gnu.org
2015-09-13 13:49 ` gnugcc at marino dot st
2015-09-13 16:23 ` gnugcc at marino dot st

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).