From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 21 12:22:47 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 56689FE3 for ; Sun, 21 Oct 2012 12:22:47 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (unknown [IPv6:2001:610:1108:5012::107]) by mx1.freebsd.org (Postfix) with ESMTP id 1579A8FC0A for ; Sun, 21 Oct 2012 12:22:47 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 7A7C61203B1; Sun, 21 Oct 2012 14:22:43 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 555D52848C; Sun, 21 Oct 2012 14:22:43 +0200 (CEST) Date: Sun, 21 Oct 2012 14:22:43 +0200 From: Jilles Tjoelker To: Eitan Adler Subject: Re: -lpthread vs -pthread: does -D_REENTRANT matter? Message-ID: <20121021122243.GB96141@stack.nl> References: <20121014144222.GA14503@stack.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: FreeBSD Hackers X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Oct 2012 12:22:47 -0000 On Sun, Oct 14, 2012 at 04:55:07PM -0400, Eitan Adler wrote: > On 14 October 2012 10:42, Jilles Tjoelker wrote: > > Because C99 does not specify threading, it allows these transformations. > > In C11, they are forbidden. Passing -pthread disables them as well. > Is the man page wrong or do I misunderstand? > This option sets flags for both the preprocessor and linker. It > does not affect the thread safety of object code produced by the > compiler or that of libraries supplied with it. OK, that would explain why I could not find such things. I seem to recall GCC must sometimes be instructed not to do thread-unsafe transformations but I cannot find how to do so. -- Jilles Tjoelker