From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 966793857709; Tue, 18 Jul 2023 11:00:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 966793857709 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1689678057; bh=bL9YlknGWLx4BGfurYhqJrxtqYifyf+ETSV6eaPfJjM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=tw77Jd+Tw4X0l5mTZmwAxle1JGlkeyMMUTjhjUMO55gekXxplr7aCoEwc7T6XePNq 5MnZCbGfnRzWGZossitdoxG8T6ty88LOqNbqVdr42qf0xxBJkPXltEbfnNQjr9NSEf M1viV2iMDYHxxjL483YaIVKVs8VxKbCedmQD0FtI= 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: Tue, 18 Jul 2023 11:00:56 +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 #7 from CVS Commits --- The releases/gcc-13 branch has been updated by Jonathan Wakely : https://gcc.gnu.org/g:5342e3cc446d9ba0017c167aa3ff9d3c08c11f0f commit r13-7578-g5342e3cc446d9ba0017c167aa3ff9d3c08c11f0f 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. (cherry picked from commit 2f6bbc9a7d9a62423c576e13dc46323fe16ba5aa)=