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

Conversion warnings #2325

Open
mgeorgoulopoulos opened this issue Jul 9, 2018 · 5 comments
Open

Conversion warnings #2325

mgeorgoulopoulos opened this issue Jul 9, 2018 · 5 comments
Assignees

Comments

@mgeorgoulopoulos
Copy link

mgeorgoulopoulos commented Jul 9, 2018

I get a compilation warning in include/seqan/sequence/sequence_lexical.h : 295.

left_length = right_length;

I fixed the warning with:

left_length = static_cast<typename Size::Type>(right_length);

Would that be the correct way of handling it?

Thank you

@marehr
Copy link
Member

marehr commented Jul 17, 2018

Hi thank you for your bug report.

Could you elaborate

  • which compiler you used?
  • which source code you built which triggered this warning,
  • which warning was issued (-fconversion?) and
  • what the diagnostic of the warning was?

So in essence the log of your built messages?

Your suggested fix works, but this is the sledgehammer approach. It would be interesting to see why the two Size types of the left and right variables mismatch.

@smehringer
Copy link
Member

HI @mgeorgoulopoulos ,
Could you follow @marehr guides to help us? Otherwise, I will close this issue as this is not reproduced by our nightly builds.

@mgeorgoulopoulos
Copy link
Author

mgeorgoulopoulos commented Oct 16, 2018

Hi, here are some details:
Compiler:
Microsoft Visual Studio Enterprise 2015. Version 14.0.25431.01 Update 3

Repro

#pragma warning(disable : 4996)
#pragma warning(disable : 4521)
#pragma warning(disable : 4800)

#undef UNICODE

#include <seqan/seq_io.h>

using namespace seqan;

void foo()
{
    SeqFileIn seqFileIn("filename");
    CharString id;
    CharString seq;
	readRecord(id, seq, seqFileIn);
}

Output

