FU Logo
  • Startseite
  • Kontakt
  • Impressum
  • Home
  • Listenauswahl
  • Anleitungen

Re: [Seqan-dev] GCC unused-result warnings

<-- thread -->
<-- date -->
  • From: John Reid <j.reid@mail.cryst.bbk.ac.uk>
  • To: SeqAn Development <seqan-dev@lists.fu-berlin.de>
  • Date: Sat, 14 May 2011 08:27:53 +0100
  • Reply-to: SeqAn Development <seqan-dev@lists.fu-berlin.de>
  • Subject: 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>




<-- thread -->
<-- date -->
  • References:
    • [Seqan-dev] GCC unused-result warnings
      • From: John Reid <j.reid@mail.cryst.bbk.ac.uk>
    • Re: [Seqan-dev] GCC unused-result warnings
      • From: Manuel Holtgrewe <manuel.holtgrewe@fu-berlin.de>
  • seqan-dev - May 2011 - Archives indexes sorted by:
    [ thread ] [ subject ] [ author ] [ date ]
  • Complete archive of the seqan-dev mailing list
  • More info on this list...

Hilfe

  • FAQ
  • Dienstbeschreibung
  • ZEDAT Beratung
  • postmaster@lists.fu-berlin.de

Service-Navigation

  • Startseite
  • Listenauswahl

Einrichtung Mailingliste

  • ZEDAT-Portal
  • Mailinglisten Portal