From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32225 invoked by alias); 24 Feb 2005 21:06:46 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 32183 invoked by uid 48); 24 Feb 2005 21:06:42 -0000 Date: Fri, 25 Feb 2005 01:41:00 -0000 Message-ID: <20050224210642.32182.qmail@sourceware.org> From: "qrczak at knm dot org dot pl" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20050220004607.20099.davids@webmaster.com> References: <20050220004607.20099.davids@webmaster.com> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/20099] -pthreads should imply -fno-threadsafe-statics X-Bugzilla-Reason: CC X-SW-Source: 2005-02/txt/msg03049.txt.bz2 List-Id: ------- Additional Comments From qrczak at knm dot org dot pl 2005-02-24 21:06 ------- > First, if we're talking about pthreads programs, which is the only case I'm > suggesting removing the locking for, then those programs are already broken. They are non-portable no matter how static initializers are done: C++ doesn't include threads and POSIX doesn't include C++. > If GCC/G++ are going to have non-portable features that make code work > when they're enabled and break when they're disabled, they definitely > should not be on by default. Taking portability aside (as they are already non-portable), this is a wonderful quote when taken out of context. Yeah, if an option makes more code working and its negation makes more code break, let's make the breaking variant the default :-) > (Or are you seriously arguing that the C++ standard and the > POSIX standard *require* this behavior?) Of course not. Not yet anyhow. For me static locals in C++ are the equivalent of pthread_once in C/POSIX. A hypothetical C++/POSIX should make them MT-safe. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20099