Re: [Seqan-dev] GCC unused-result warnings
While we're on the subject I also have this warning:
/home/john/Dev/ThirdParty/C++/seqan-trunk/core/include/seqan/basic/iterator_interface.h:
In function ‘seqan::Container<seqan::SimpleType<unsigned char,
seqan::Dna5_> *>::Type & seqan::container(
seqan::SimpleType<unsigned char, seqan::Dna5_> *)’:
/home/john/Dev/ThirdParty/C++/seqan-trunk/core/include/seqan/basic/iterator_interface.h:483:
instantiated from ‘bool seqan::atBegin(const seqan::SimpleType<unsigned
char, seqan::Dna5_> *&)’
/home/john/Dev/ThirdParty/C++/seqan-trunk/core/include/seqan/modifier/modifier_reverse.h:128:
instantiated from ‘void seqan::goNext(
seqan::ModifiedIterator<seqan::SimpleType<unsigned char, seqan::Dna5_>
*, seqan::ModReverse> &)’
/home/john/Dev/ThirdParty/C++/seqan-trunk/core/include/seqan/modifier/modifier_iterator.h:410:
instantiated from ‘const seqan::ModifiedIterator<
seqan::SimpleType<unsigned char, seqan::Dna5_> *, seqan::ModReverse> &
seqan::operator++(seqan::ModifiedIterator<seqan::SimpleType<unsigned
char, seqan::Dna5_> *, seqan::ModReverse> &)’
src/sandbox/seqan_sandbox_rev_comp_iterator.cpp:28: instantiated from here
/home/john/Dev/ThirdParty/C++/seqan-trunk/core/include/seqan/basic/iterator_interface.h:379:
warning: reference to local variable ‘me’ returned
from the following code in seqan/basic/iterator_interface.h:379:
template <typename T>
inline
typename Container<T>::Type &
container(T me)
{
// TODO(holtgrew): Default implementation with auto-sequences, remove?
SEQAN_CHECKPOINT;
return me;
}
It seems strange to pass the argument by value and return a reference to
it. Is this correct? Also why might my code be instantiating a
to-be-removed function?
Here's my code:
#include <seqan/sequence.h>
#include <seqan/modifier.h>
#include <seqan/file.h>
#include <iostream>
int main( int argc, char * argv [] ) {
using namespace seqan;
typedef Dna5 dna_t;
typedef String< dna_t > string_t;
typedef Iterator< string_t >::Type iterator_t;
typedef ModifiedIterator< iterator_t, ModReverse > rev_iterator_t;
typedef ModifiedIterator< rev_iterator_t, FunctorComplement< dna_t > >
rev_comp_iterator_t;
string_t str = "ACGTNAAGGTTCC";
::std::cout << "Original string: " << str << "\n";
rev_iterator_t rev_begin( end( str ) );
rev_iterator_t rev_end( begin( str ) );
::std::cout << "Reverse string: " << str;
while( rev_begin != rev_end ) {
::std::cout << *rev_begin;
++rev_begin;
}
::std::cout << "\n";
return 0;
}
John.
On 13/05/11 21:13, Manuel Holtgrewe wrote:
John,
I just committed a patch [9638] that hopefully fixes the problem. Are
you using the SeqAn CMake scripts and flags to build your programs? I
have not seen this warning yet, although we are building with 4.4.5
for the 4.4 series.
Bests,
Manuel
Am 13.05.2011 um 19:09 schrieb John Reid:
Hi,
I get unused-result warnings with gcc 4.4.3 in the tempFileName()
function. Could you apply the attached patch to remove them? Then I'll
be able to concentrate on my own warnings....
Thanks,
John.
<unused-result.patch><ATT00001..txt>