From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Tue, 11 Feb 2020 17:24:18 +0300 (MSK) From: Ivan Zakharyaschev To: ALT Linux Team development discussions In-Reply-To: <20200211140003.GA8818@altlinux.org> Message-ID: References: <20200129012150.83E7E8440710@gitery.altlinux.org> <45228f59-3529-a3ee-7eb7-67eac012ffda@altlinux.org> <6acb6b5b-d135-7071-f500-3142170aefda@altlinux.org> <20200211140003.GA8818@altlinux.org> User-Agent: Alpine 2.20 (LFD 67 2015-01-07) MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="1807885841-1454277600-1581431058=:6363" Subject: Re: [devel] [SCM] packages/apt: heads/rework-dynamic-mmap X-BeenThere: devel@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: ALT Linux Team development discussions List-Id: ALT Linux Team development discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Feb 2020 14:24:19 -0000 Archived-At: List-Archive: List-Post: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --1807885841-1454277600-1581431058=:6363 Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 8BIT On Tue, 11 Feb 2020, Dmitry V. Levin wrote: > On Tue, Feb 11, 2020 at 04:47:41PM +0300, Ivan Zakharyaschev wrote: > [...] > > commit e785f0e8636e47a672445e70f2923a5eea566b33 > > Author: Ivan Zakharyaschev > > Date: Wed Jan 29 04:41:13 2020 +0300 > > > > use the safer C++-style static_cast instead of a C-style cast (from void*) > > > > What is happening here: > > > > Map->RawAllocate() returns the index in an array of bytes (i.e., of char; > > no matter whether they are (un)signed); therefore, we cast the base > > pointer to the corresponding type, so that the pointer arithmetic > > gives a pointer to the beginning of the allocated space. > > > > We do not want to rely on non-standard void*-arithmetic. > > We - это кто, и почему они не хотят полагаться на то, что работает? Да это расширение gcc, которое работает , когда язык C, а когда C++ -- запрещено и в gcc. (Я вроде пробовал, и gcc запретил, когда мы в прошлый раз обсуждали падение apt-а на e2k.) -- Best regards, Ivan --1807885841-1454277600-1581431058=:6363--