From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/708 Path: news.gmane.org!not-for-mail From: Andre Renaud Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] string.h, _BSD_SOURCE, and *index() Date: Fri, 13 Apr 2012 13:52:27 +1200 Message-ID: References: <20120412184522.6c7b72a3@newbook> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: dough.gmane.org 1334281967 1845 80.91.229.3 (13 Apr 2012 01:52:47 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 13 Apr 2012 01:52:47 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-709-gllmg-musl=m.gmane.org@lists.openwall.com Fri Apr 13 03:52:46 2012 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1SIVgl-0000Oi-Sr for gllmg-musl@plane.gmane.org; Fri, 13 Apr 2012 03:52:40 +0200 Original-Received: (qmail 5178 invoked by uid 550); 13 Apr 2012 01:52:39 -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 5170 invoked from network); 13 Apr 2012 01:52:39 -0000 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:x-gm-message-state; bh=fU4Z9MrmXsuMH+O3pDUMEhIEqDI8PEP+s2qqTgGRym8=; b=mq0yrOieGuxYatXeQli54dnU2kYdF50eSev4x0u5EbGP6GrwCz5hApDrPwCmBPvAOC sJRXImmKbTarMTpH3J20Fn+YeSL3li+EsIDo7zaBFCjbQv9khCjPOCEVvVuUEVSraJLc 9HVtWJ/cIvHS1SgiVJuDXrP599ESRIGGzxd2CKesiUzWm9MQsIc2yhKYsyZDyOmRnRVE rsVgXICgVcna+LzKg0lPXvWIWDEniTHpOCw3BghvAJVsJg1VIWr4Nlu0FOuiLIjyfHDc GVZsxqtk7cyP9iACEve88x5ZmMUd5sqtN229JGgq9HAns3Y6o0HbUXnMaO5gnX7HDo6c wbdg== In-Reply-To: <20120412184522.6c7b72a3@newbook> X-Gm-Message-State: ALoCoQkBwTRQMNiOf0rp9QjG2rqiOVvs0V/UuQl0LP4083Ydrne/9MYc/l/RkqSn5ERaAa6yMCWZ Xref: news.gmane.org gmane.linux.lib.musl.general:708 Archived-At: On Fri, Apr 13, 2012 at 1:45 PM, Isaac Dunham wrote: > (r)index was X/Open legacy, and has been dropped. The Open Group > recommended using > #define index(a,b) strchr((a),(b)) > #define rindex(a,b) strrchr((a),(b)) > Which will let us remove two more files if we do it (rindex.c & index.c) > However, would removing those break the ABI? I'm curious about this - what is the general consensus on using #define to do these kind of translations, versus using static inline functions, such as: static inline char *index(const char *s, int c) {return strchr(s, c);} static inline char *rindex(const char *s, int c) {return strrchr(s, c);} Regards, Andre