From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20682 invoked by alias); 20 Apr 2011 18:42:48 -0000 Received: (qmail 20668 invoked by uid 22791); 20 Apr 2011 18:42:46 -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 18:42:28 +0000 From: "paolo.carlini at oracle dot com" 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: paolo.carlini at oracle dot com 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: CC 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 18:42: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/msg02200.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36231 Paolo Carlini changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jwakely.gcc at gmail dot | |com --- Comment #13 from Paolo Carlini 2011-04-20 18:42:26 UTC --- 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: class stream { union { char __data[sizeof(__gthread_mutex_t)]; struct __attribute__((__aligned__ ((__alignof__(__gthread_mutex_t))))) { } __align; } __dummy_member; }; 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?