From patchwork Thu May 16 19:42:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramsay Jones X-Patchwork-Id: 2579741 Return-Path: X-Original-To: patchwork-linux-sparse@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id F0C104020A for ; Thu, 16 May 2013 19:54:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753209Ab3EPTyM (ORCPT ); Thu, 16 May 2013 15:54:12 -0400 Received: from mdfmta005.mxout.tch.inty.net ([91.221.169.46]:46727 "EHLO smtp.demon.co.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753136Ab3EPTyL (ORCPT ); Thu, 16 May 2013 15:54:11 -0400 Received: from smtp.demon.co.uk (unknown [127.0.0.1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by mdfmta005.tch.inty.net (Postfix) with ESMTP id 3140A18C6E1 for ; Thu, 16 May 2013 20:47:32 +0100 (BST) Received: from mdfmta009.tch.inty.net (unknown [127.0.0.1]) by mdfmta009.tch.inty.net (Postfix) with ESMTP id 826741280A5; Thu, 16 May 2013 20:46:26 +0100 (BST) Received: from mdfmta009.tch.inty.net (unknown [127.0.0.1]) by mdfmta009.tch.inty.net (Postfix) with ESMTP id C778012809D; Thu, 16 May 2013 20:46:25 +0100 (BST) Received: from [193.237.126.196] (unknown [193.237.126.196]) by mdfmta009.tch.inty.net (Postfix) with ESMTP; Thu, 16 May 2013 20:46:25 +0100 (BST) Message-ID: <519536B5.7020603@ramsay1.demon.co.uk> Date: Thu, 16 May 2013 20:42:45 +0100 From: Ramsay Jones User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 MIME-Version: 1.0 To: Christopher Li CC: Sparse Mailing-list Subject: [PATCH 2/3] Makefile: Fix some macro redefinition warnings X-MDF-HostID: 22 Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org In particular, gcc complains as follows: CC sparse-llvm.o :1:1: warning: "__STDC_CONSTANT_MACROS" redefined :1:1: warning: this is the location of the previous definition :1:1: warning: "__STDC_FORMAT_MACROS" redefined :1:1: warning: this is the location of the previous definition :1:1: warning: "__STDC_LIMIT_MACROS" redefined :1:1: warning: this is the location of the previous definition The warnings are caused by the macros being defined twice on the gcc command line. These command line -D macro definitions come originally from the output of 'llvm-config --cflags', which is recorded in the $(LLVM_CFLAGS) variable. This variable is then included in the $(BASIC_CFLAGS) variable twice due to duplication of the target-specific additions to the BASIC_CFLAGS, viz: sparse-llvm_EXTRA_DEPS := sparse-llvm.o sparse-llvm.o $(sparse-llvm_EXTRA_DEPS): BASIC_CFLAGS += $(LLVM_CFLAGS) In order to suppress the warnings, we remove the duplication of the sparse-llvm.o target in the above rule. Signed-off-by: Ramsay Jones --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 35e3801..ba2ba85 100644 --- a/Makefile +++ b/Makefile @@ -90,7 +90,7 @@ LLVM_LIBS := $(shell llvm-config --libs) PROGRAMS += $(LLVM_PROGS) INST_PROGRAMS += sparse-llvm sparsec sparse-llvm_EXTRA_DEPS := sparse-llvm.o -sparse-llvm.o $(sparse-llvm_EXTRA_DEPS): BASIC_CFLAGS += $(LLVM_CFLAGS) +$(sparse-llvm_EXTRA_DEPS): BASIC_CFLAGS += $(LLVM_CFLAGS) sparse-llvm_EXTRA_OBJS := $(LLVM_LIBS) endif endif