From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24949 invoked by alias); 20 Apr 2011 23:10:44 -0000 Received: (qmail 24938 invoked by uid 22791); 20 Apr 2011 23:10:42 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 20 Apr 2011 23:10:29 +0000 From: "rwild at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/36231] ostream includes unistd.h outside namespace std, polluting X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: rwild at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Wed, 20 Apr 2011 23:10:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-04/txt/msg02218.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36231 --- Comment #17 from Ralf Wildenhues 2011-04-20 23:10:26 UTC --- (In reply to comment #13) > The last time I checked, the problem boiled down to: > > typedef __gthread_mutex_t __c_lock; > > in c_io_stdio.h, which we cannot remove right away for ABI reasons, because we > have a __c_lock data member in iostream classes. Of course the member is > normally completely unused these days, thus a possible ABI-safe way to attack > the problem would be replacing the data member with a dummy member of the same > size and alignment, the equivalent of: [...] > In order to figure out those quantities, ie, sizeof(__gthread_mutex_t) and > __alignof__(__gthread_mutex_t) we could probably use something like > [GLIBCXX_COMPUTE_STDIO_INTEGER_CONSTANTS], Ralf, people, what do you think? It is possible to compute size and alignment of types using Autoconf tests (even when cross-compiling), yes, with AC_CHECK_SIZEOF and AC_CHECK_ALIGNOF. But you are in a much better position to decide whether that is really sufficient here to solve all pending issues why the headers are dragged in. Thanks.