From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23557 invoked by alias); 29 Nov 2005 09:14:01 -0000 Received: (qmail 23539 invoked by uid 48); 29 Nov 2005 09:13:59 -0000 Date: Tue, 29 Nov 2005 09:14:00 -0000 Message-ID: <20051129091359.23538.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug libstdc++/11953] _REENTRANT defined when compiling non-threaded code. In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "marc dot waeckerlin at siemens dot com" 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 X-SW-Source: 2005-11/txt/msg03937.txt.bz2 List-Id: ------- Comment #35 from marc dot waeckerlin at siemens dot com 2005-11-29 09:13 ------- I had a look in google about "#ifdef _REENTRANT", and it gets about 20'200 entries, so this is a widely used funtinality that must not be broken! Imagine all the code the does the "#ifdef _REENTRANT" to enable threading: If now _REENTRANT is always true, regardless of whether -pthreads is given or not, then all this code will crash when compiled with gcc += 3.4! This is really a severe problem! Please return to the previous behaviour of _REENTRANT, and fix it for those platforms, where it previousely did not work (s390x and ia64). The _REENTRANT must work as 90% of the programmers expect it to work! It wasn't my idea to look for _REENTRANT, i learnt it from a collegue who has seen it in system C libraries and e.g. the QpThread library. It is a widely used feature! It must neither be broken, nor be replaced by something else, sich as __GCC_PTHREADS__ or the like! In errno.h, AFAIK they also tested for _REENTRANT, now they test for: # if !defined _LIBC || defined _LIBC_REENTRANT Is this an acceptable way to do it now, test for _LIBC_REENTRANT? Reentrant is also used in /usr/include/features.h: /* These are defined by the user (or the compiler) to specify the desired environment: [...] _REENTRANT Select additionally reentrant object. _THREAD_SAFE Same as _REENTRANT, often used by other systems. [...] */ --> So it should be set correctly by the compiler!!!! #if defined _REENTRANT || defined _THREAD_SAFE # define __USE_REENTRANT 1 #endif -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11953