From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/6424 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: the prototype decl of memcpy/memcmp/calloc/free shouldnot in sched.h Date: Sun, 2 Nov 2014 00:48:12 -0400 Message-ID: <20141102044812.GO22465@brightrain.aerifal.cx> References: <20141031032410.GZ22465@brightrain.aerifal.cx> <20141101162230.GH10829@port70.net> <20141101170236.GJ22465@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 1414903715 32495 80.91.229.3 (2 Nov 2014 04:48:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 2 Nov 2014 04:48:35 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-6437-gllmg-musl=m.gmane.org@lists.openwall.com Sun Nov 02 05:48:27 2014 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 1Xkn5W-0007wP-Mj for gllmg-musl@m.gmane.org; Sun, 02 Nov 2014 05:48:26 +0100 Original-Received: (qmail 32577 invoked by uid 550); 2 Nov 2014 04:48:25 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 32569 invoked from network); 2 Nov 2014 04:48:24 -0000 Content-Disposition: inline In-Reply-To: <20141101170236.GJ22465@brightrain.aerifal.cx> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:6424 Archived-At: On Sat, Nov 01, 2014 at 01:02:36PM -0400, Rich Felker wrote: > On Sat, Nov 01, 2014 at 05:22:30PM +0100, Szabolcs Nagy wrote: > > * ????????? [2014-10-31 11:42:35 +0800]: > > > > > > In firefox, there is a system_wrapper header include sched.h, but in hunspell codes, calloc and free was redefined, so there is a conflicts here. > > > for example, in "extensions/spellcheck/hunspell/src/hunspell_alloc_hooks.h" > > > #define calloc(count, size) HunspellAllocator::CountingCalloc(count, size) > > > > > > > a simple fix for that in musl is > > > > void *(calloc)(size_t, size_t); > > > > or > > > > #define CPU_ALLOC(n) __cpu_alloc(n) > > static __inline cpu_set_t *__cpu_alloc(size_t _n) > > { > > extern void *(calloc)(size_t,size_t); > > return (calloc)(1,CPU_ALLOC_SIZE(_n)); > > } > > > > which almost gets the namespace right: only a non-function like > > calloc macro defined before sched.h would be an issue > > Yes, I like moving the declarations to non-file-scope better. I think we should do this, but while looking at how, I noticed a couple other issues: 1. Useless declaration of memcpy, which is unused. 2. Use of memset without a declaration. Just making a note here so I don't overlook these when fixing it. Rich