btrfs-progs: get C=1 sparse checking working again
authorZach Brown <zab@redhat.com>
Wed, 14 Aug 2013 23:16:31 +0000 (16:16 -0700)
committerDavid Sterba <dsterba@suse.cz>
Tue, 3 Sep 2013 17:41:12 +0000 (19:41 +0200)
commit5ac75e2af2d29a4863e10947f1cb14ce56e1c2e7
tree1ac3e65258da791952a080f4e08777b452ff0d88
parentc17a056f3841b2ebc024f5af7ed2c58279641d4b
btrfs-progs: get C=1 sparse checking working again

There were a few problems that were breaking sparse checking:

- We were defining CHECK_ENDIAN late in the environment, after
  linux/fs.h has been included which defines __force and __bitwise in
  confusing ways that conflict with ours.  Define it up with __CHECKER__
  so that linux/fs.h and our copy are acting on the same input.

- We had manually set a few of gcc's internal defines to give to sparse.
  It's easier to just ask gcc for all the defines it sets and hand those
  to sparse.

- We weren't passing the same *FLAGS to sparse as we were to CC.

- glibc has so many errors with FORTIFY turned on that sparse gives up
  and doesn't show us any errors from our code.  It's a questionable
  hack to always turn on FORTIFY ourselves, so we'll just not do that
  when building with sparse.

And add a nice '[SP]' quiet output line for sparse checks.

Signed-off-by: Zach Brown <zab@redhat.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
.gitignore
Makefile
kerncompat.h