Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754427Ab0DDOe4 (ORCPT ); Sun, 4 Apr 2010 10:34:56 -0400 Received: from mail-bw0-f209.google.com ([209.85.218.209]:51351 "EHLO mail-bw0-f209.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753364Ab0DDOeu (ORCPT ); Sun, 4 Apr 2010 10:34:50 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to:user-agent; b=pwFCbniCq/3X3T6e6PogaDVG6bWwg7tCmHK62d2jsQum59dt/j1VuAJY/sAdyA1wXR is81lLjvgxOb0blrzqVE8PmZvLTRbk85gx7dcmHZB3oY3U+/x2c4dfolejDYHxc8OdFV wwnwQf/cFUsi4nNCLdRTsSSIwe44GUf3S8yK4= Date: Sun, 4 Apr 2010 16:34:43 +0200 From: Frederic Weisbecker To: Hitoshi Mitake Cc: mingo@elte.hu, linux-kernel@vger.kernel.org, h.mitake@gmail.com, Peter Zijlstra , Paul Mackerras , Arnaldo Carvalho de Melo Subject: Re: [PATCH] Swap including order of util.h and string.h of util/string.c Message-ID: <20100404143441.GA5608@nowhere> References: <1270368798-27232-1-git-send-email-mitake@dcl.info.waseda.ac.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1270368798-27232-1-git-send-email-mitake@dcl.info.waseda.ac.jp> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1712 Lines: 52 On Sun, Apr 04, 2010 at 05:13:18PM +0900, Hitoshi Mitake wrote: > Current util/string.c includes headers in this order: string.h, util.h > But this causes build error because __USE_GNU definition > is needed for strndup() definition like this, > % make -j > touch .perf.dev.null > CC util/string.o > cc1: warnings being treated as errors > util/string.c: In function ‘argv_split’: > util/string.c:171: error: implicit declaration of function ‘strndup’ > util/string.c:171: error: incompatible implicit declaration of built-in function ‘strndup’ Thanks, I've queued it as I have the same problem and I'm about to send a perf/core queue. > > So this patch swaps order of including headers. > util.h defines _GNU_SOURCE, and /usr/include/features.h defines __USE_GNU as 1 > if _GNU_SOURCE is defined. > > Signed-off-by: Hitoshi Mitake > Cc: Peter Zijlstra > Cc: Paul Mackerras > Cc: Frederic Weisbecker > Cc: Arnaldo Carvalho de Melo > --- > tools/perf/util/string.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/tools/perf/util/string.c b/tools/perf/util/string.c > index d438924..0409fc7 100644 > --- a/tools/perf/util/string.c > +++ b/tools/perf/util/string.c > @@ -1,5 +1,5 @@ > -#include "string.h" > #include "util.h" > +#include "string.h" > > #define K 1024LL > /* > -- > 1.6.5.2 > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/