From owner-freebsd-arch@freebsd.org Mon Feb 11 11:06:27 2019 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B32B314D28B3 for ; Mon, 11 Feb 2019 11:06:27 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 1B6F98F273 for ; Mon, 11 Feb 2019 11:06:27 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: by mailman.ysv.freebsd.org (Postfix) id C974714D28B2; Mon, 11 Feb 2019 11:06:26 +0000 (UTC) Delivered-To: arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B706D14D28B0 for ; Mon, 11 Feb 2019 11:06:26 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id 4EADB8F272 for ; Mon, 11 Feb 2019 11:06:25 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (v-critter.freebsd.dk [192.168.55.3]) by phk.freebsd.dk (Postfix) with ESMTP id DC668202561C; Mon, 11 Feb 2019 11:06:24 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.15.2/8.15.2) with ESMTPS id x1BB6OaJ093028 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 11 Feb 2019 11:06:24 GMT (envelope-from phk@critter.freebsd.dk) Received: (from phk@localhost) by critter.freebsd.dk (8.15.2/8.15.2/Submit) id x1BB6OIi093027; Mon, 11 Feb 2019 11:06:24 GMT (envelope-from phk) To: Konstantin Belousov cc: arch@freebsd.org Subject: Re: switch to non-zero PTHREAD_*_INITIALIZER In-reply-to: <20190211103807.GX24863@kib.kiev.ua> From: "Poul-Henning Kamp" References: <92707.1549878222@critter.freebsd.dk> <20190211103807.GX24863@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <93025.1549883184.1@critter.freebsd.dk> Content-Transfer-Encoding: quoted-printable Date: Mon, 11 Feb 2019 11:06:24 +0000 Message-ID: <93026.1549883184@critter.freebsd.dk> X-Rspamd-Queue-Id: 4EADB8F272 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Feb 2019 11:06:27 -0000 -------- In message <20190211103807.GX24863@kib.kiev.ua>, Konstantin Belousov write= s: >On Mon, Feb 11, 2019 at 09:43:42AM +0000, Poul-Henning Kamp wrote: >> Right now most of our PTHREAD_*_INITIALIZER macros are defined as NULL. >> = >> This is a bad choice from a code quality point of view, because it mean= s >> that >> = >> pthread_t my_mutex; >> = >> and >> = >> pthread_t my_mutes =3D PTHREAD_MUTEX_INITIALIZER; >> = >> act the same, which they are not. >> = >> I suggest that we should change the macros to a non-NULL value, and >> add a check for NULL values which emit a warning about the lack of >> initialization. >> = >> Comments ? > >This would make the startup (or more) of current binaries too noisy and >perhaps even break the applications that depend on specific output from >the subordinate processes. Right, we probably should make it tweakable with something like /etc/mallo= c.conf. -- = Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe = Never attribute to malice what can adequately be explained by incompetence= .