From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25667 invoked by alias); 21 Jul 2013 19:21:10 -0000 Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org Received: (qmail 22743 invoked by uid 48); 21 Jul 2013 19:19:08 -0000 From: "bugdal at aerifal dot cx" To: glibc-bugs@sourceware.org Subject: [Bug libc/15767] New: C++ ABI inconsistency for fpos_t on 64-bit archs Date: Sun, 21 Jul 2013 19:21:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: libc X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: bugdal at aerifal dot cx X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-07/txt/msg00131.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=15767 Bug ID: 15767 Summary: C++ ABI inconsistency for fpos_t on 64-bit archs Product: glibc Version: unspecified Status: NEW Severity: normal Priority: P2 Component: libc Assignee: unassigned at sourceware dot org Reporter: bugdal at aerifal dot cx CC: drepper.fsp at gmail dot com On 64-bit archs, -D_FILE_OFFSET_BITS=64 should not affect the C++ ABI (name mangling). Regardless of whether there's an official policy to this effect, it makes sense, since some applications will always compile with -D_FILE_OFFSET_BITS=64 and others will attempt to detect whether they need it before adding it. For most types that change definition according to _FILE_OFFSET_BITS, there is an underlying type name independent of the typedef name, and no issue arises. However, fpos_t is defined to a structure with no tag, and thus the original typedef name of either _G_fpos_t or _G_fpos64_t gets used in name mangling. Thus if a C++ library uses fpos_t as part of its public interface, and the library and application are compiled with different values of _FILE_OFFSET_BITS, the ABI will gratuitously mismatch. On 32-bit archs it should be expected to mismatch, and the library would have a policy that you have to build with 64-bit off_t. But on 64-bit archs, it should not matter whether _FILE_OFFSET_BITS was defined. This issue would be even more of a problem if multiple libraries disagreed on whether it was supposed to be set, and an application needed to use both libraries. With that said, I'm not sure why features.h doesn't make _FILE_OFFSET_BITS a complete no-op on 64-bit archs. That would make the issue go away entirely. -- You are receiving this mail because: You are on the CC list for the bug.