1>------ Build started: Project: seqanTool, Configuration: Release Win32 ------
1>  SearchSeqAn.cpp
1>C:\seqanTool\include\seqan/sequence/sequence_lexical.h(296): warning C4267: '=': conversion from 'size_t' to 'unsigned char', possible loss of data
1>  C:\seqanTool\seqan\include\seqan/sequence/sequence_lexical.h(351): note: see reference to function template instantiation 'void seqan::compare_<unsigned char,const TLeft,const TRightValue*>(seqan::Lexical<unsigned char> &,TLeft &,TRight &)' being compiled
1>          with
1>          [
1>              TLeft=seqan::String<char,seqan::Array<2>>,
1>              TRightValue=char,
1>              TRight=const char *
1>          ]
1>  C:\seqanTool\seqan\include\seqan/sequence/sequence_lexical.h(170): note: see reference to function template instantiation 'void seqan::compare<unsigned char,TLeft,char>(seqan::Lexical<unsigned char> &,const TLeft &,const TRightValue *)' being compiled
1>          with
1>          [
1>              TLeft=seqan::String<char,seqan::Array<2>>,
1>              TRightValue=char
1>          ]
1>  C:\seqanTool\seqan\include\seqan/sequence/string_base.h(1826): note: see reference to function template instantiation 'seqan::Lexical<unsigned char>::Lexical<seqan::String<char,seqan::Array<2>>,char[3]>(const TLeft &,const TRight (&))' being compiled
1>          with
1>          [
1>              TLeft=seqan::String<char,seqan::Array<2>>,
1>              TRight=char [3]
1>          ]
1>  C:\seqanTool\seqan\include\seqan/sequence/string_base.h(1826): note: see reference to function template instantiation 'seqan::Lexical<unsigned char>::Lexical<seqan::String<char,seqan::Array<2>>,char[3]>(const TLeft &,const TRight (&))' being compiled
1>          with
1>          [
1>              TLeft=seqan::String<char,seqan::Array<2>>,
1>              TRight=char [3]
1>          ]
1>  C:\seqanTool\seqan\include\seqan/seq_io/read_embl.h(203): note: see reference to function template instantiation 'bool seqan::operator ==<char,seqan::Array<2>,char[3]>(const seqan::String<char,seqan::Array<2>> &,const TRight (&))' being compiled
1>          with
1>          [
1>              TRight=char [3]
1>          ]
1>  C:\seqanTool\seqan\include\seqan/seq_io/sequence_file.h(205): note: see reference to function template instantiation 'void seqan::readRecord<TIdString,TSeqString,seqan::Iter<seqan::VirtualStream<char,TDirection,std::char_traits<char>>,seqan::StreamIterator<TDirection>>>(TIdString &,TSeqString &,TFwdIterator &,seqan::Embl)' being compiled
1>          with
1>          [
1>              TIdString=seqan::CharString,
1>              TSeqString=seqan::CharString,
1>              TDirection=seqan::Input,
1>              TFwdIterator=seqan::Iter<seqan::VirtualStream<char,seqan::Input,std::char_traits<char>>,seqan::StreamIterator<seqan::Input>>
1>          ]
1>  C:\seqanTool\seqan\include\seqan/seq_io/sequence_file.h(229): note: see reference to function template instantiation 'void seqan::readRecord<TIdString,TSeqString,void,seqan::Embl_>(TIdString &,TSeqString &,seqan::FormattedFile<seqan::Fastq,seqan::Input,void> &,const seqan::Tag<seqan::Embl_> &)' being compiled
1>          with
1>          [
1>              TIdString=seqan::CharString,
1>              TSeqString=seqan::CharString
1>          ]
1>  C:\seqanTool\seqan\include\seqan/seq_io/sequence_file.h(231): note: see reference to function template instantiation 'void seqan::readRecord<TIdString,TSeqString,TFile,TSubList>(TIdString &,TSeqString &,TFile &,const seqan::TagSelector<TSubList> &)' being compiled
1>          with
1>          [
1>              TIdString=seqan::CharString,
1>              TSeqString=seqan::CharString,
1>              TFile=seqan::FormattedFile<seqan::Fastq,seqan::Input,void>,
1>              TSubList=seqan::TagList<seqan::Embl,seqan::TagList<seqan::GenBank,seqan::TagList<seqan::Raw,seqan::TagList<seqan::Sam,void>>>>
1>          ]
1>  C:\seqanTool\seqan\include\seqan/seq_io/sequence_file.h(231): note: see reference to function template instantiation 'void seqan::readRecord<TIdString,TSeqString,TFile,TSubList>(TIdString &,TSeqString &,TFile &,const seqan::TagSelector<TSubList> &)' being compiled
1>          with
1>          [
1>              TIdString=seqan::CharString,
1>              TSeqString=seqan::CharString,
1>              TFile=seqan::FormattedFile<seqan::Fastq,seqan::Input,void>,
1>              TSubList=seqan::TagList<seqan::Fasta,seqan::TagList<seqan::Embl,seqan::TagList<seqan::GenBank,seqan::TagList<seqan::Raw,seqan::TagList<seqan::Sam,void>>>>>
1>          ]
1>  C:\seqanTool\seqan\include\seqan/seq_io/sequence_file.h(296): note: see reference to function template instantiation 'void seqan::readRecord<TIdString,TSeqString,seqan::FormattedFile<seqan::Fastq,seqan::Input,void>,seqan::SeqInFormats>(TIdString &,TSeqString &,TFile &,const seqan::TagSelector<seqan::SeqInFormats> &)' being compiled
1>          with
1>          [
1>              TIdString=seqan::CharString,
1>              TSeqString=seqan::CharString,
1>              TFile=seqan::FormattedFile<seqan::Fastq,seqan::Input,void>
1>          ]
1>  C:\qt_apps_libs\seqan_tools\src\seqantools\SearchSeqAn.cpp(16): note: see reference to function template instantiation 'void seqan::readRecord<void,seqan::CharString,seqan::CharString>(TIdString &,TSeqString &,seqan::FormattedFile<seqan::Fastq,seqan::Input,void> &)' being compiled
1>          with
1>          [
1>              TIdString=seqan::CharString,
1>              TSeqString=seqan::CharString
1>          ]
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

@smehringer
Copy link
Member

@marehr ping

@marehr
Copy link
Member

marehr commented Oct 23, 2018

I tried to reproduce this issue and I didn't get an error.

@mgeorgoulopoulos

Build started: Project: seqanTool, Configuration: Release Win32

are you building with 32 bit? We dropped 32bit support a while a go. Could you try to build 64bit?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants