From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/9414 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] add sched_getcpu Date: Mon, 29 Feb 2016 15:17:24 -0500 Message-ID: <20160229201724.GD9349@brightrain.aerifal.cx> References: <1456765028-23958-1-git-send-email-nathan@nathan7.eu> <1456765216-24883-1-git-send-email-nathan@nathan7.eu> <20160229183816.GB9349@brightrain.aerifal.cx> <20160229200500.GC9349@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1456777062 11308 80.91.229.3 (29 Feb 2016 20:17:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 29 Feb 2016 20:17:42 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-9427-gllmg-musl=m.gmane.org@lists.openwall.com Mon Feb 29 21:17:40 2016 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1aaUGB-0007Cj-OC for gllmg-musl@m.gmane.org; Mon, 29 Feb 2016 21:17:39 +0100 Original-Received: (qmail 4022 invoked by uid 550); 29 Feb 2016 20:17:38 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 4002 invoked from network); 29 Feb 2016 20:17:37 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:9414 Archived-At: On Mon, Feb 29, 2016 at 11:10:51PM +0300, Alexander Monakov wrote: > On Mon, 29 Feb 2016, Rich Felker wrote: > > > > Policy is to always include the header with the public declaration > > > > (and any feature test macros necessary to get it) so that the compiler > > > > checks the implementation against the public declaration. > > > > > > This policy certain makes sense; I pointed that out because I've seen it > > > violated; at least the following files violate it by defining something > > > without including anything: > [snip] > > > src/internal/procfdname.c > > > > This is an internal function. > > Please explain the difference in policy for internal functions. The original > motivation (compiler checking the prototype) sounds like it's valuable for > internal functions too. I agree there's value to both, but as stated ("...public declaration...") the policy only applies to public APIs. Part of the difference that makes it more important is that we're actually checking the correctness of the prototype, which is an error that would leak into programs compiled against musl's headers if it's wrong, whereas for internal functions the bug from a mismatch is at worst an internal bug. With that said I agree it would be nice to have prototypes checked for internal functions too, but some of them don't have a natural place to put the prototype without adding gratuitous tiny header files or lumping more stuff into the existing internal headers. This is probably an area that could use some thought to cleanup. Rich