From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18440 invoked by alias); 7 Jun 2014 19:15:28 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 32741 Received: (qmail 28425 invoked from network); 7 Jun 2014 19:15:26 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 From: Bart Schaefer Message-id: <140607121515.ZM25023@torch.brasslantern.com> Date: Sat, 07 Jun 2014 12:15:15 -0700 In-reply-to: <1402161535-20756-5-git-send-email-nikolas@garofil.be> Comments: In reply to Nikolas Garofil "[PATCH 5/6] memmove is expected to return dest" (Jun 7, 7:18pm) References: <1402161535-20756-1-git-send-email-nikolas@garofil.be> <1402161535-20756-5-git-send-email-nikolas@garofil.be> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: [PATCH 5/6] memmove is expected to return dest MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Jun 7, 7:18pm, Nikolas Garofil wrote: } } #ifndef HAVE_MEMMOVE } -# define memmove(dest, src, len) bcopy((src), (dest), (len)) } +void *memmove(void *dest, const void *src, size_t n) { } + bcopy(src, dest, n); } + return dest; } +} } #endif Defining a function in a .h file, especially without declaring it static, is probably not the best idea. Perhaps something like #ifndef HAVE_MEMMOVE # ifndef memmove static void *zmm; # define memmove(dest, src, len) (bcopy((src), zmm = (dest), (len)), zmm) # endif #endif ??