From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C115A3857728; Wed, 12 Jul 2023 20:04:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C115A3857728 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1689192268; bh=rxWayk4DwlKcKKQGRa4fITn4+/snL9wXbbtVg02Mx+M=; h=From:To:Subject:Date:In-Reply-To:References:From; b=CUBNKGNfsLHVONaGcQdVF50Ov4JVHdAtw49CU79HfKEcGXCA0gjQeC8LcSe6NZpoY /GvqbNBiftUfJmx+Hhx69hk5D04P6w+q8PtUgAvduG/elty2W/MoTu8nOf4XI3LElz vllz4hvQNQFWz3Eyu6FiEJs2yyvAKKPirruZ+lOo= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/110574] --enable-cstdio=stdio_pure is incompatible with LFS Date: Wed, 12 Jul 2023 20:04:27 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: redi at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D110574 --- Comment #6 from CVS Commits --- The master branch has been updated by Jonathan Wakely : https://gcc.gnu.org/g:2f6bbc9a7d9a62423c576e13dc46323fe16ba5aa commit r14-2476-g2f6bbc9a7d9a62423c576e13dc46323fe16ba5aa Author: Jonathan Wakely Date: Thu Jul 6 17:10:41 2023 +0100 libstdc++: Fix --enable-cstdio=3Dstdio_pure [PR110574] When configured with --enable-cstdio=3Dstdio_pure we need to consistent= ly use fseek and not mix seeks on the file descriptor with reads and writes on the FILE stream. There are also a number of bugs related to error handling and return values, because fread and fwrite return 0 on error, not -1, and fseek returns 0 on success, not the file offset. libstdc++-v3/ChangeLog: PR libstdc++/110574 * acinclude.m4 (GLIBCXX_CHECK_LFS): Check for fseeko and ftello and define _GLIBCXX_USE_FSEEKO_FTELLO. * config.h.in: Regenerate. * configure: Regenerate. * config/io/basic_file_stdio.cc (xwrite) [_GLIBCXX_USE_STDIO_PU= RE]: Check for fwrite error correctly. (__basic_file::xsgetn) [_GLIBCXX_USE_STDIO_PURE]: Check f= or fread error correctly. (get_file_offset): New function. (__basic_file::seekoff) [_GLIBCXX_USE_STDIO_PURE]: Use fseeko if available. Use get_file_offset instead of return value of fseek. (__basic_file::showmanyc): Use get_file_offset.=