Path: csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Bo Persson Newsgroups: comp.lang.c++ Subject: Re: recovering from std::bad_alloc in std::string reserve Date: Fri, 28 May 2021 09:47:29 +0200 Lines: 34 Message-ID: References: <_CUrI.452334$ST2.205157@fx47.iad> <87sg27zu0i.fsf@nosuchdomain.example.com> <87o8cvzsux.fsf@nosuchdomain.example.com> <87k0njzq45.fsf@nosuchdomain.example.com> <664dd958-6042-4d5d-951c-191b0e26421dn@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: individual.net 0aw7HU+3IBD7pFHKVs7CaAfLZL7z3eP9PFXLn3p1gxlSAkiiux Cancel-Lock: sha1:WmZY2R1qfGnOw+uJPyogso7S9iM= User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 In-Reply-To: Content-Language: sv Xref: csiph.com comp.lang.c++:79855 On 2021-05-28 at 04:38, Lynn McGuire wrote: > On 5/27/2021 8:36 PM, Öö Tiib wrote: >> On Friday, 28 May 2021 at 02:58:18 UTC+3, Keith Thompson wrote: >>> In fact C doesn't define a type for representing file sizes. >>> (It might be nice if it did.) >> >> Or may be it might be nice if it did take it back from C++ where >> std::filesystem::file_size() is of type std::uintmax_t. >> Also standard should end the woo allowing implementations to >> have integers that are not integers. It is awful. > > For some reason, Microsoft is using __int64.  Not my favorite variable > type. The reason being that they invented this type at a time when there was no long long. >  Even "long long" is better (and the same) imho. Yes, *now* it is. :-) >  __int64 _ftelli64 (FILE *stream); > > https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/ftell-ftelli64?view=msvc-160 > > > Apparently no one else is using _ftelli64.  This sucks. >    https://www.vogons.org/viewtopic.php?t=65070 > > Lynn > > >