From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7AD683858C98; Mon, 12 Feb 2024 10:12:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7AD683858C98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1707732777; bh=aQFbJnHpE/CrOA9Td+8+pPJ9+wKZJeu1YADGL6Wbu94=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Dzr3G0KgRT5s1m73CpyKqzYAOFssSQb/r9llQTL80D0aPN7MHzIJjYCWPAAgfdD/3 CgwyfWUB95XuWBUHKWR2FXGPOClf4PaH8Hi+ao/lgKIT5Np/ZfD1OPCqa16mLQ9zF0 Gtislak7lr4MvPNDUZOV4MaQ0B4Ax6/yVtmn05t8= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/64064] basic_filebuf seekoff return value is unusable for files opened in text mode on Windows Date: Mon, 12 Feb 2024 10:12: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: 4.9.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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=3D64064 --- Comment #3 from Jonathan Wakely --- https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/fseek-fse= eki64?view=3Dmsvc-170#remarks The only way to use _fseeki64 for text mode files is with __off=3D0 (and any value of __way) or __way=3Dbeg and __off obtained from _ftelli64. So I think for __way=3Dcur or __way=3Dend we would need to calculate a file= offset relative to the start of the file and then use that.=