This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH] Robust basic_filebuf::imbue
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: David Krauss <potswa at mac dot com>
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Tue, 12 Oct 2010 13:17:28 +0200
- Subject: Re: [PATCH] Robust basic_filebuf::imbue
- References: <15F914AD-EE57-4F52-9F66-50EB5A329874@mac.com> <4C968FFB.4040306@oracle.com> <6600C4C1-DEC7-4226-B81F-139095BECEAF@mac.com> <4C9950E5.1000101@oracle.com> <4C9A5C84.7060807@oracle.com> <EFADAB42-8073-492B-9BE5-5ABDBD78BFDD@mac.com> <4C9A7913.1070506@oracle.com> <8A1F72C6-534B-476A-93C7-6B7C9466F4FB@mac.com> <695F56CD-0820-459F-97B2-00EA0FED8649@oracle.com> <EF032D5D-DF9E-4B24-A077-50266FD05649@mac.com> <554E2CD9-E307-4B68-8463-46248F900768@gmail.com> <1528DDE3-CCD7-4479-A78E-3F089B2573B3@mac.com> <050C148B-E726-4485-9742-F3102ED6501A@gmail.com> <2FA8D667-3C27-40B8-A520-8ED7E2BCD3CE@mac.com> <D45485D3-3FDC-4335-9D6B-C62149C56C74@mac.com> <4C9BDCD1.6090609@oracle.com> <77FCCA8C-35C8-415F-AFB1-1C774567CC7B@mac.com>
Hi,
I see quite a few rather non-trivial issues here, it will take me a
while to review this, as a single piece of work, be warned. If there are
issues which are really about non-conforming behavior, not QOI should be
dealt with first, by the way, separately, in smaller patches.
A couple of quick comments.
> Also, I changed _M_terminate_output to allocate codecvt::max_length
> bytes for the unshift sequence. This enables block encodings of size >
> 128. Also, it matches the implementation of regular output conversion
> in _M_convert_to_external. (By the way, that is an unbounded alloca in
> _M_convert_to_external; we really should fix that.) The included
> testcase is a block encoding but the block size is only a few bytes.
Are such encodings *really* widespread?
> Finally, the negative return value from _M_get_ext_pos got annoying so I positivized it. Also fixed the return type; matching the "int" from codecvt::length was stupid. Return types don't affect anything in the linker, right?
>
You positivized :) it but I see a ptrdiff_t as return type, which is
still signed, only wider (on 64-bit machines). There is something I
don't understand here.
Also, I'm seeing typeid uses. Are those *really* unavoidable? We are
keeping the uses of RTTI to the minimum, generally, and most of the
headers compile already with -fno-rtti too (unless the feature is really
strictly about type_infos)
Paolo.