From patchwork Sun Jan 3 18:59:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Byongho Lee X-Patchwork-Id: 7943871 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 19451BEEE5 for ; Sun, 3 Jan 2016 19:00:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 240482026D for ; Sun, 3 Jan 2016 19:00:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 43F0F20253 for ; Sun, 3 Jan 2016 19:00:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752188AbcACTAN (ORCPT ); Sun, 3 Jan 2016 14:00:13 -0500 Received: from mail-pf0-f178.google.com ([209.85.192.178]:35182 "EHLO mail-pf0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751539AbcACTAL (ORCPT ); Sun, 3 Jan 2016 14:00:11 -0500 Received: by mail-pf0-f178.google.com with SMTP id 78so191918925pfw.2 for ; Sun, 03 Jan 2016 11:00:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:in-reply-to:references; bh=LKdTXV37iD7NI9AB1gFSTOkJCoUymYK4MBpglH3CBu4=; b=nIkIRR95D/04UaGjoL8TOHj0OIbKOWV/GpXuRhsLnjMeCKz86xfS+m86BJB10tAA74 Tkirv0OTqbB7Kv+CddJtaqESGwFoyPPoBK1WxgycXf3N6HBqtWmd2PLSCTd7vSHpcuT0 ZR7hGksaw4vdJO8qw/8iajBLeq/VRw9GP1oDIs7lvPGluQOZgeZdXqH344hD5tsqhVG0 wcBRTbVTV48SUFLfJ+Ou85LLiekMfPQn93ud41Bi7396VF410QPMXyV158cPKMBlXNOE Dc/X5WSrtTFfgvb6raEbuchmTKh1dzbC/zidg+/DusSOe9Af0puOlr7wB8/pdy29ZlO5 U/Qw== X-Received: by 10.98.67.67 with SMTP id q64mr50604504pfa.133.1451847611056; Sun, 03 Jan 2016 11:00:11 -0800 (PST) Received: from arch-gct.localdomain ([175.114.213.172]) by smtp.gmail.com with ESMTPSA id fc6sm120726837pac.44.2016.01.03.11.00.09 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 03 Jan 2016 11:00:09 -0800 (PST) From: Byongho Lee To: linux-btrfs@vger.kernel.org Subject: [PATCH 1/6] btrfs-progs: get sparse checking working Date: Mon, 4 Jan 2016 03:59:53 +0900 Message-Id: <1451847598-30666-2-git-send-email-bhlee.kernel@gmail.com> X-Mailer: git-send-email 2.6.4 In-Reply-To: <1451847598-30666-1-git-send-email-bhlee.kernel@gmail.com> References: <1451847598-30666-1-git-send-email-bhlee.kernel@gmail.com> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When I run sparse checking it gives following error: $ make C=1 V=1 gcc -MM -MG -MF cmds-fi-usage.o.d -MT cmds-fi-usage.o -MT \ cmds-fi-usage.static.o -MT cmds-fi-usage.o.d -g -O1 -Wall \ -D_FORTIFY_SOURCE=2 -include config.h -DBTRFS_FLAT_INCLUDES \ -D_XOPEN_SOURCE=700 -fno-strict-aliasing -fPIC cmds-fi-usage.c [SP] ctree.c sparse -g -O1 -Wall -D_FORTIFY_SOURCE=2 -include config.h \ -DBTRFS_FLAT_INCLUDES -D_XOPEN_SOURCE=700 -fno-strict-aliasing -fPIC \ -include -D__CHECKER__ -D__CHECK_ENDIAN__ -Wbitwise -Wuninitialized \ -Wshadow -Wundef -U_FORTIFY_SOURCE ctree.c builtin:1:15: error: unable to open '-D__CHECKER__' Makefile:177: recipe for target 'ctree.o' failed make: *** [ctree.o] Error 1 It means '$(check_defs)' is passed to sparse as NULL and looks '$(check_defs)'should be assigned before assigning '$(CHECKER_FLAGS)'. BTW, I'm not familiar with make tool so there could be some my misunderstanding and better solution. Signed-off-by: Byongho Lee --- Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index 85b45e5bee3b..3b98709f31a5 100644 --- a/Makefile.in +++ b/Makefile.in @@ -60,6 +60,7 @@ STATIC_LIBS = @UUID_LIBS_STATIC@ @BLKID_LIBS_STATIC@ \ # generate so many sparse errors that sparse stops parsing, # which masks real errors that we want to see. CHECKER := sparse +check_defs := .cc-defines.h CHECKER_FLAGS := -include $(check_defs) -D__CHECKER__ \ -D__CHECK_ENDIAN__ -Wbitwise -Wuninitialized -Wshadow -Wundef \ -U_FORTIFY_SOURCE @@ -154,7 +155,6 @@ lib_links = libbtrfs.so.0 libbtrfs.so headers = $(libbtrfs_headers) # make C=1 to enable sparse -check_defs := .cc-defines.h ifdef C # We're trying to use sparse against glibc headers which go wild # trying to use internal compiler macros to test features. We