SCM

[#5119] export_plink.cpp:116:57: warning: index of massive has type "char" [-Wchar-subscripts]

Date:
2013-11-20 08:27
Priority:
3
State:
Open
Submitted by:
Maksim Struchalin (maksim)
Assigned to:
Nobody (None)
Resolution:
None
Operating System:
None
Severity:
normal
Hardware:
None
Version:
None
Component:
GenABEL
URL:
Summary:
export_plink.cpp:116:57: warning: index of massive has type "char" [-Wchar-subscripts]

Detailed description
The 116 line export_plink.cpp contains a weird thing: the element of massive is addresed by a variable with "char" type.

The line 116 in the fuction export_plink: fileWoA << " " << Genotype[gtMatrix[i][csnp]]

Here is:
1) std::string* Genotype = new (std::nothrow) std::string [4];
2) char **gtMatrix = new (std::nothrow) char*[nids];
for (int i=0; i<nids; i++)
{
gtMatrix[i] = new (std::nothrow) char[nsnps];
}

gtMatrix[i][csnp] returns char and this char is used as an index for Genotype. I do not understand how it works.

My question is: who wrote this code for "export_plink"? Can you help me to fix it if this an error?

Compiler report a warning on it, so we need to fix it anyways.

Comments:

No Comments Have Been Posted

Attached Files:

Changes

No Changes Have Been Made to This Item

Thanks to:
Vienna University of Economics and Business Powered By FusionForge