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

[Bug libstdc++/79980] Possible bug in codecvt.cpp bitmask setting code


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

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu.org

--- Comment #5 from kargl at gcc dot gnu.org ---
(In reply to Jonathan Wakely from comment #4)
> Author: redi
> Date: Thu Mar 16 15:27:51 2017
> New Revision: 246200
> 
> URL: https://gcc.gnu.org/viewcvs?rev=246200&root=gcc&view=rev
> Log:
> PR libstdc++/79980 fix BOM detection, maxcode checks, UCS2 handling
> 
> 	PR libstdc++/79980
> 	* include/bits/locale_conv.h (__do_str_codecvt): Set __count on
> 	error path.
> 	* src/c++11/codecvt.cc (operator&=, operator|=, operator~): Overloads
> 	for manipulating codecvt_mode values.
> 	(read_utf16_bom): Compare input to BOM constants instead of integral
> 	constants that depend on endianness.  Take mode parameter by
> 	reference and adjust it, to distinguish between no BOM present and
> 	UTF-16BE BOM present.
> 	(ucs4_in, ucs2_span, ucs4_span): Adjust calls to read_utf16_bom.
> 	(surrogates): New enumeration type.
> 	(utf16_in, utf16_out): Add surrogates parameter to choose between
> 	UTF-16 and UCS2 behaviour.
> 	(utf16_span, ucs2_span): Use std::min not std::max.
> 	(ucs2_out): Use std::min not std::max.  Disallow surrogate pairs.
> 	(ucs2_in): Likewise. Adjust calls to read_utf16_bom.
> 	* testsuite/22_locale/codecvt/codecvt_utf16/79980.cc: New test.
> 	* testsuite/22_locale/codecvt/codecvt_utf8/79980.cc: New test.
> 
> Added:
>     trunk/libstdc++-v3/testsuite/22_locale/codecvt/codecvt_utf16/79980.cc
>     trunk/libstdc++-v3/testsuite/22_locale/codecvt/codecvt_utf8/79980.cc
> Modified:
>     trunk/libstdc++-v3/ChangeLog
>     trunk/libstdc++-v3/include/bits/locale_conv.h
>     trunk/libstdc++-v3/src/c++11/codecvt.cc

Please revert this change.  It breaks bootstrap with clang on FreeBSD.

libtool: compile:  /mnt/kargl/obj/./gcc/xgcc -shared-libgcc
-B/mnt/kargl/obj/./gcc -nostdinc++
-L/mnt/kargl/obj/i386-unknown-freebsd12.0/libstdc++-v3/src
-L/mnt/kargl/obj/i386-unknown-freebsd12.0/libstdc++-v3/src/.libs
-L/mnt/kargl/obj/i386-unknown-freebsd12.0/libstdc++-v3/libsupc++/.libs
-B/home/kargl/work/i386-unknown-freebsd12.0/bin/
-B/home/kargl/work/i386-unknown-freebsd12.0/lib/ -isystem
/home/kargl/work/i386-unknown-freebsd12.0/include -isystem
/home/kargl/work/i386-unknown-freebsd12.0/sys-include
-I/mnt/kargl/gcc/libstdc++-v3/../libgcc
-I/mnt/kargl/obj/i386-unknown-freebsd12.0/libstdc++-v3/include/i386-unknown-freebsd12.0
-I/mnt/kargl/obj/i386-unknown-freebsd12.0/libstdc++-v3/include
-I/mnt/kargl/gcc/libstdc++-v3/libsupc++ -std=gnu++11 -D_GLIBCXX_SHARED
-fno-implicit-templates -Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi
-fdiagnostics-show-location=once -ffunction-sections -fdata-sections
-frandom-seed=codecvt.lo -g -O2 -c
/mnt/kargl/gcc/libstdc++-v3/src/c++11/codecvt.cc  -fPIC -DPIC -D_GLIBCXX_SHARED
-o codecvt.o
/mnt/kargl/gcc/libstdc++-v3/src/c++11/codecvt.cc: In function
'std::underlying_type<std::codecvt_mode>::type
std::to_integer(std::codecvt_mode)':
/mnt/kargl/gcc/libstdc++-v3/src/c++11/codecvt.cc:37:24: error: 'mode_t' does
not name a type; did you mean '__mode_t'?
   { return static_cast<mode_t>(m); }
                        ^~~~~~
                        __mode_t
gmake[6]: *** [Makefile:558: codecvt.lo] Error 1
gmake[6]: Leaving directory
'/mnt/kargl/obj/i386-unknown-freebsd12.0/libstdc++-v3/src/c++11'
Making all in filesystem
gmake[6]: Entering directory
'/mnt/kargl/obj/i386-unknown-freebsd12.0/libstdc++-v3/src/filesystem'
gmake[6]: Nothing to be done for 'all'.
gmake[6]: Leaving directory
'/mnt/kargl/obj/i386-unknown-freebsd12.0/libstdc++-v3/src/filesystem'

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