linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Byongho Lee <bhlee.kernel@gmail.com>
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	[thread overview]
Message-ID: <1451847598-30666-2-git-send-email-bhlee.kernel@gmail.com> (raw)
In-Reply-To: <1451847598-30666-1-git-send-email-bhlee.kernel@gmail.com>

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 <bhlee.kernel@gmail.com>
---
 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
-- 
2.6.4


  reply	other threads:[~2016-01-03 19:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-03 18:59 [PATCH 0/6] fix endian bugs and clean-ups Byongho Lee
2016-01-03 18:59 ` Byongho Lee [this message]
2016-01-03 18:59 ` [PATCH 2/6] btrfs-progs: use NULL instead of 0 Byongho Lee
2016-01-03 18:59 ` [PATCH 3/6] btrfs-progs: make private symbols to static Byongho Lee
2016-01-03 18:59 ` [PATCH 4/6] btrfs-progs: fix endian bugs in chunk rebuilding Byongho Lee
2016-01-03 18:59 ` [PATCH 5/6] btrfs-progs: fix endian bug in update_super() Byongho Lee
2016-01-03 18:59 ` [PATCH 6/6] btrfs-progs: fix using on-disk structure to store in memory data Byongho Lee
2016-01-03 19:09 ` [PATCH 0/6] fix endian bugs and clean-ups Byongho Lee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1451847598-30666-2-git-send-email-bhlee.kernel@gmail.com \
    --to=bhlee.kernel@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).