From patchwork Mon Mar 31 15:04:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Newton X-Patchwork-Id: 27422 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f198.google.com (mail-ie0-f198.google.com [209.85.223.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A5323202E0 for ; Mon, 31 Mar 2014 15:04:27 +0000 (UTC) Received: by mail-ie0-f198.google.com with SMTP id to1sf29500260ieb.5 for ; Mon, 31 Mar 2014 08:04:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:mailing-list :precedence:list-id:list-unsubscribe:list-subscribe:list-archive :list-post:list-help:sender:delivered-to:from:to:subject:date :message-id:x-original-sender:x-original-authentication-results; bh=+wMVr6D7P72n+4uaGez9Jc/NBXfJAme0LHCaJAhsqIc=; b=aFzkNtj0jgKoJz+zBQ6U8qEvWF7DnJAvRloOWGDEbV9jkJz0Pw92qt4pXyPGTji6wX yg2DIobmhlyzhJeeyyWj0Yk1fmB/b24dm70B8aVSSyBUauYVGclVLCJaJy5gsagXr7Q0 FHmFY+n1W2Gj3xjNLK2WBLr1dqrTdzk48B9YKzb0tvTB+dwiex4ElMU03kqusxDKBCAG rubXVD8iSfw0294aJIUCBuLqckZ2ktdZaxUyG+8yS3/qGiLU0ercfG9XsqnaXiQ9f8eI +SnRAs7nucgZMIqanBcxFL9yDEywu0f+Q+4/ipEWqU5xjQ5zS7YDmVp/IIZvFFi+BWaP rCig== X-Gm-Message-State: ALoCoQnPhkzoepP1rY3UwLddCJzGWdvTYxJq8GE/ScrTBSchsjoQkMOWj3sh9fOdBsPeLG578APJ X-Received: by 10.42.13.198 with SMTP id e6mr8821830ica.21.1396278267089; Mon, 31 Mar 2014 08:04:27 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.26.183 with SMTP id 52ls2379357qgv.38.gmail; Mon, 31 Mar 2014 08:04:26 -0700 (PDT) X-Received: by 10.220.159.4 with SMTP id h4mr24069792vcx.1.1396278266909; Mon, 31 Mar 2014 08:04:26 -0700 (PDT) Received: from mail-vc0-x22f.google.com (mail-vc0-x22f.google.com [2607:f8b0:400c:c03::22f]) by mx.google.com with ESMTPS id 2si2919512vcd.95.2014.03.31.08.04.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 31 Mar 2014 08:04:26 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c03::22f is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c03::22f; Received: by mail-vc0-f175.google.com with SMTP id lh14so8419690vcb.34 for ; Mon, 31 Mar 2014 08:04:26 -0700 (PDT) X-Received: by 10.220.2.142 with SMTP id 14mr1840vcj.48.1396278266789; Mon, 31 Mar 2014 08:04:26 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.12.8 with SMTP id v8csp149660vcv; Mon, 31 Mar 2014 08:04:26 -0700 (PDT) X-Received: by 10.68.202.8 with SMTP id ke8mr25765856pbc.86.1396278266151; Mon, 31 Mar 2014 08:04:26 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id ic8si3516709pad.95.2014.03.31.08.04.25 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 31 Mar 2014 08:04:26 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-48747-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 24191 invoked by alias); 31 Mar 2014 15:04:18 -0000 Mailing-List: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org Precedence: list List-Id: List-Unsubscribe: , List-Subscribe: List-Archive: List-Post: , List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 24175 invoked by uid 89); 31 Mar 2014 15:04:16 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wg0-f47.google.com X-Received: by 10.194.6.106 with SMTP id z10mr15012940wjz.1.1396278252192; Mon, 31 Mar 2014 08:04:12 -0700 (PDT) From: Will Newton To: libc-alpha@sourceware.org Subject: [PATCH] malloc: Fix MALLOC_DEBUG -Wundef warning Date: Mon, 31 Mar 2014 16:04:03 +0100 Message-Id: <1396278243-24455-1-git-send-email-will.newton@linaro.org> X-Original-Sender: will.newton@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c03::22f is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@sourceware.org X-Google-Group-Id: 836684582541 MALLOC_DEBUG is set optionally on the command line. Default the value to zero if it is not set on the command line, and test its value with #if rather than #ifdef. Verified the code is identical before and after this change apart from line numbers. ChangeLog: 2014-03-31 Will Newton * malloc/malloc.c [!MALLOC_DEBUG]: #define MALLOC_DEBUG to zero if it is not defined elsewhere. (mtrim): Test the value of MALLOC_DEBUG with #if rather than #ifdef. --- malloc/malloc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/malloc/malloc.c b/malloc/malloc.c index 9a45707..1120d4d 100644 --- a/malloc/malloc.c +++ b/malloc/malloc.c @@ -270,6 +270,10 @@ or other mallocs available that do this. */ +#ifndef MALLOC_DEBUG +#define MALLOC_DEBUG 0 +#endif + #ifdef NDEBUG # define assert(expr) ((void) 0) #else @@ -4477,7 +4481,7 @@ mtrim (mstate av, size_t pad) if (size > psm1) { -#ifdef MALLOC_DEBUG +#if MALLOC_DEBUG /* When debugging we simulate destroying the memory content. */ memset (paligned_mem, 0x89, size & ~psm1);