]> git.cworth.org Git - notmuch/commit
lib: fix warnings when building with clang
authorJani Nikula <jani@nikula.org>
Mon, 1 Oct 2012 07:36:11 +0000 (09:36 +0200)
committerDavid Bremner <bremner@debian.org>
Sat, 1 Dec 2012 12:10:32 +0000 (08:10 -0400)
commit5505d55515594025fe319c5150fdb360b0ffcd60
tree2e602879ed1d5d98d5fecb1bf370b807520952e9
parent869986f725b3dfa0260671e4a1256b8c8c072864
lib: fix warnings when building with clang

Building notmuch with CC=clang and CXX=clang++ produces the warnings:

CC -O2 lib/tags.o
lib/tags.c:43:5: warning: expression result unused [-Wunused-value]
    talloc_steal (tags, list);
    ^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/talloc.h:345:143: note: expanded from:
  ...__location__); __talloc_steal_ret; })
                    ^~~~~~~~~~~~~~~~~~
1 warning generated.

CXX -O2 lib/message.o
lib/message.cc:791:5: warning: expression result unused [-Wunused-value]
    talloc_reference (message, message->tag_list);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/talloc.h:932:36: note: expanded from:
  ...(_TALLOC_TYPEOF(ptr))_talloc_reference_loc((ctx),(ptr), __location__)
     ^                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.

Check talloc_reference() return value, and explicitly ignore
talloc_steal() return value as it has no failure modes, to silence the
warnings.
lib/message.cc
lib/tags.c