Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compiler warnings: unused parameters #1

Closed
peterjc opened this issue Nov 18, 2015 · 2 comments
Closed

compiler warnings: unused parameters #1

peterjc opened this issue Nov 18, 2015 · 2 comments

Comments

@peterjc
Copy link

peterjc commented Nov 18, 2015

Using Mac OS X 10.10.5,

$ uname
Darwin
$ g++ --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.0.0 (clang-700.1.76)
Target: x86_64-apple-darwin14.5.0
Thread model: posix

Attempting to build the latest code for chopBAI, specifically commit 6dfdaa5 as follows:

$ git clone https://github.com/seqan/seqan.git
$ git clone https://github.com/DecodeGenetics/chopBAI.git
$ cd chopBAI
$ emacs Makefile
...
$ git diff
diff --git a/Makefile b/Makefile
index 24ec4fb..04eb225 100644
--- a/Makefile
+++ b/Makefile
@@ -4,7 +4,7 @@ CC=$(CXX)

 # Set this to include SeqAn libraries, either system wide
 # or download into current folder and set to .
-SEQAN_LIB=.
+SEQAN_LIB=../seqan/include/

 CXXFLAGS+=-I$(SEQAN_LIB) -DSEQAN_HAS_ZLIB=1
 LDLIBS=-lz -lpthread

Then compiling gives:

$ make
g++ -I../seqan/include/ -DSEQAN_HAS_ZLIB=1 -DDATE=\""on 2015-11-06 17:36:57"\" -W -Wall -Wno-long-long -pedantic -Wno-variadic-macros -O3 -DSEQAN_ENABLE_TESTING=0 -DSEQAN_ENABLE_DEBUG=0 -Qunused-arguments  -c -o chopBAI.o chopBAI.cpp
In file included from chopBAI.cpp:7:
./bam_index_csi.h:173:55: warning: unused parameter 'bamFile' [-Wunused-parameter]
bool jumpToOrphans(FormattedFile<Bam, Input, TSpec> & bamFile,
                                                      ^
./bam_index_csi.h:174:27: warning: unused parameter 'hasAlignments' [-Wunused-parameter]
                   bool & hasAlignments,
                          ^
./bam_index_csi.h:175:42: warning: unused parameter 'index' [-Wunused-parameter]
                   BamIndex<Csi> const & index)
                                         ^
3 warnings generated.
g++   chopBAI.o  -lz -lpthread -o chopBAI

Compilation gives three warnings as shown above, but seems to work:

$ ./chopBAI --version
./chopBAI version 0.1 beta
@pmelsted
Copy link
Contributor

Thanks for reporting this. The CSI format is not a part of SeqAn so we implemented something basic instead and kept the same API. The function jumpToOrphans, to find the unaligned readpairs in a BAM file is not used in the code and not implemented, but is just a stub. So even if clang complains about unused options the binary is still fine.

@peterjc
Copy link
Author

peterjc commented Nov 18, 2015

Its good to hear this is a harmless warning, but can you not silence the warning in these cases? e.g. using a pragma or a void statement line inside the function (with an explanatory comment).

Having chopBAI compile without warnings would be a big improvement.

bkehr added a commit that referenced this issue Nov 18, 2015
pmelsted added a commit that referenced this issue Nov 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants