Package: src:r-bioc-affxparser Version: 1.78.0-2 Severity: serious Tags: ftbfs trixie sid
Dear maintainer: Hi, I'm summitting a patch for fixing this FTBFS problem while building with r-base-dev=4.5.0-1 on Debian sid,trixie. My patch Fix-FTBFS.patch replace Calloc() and Free() with R_Calloc() and R_Free(), accoding to the R-project's NEWS(R: R News <https://cran.r-project.org/doc/manuals/r-release/NEWS.html>) And by the way, Please help me for uploading this patch to upstream if you think it's necessary. Best regards, liwenjun
Description: Fix FTBFS error on r-base-dev=4.5.0-1 This patch replace Calloc and Free to R_Calloc R_Free for fixing FTBFS errors on DEBIAN sid, trixy. Accoding to the R-project's NEWS.(https://cran.r-project.org/doc/manuals/r-release/NEWS.html). Latest version(4.5.0) has been changed those funtions to R_xxx. Author: liwenjun <liwen...@kylinos.cn> Origin: other, None Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1103217 Last-Update: 2025-04-16 --- r-bioc-affxparser-1.78.0.orig/src/R_affx_bpmap_parser.cpp +++ r-bioc-affxparser-1.78.0/src/R_affx_bpmap_parser.cpp @@ -90,41 +90,41 @@ extern "C" { SET_STRING_ELT(seqInfoNames, kk, mkChar("name")); str = seq.GetName(); str_length = str.size(); - cstr = Calloc(str_length+1, char); + cstr = R_Calloc(str_length+1, char); strncpy(cstr, str.c_str(), str_length); cstr[str_length] = '\0'; SET_VECTOR_ELT(seqInfo, kk++, ScalarString(mkChar(cstr))); - Free(cstr); + R_Free(cstr); SET_STRING_ELT(seqInfoNames, kk, mkChar("groupname")); str = seq.GroupName(); str_length = str.size(); - cstr = Calloc(str_length+1, char); + cstr = R_Calloc(str_length+1, char); strncpy(cstr, str.c_str(), str_length); cstr[str_length] = '\0'; SET_VECTOR_ELT(seqInfo, kk++, ScalarString(mkChar(cstr))); - Free(cstr); + R_Free(cstr); SET_STRING_ELT(seqInfoNames, kk, mkChar("fullname")); str = seq.FullName(); str_length = str.size(); - cstr = Calloc(str_length+1, char); + cstr = R_Calloc(str_length+1, char); strncpy(cstr, str.c_str(), str_length); cstr[str_length] = '\0'; SET_VECTOR_ELT(seqInfo, kk++, ScalarString(mkChar(cstr))); - Free(cstr); + R_Free(cstr); SET_STRING_ELT(seqInfoNames, kk, mkChar("version")); str = seq.GetSeqVersion(); str_length = str.size(); - cstr = Calloc(str_length+1, char); + cstr = R_Calloc(str_length+1, char); strncpy(cstr, str.c_str(), str_length); cstr[str_length] = '\0'; SET_VECTOR_ELT(seqInfo, kk++, ScalarString(mkChar(cstr))); - Free(cstr); + R_Free(cstr); SET_STRING_ELT(seqInfoNames, kk, mkChar("mapping")); if(seq.GetProbeMapping() == 0) @@ -154,19 +154,19 @@ extern "C" { { str = seq.GetParameter(j).Tag; str_length = str.size(); - cstr = Calloc(str_length+1, char); + cstr = R_Calloc(str_length+1, char); strncpy(cstr, str.c_str(), str_length); cstr[str_length] = '\0'; SET_STRING_ELT(seqInfoParameterNames, j, mkChar(cstr)); - Free(cstr); + R_Free(cstr); str = seq.GetParameter(j).Value; - cstr = Calloc(str_length+1, char); + cstr = R_Calloc(str_length+1, char); strncpy(cstr, str.c_str(), str_length); cstr[str_length] = '\0'; SET_STRING_ELT(seqInfoParameters, j, mkChar(cstr)); - Free(cstr); + R_Free(cstr); } setAttrib(seqInfoParameters, R_NamesSymbol, seqInfoParameterNames); @@ -262,11 +262,11 @@ extern "C" { R_affx_bpmap_seqinfo_item(seq, i_verboseFlag)); str = seq.FullName(); str_length = str.size(); - cstr = Calloc(str_length+1, char); + cstr = R_Calloc(str_length+1, char); strncpy(cstr, str.c_str(), str_length); cstr[str_length] = '\0'; SET_STRING_ELT(returnListNames, i, mkChar(cstr)); - Free(cstr); + R_Free(cstr); } setAttrib(returnList, R_NamesSymbol, returnListNames); bpmap.Close(); @@ -469,11 +469,11 @@ extern "C" { if (i_readProbeSeq) { str = seqHit.PMProbe; str_length = str.size(); - cstr = Calloc(str_length+1, char); + cstr = R_Calloc(str_length+1, char); strncpy(cstr, str.c_str(), str_length); cstr[str_length] = '\0'; SET_STRING_ELT(probeseq, j, mkChar(cstr)); - Free(cstr); + R_Free(cstr); } if (i_readStartPos) { INTEGER(startpos)[j] = seqHit.getStartPosition(); @@ -539,11 +539,11 @@ extern "C" { SET_VECTOR_ELT(resultList, i, seqObj); str = seq.FullName(); str_length = str.size(); - cstr = Calloc(str_length+1, char); + cstr = R_Calloc(str_length+1, char); strncpy(cstr, str.c_str(), str_length); cstr[str_length] = '\0'; SET_STRING_ELT(resultListNames, i, mkChar(cstr)); - Free(cstr); + R_Free(cstr); UNPROTECT(protectCount); } --- r-bioc-affxparser-1.78.0.orig/src/R_affx_cdf_extras.cpp +++ r-bioc-affxparser-1.78.0/src/R_affx_cdf_extras.cpp @@ -91,11 +91,11 @@ extern "C" { /* Record its name */ str = cdf.GetProbeSetName(iset); str_length = str.size(); - cstr = Calloc(str_length+1, char); + cstr = R_Calloc(str_length+1, char); strncpy(cstr, str.c_str(), str_length); cstr[str_length] = '\0'; SET_STRING_ELT(names, ii, mkChar(cstr)); - Free(cstr); + R_Free(cstr); /* Get the number of groups in the unit */ int ngroups = probeset.GetNumGroups(); @@ -116,11 +116,11 @@ extern "C" { /* Get the name of the group */ str = group.GetName(); str_length = str.size(); - cstr = Calloc(str_length+1, char); + cstr = R_Calloc(str_length+1, char); strncpy(cstr, str.c_str(), str_length); cstr[str_length] = '\0'; SET_STRING_ELT(r_group_names, igroup, mkChar(cstr)); - Free(cstr); + R_Free(cstr); /* Get the number of cells (probes) in the group */ int ncells = group.GetNumCells(); @@ -232,7 +232,7 @@ extern "C" { /* Record its name */ str = cdf.GetProbeSetName(iset); str_length = str.size(); - name = Calloc(str_length+1, char); + name = R_Calloc(str_length+1, char); strncpy(name, str.c_str(), str_length); name[str_length] = '\0'; SET_STRING_ELT(names, ii, mkChar(name)); @@ -255,7 +255,7 @@ extern "C" { /* Get the name of the group */ str = group.GetName(); str_length = str.size(); - cstr = Calloc(str_length+1, char); + cstr = R_Calloc(str_length+1, char); strncpy(cstr, str.c_str(), str_length); cstr[str_length] = '\0'; @@ -272,7 +272,7 @@ extern "C" { } else { SET_STRING_ELT(r_group_names, igroup, mkChar(cstr)); } - Free(cstr); + R_Free(cstr); } /** now set the probe_set in the main probe_set list. **/ @@ -280,7 +280,7 @@ extern "C" { /** pop the group list and group names of the stack. **/ UNPROTECT(1); /* 'r_group_names' */ - Free(name); + R_Free(name); } /* for (int ii=0 ...) */ /** set the names down here at the end. **/ @@ -408,11 +408,11 @@ extern "C" { /* Record its name */ str = cdf.GetProbeSetName(iset); str_length = str.size(); - cstr = Calloc(str_length+1, char); + cstr = R_Calloc(str_length+1, char); strncpy(cstr, str.c_str(), str_length); cstr[str_length] = '\0'; SET_STRING_ELT(names, ii, mkChar(cstr)); - Free(cstr); + R_Free(cstr); /* Get the number of groups in the unit */ int ngroups = probeset.GetNumGroups(); @@ -433,11 +433,11 @@ extern "C" { /* Get the name of the group */ str = group.GetName(); str_length = str.size(); - cstr = Calloc(str_length+1, char); + cstr = R_Calloc(str_length+1, char); strncpy(cstr, str.c_str(), str_length); cstr[str_length] = '\0'; SET_STRING_ELT(r_group_names, igroup, mkChar(cstr)); - Free(cstr); + R_Free(cstr); /* Get the number of cells (probes) in the group */ int ncells = group.GetNumCells(); --- r-bioc-affxparser-1.78.0.orig/src/R_affx_cdf_parser.cpp +++ r-bioc-affxparser-1.78.0/src/R_affx_cdf_parser.cpp @@ -53,14 +53,14 @@ extern "C" { for (int iset = 0; iset < nsets; iset++) { str = cdf.GetProbeSetName(iset); str_length = str.size(); - cstr = Calloc(str_length+1, char); + cstr = R_Calloc(str_length+1, char); strncpy(cstr, str.c_str(), str_length); cstr[str_length] = '\0'; SET_STRING_ELT(names, iset, mkChar(cstr)); if (i_verboseFlag >= R_AFFX_VERBOSE) { Rprintf("Processing probeset: %s\n", cstr); } - Free(cstr); + R_Free(cstr); FusionCDFProbeSetInformation set; cdf.GetProbeSetInformation(iset, set); @@ -498,29 +498,29 @@ extern "C" { SET_STRING_ELT(names, ii, mkChar("refseq")); str = header.GetReference(); str_length = str.size(); - cstr = Calloc(str_length+1, char); + cstr = R_Calloc(str_length+1, char); strncpy(cstr, str.c_str(), str_length); cstr[str_length] = '\0'; SET_VECTOR_ELT(vals, ii++, mkString(cstr)); - Free(cstr); + R_Free(cstr); SET_STRING_ELT(names, ii, mkChar("chiptype")); str = cdf.GetChipType(); str_length = str.size(); - cstr = Calloc(str_length+1, char); + cstr = R_Calloc(str_length+1, char); strncpy(cstr, str.c_str(), str_length); cstr[str_length] = '\0'; SET_VECTOR_ELT(vals, ii++, mkString(cstr)); - Free(cstr); + R_Free(cstr); SET_STRING_ELT(names, ii, mkChar("filename")); str = cdf.GetFileName(); str_length = str.size(); - cstr = Calloc(str_length+1, char); + cstr = R_Calloc(str_length+1, char); strncpy(cstr, str.c_str(), str_length); cstr[str_length] = '\0'; SET_VECTOR_ELT(vals, ii++, mkString(cstr)); - Free(cstr); + R_Free(cstr); /** set the names down here at the end. **/ setAttrib(vals, R_NamesSymbol, names); @@ -759,7 +759,7 @@ extern "C" { PROTECT(r_unit = NEW_LIST(numUnitArguments)); str = cdf.GetProbeSetName(unit_idx); str_length = str.size(); - unitName = Calloc(str_length+1, char); + unitName = R_Calloc(str_length+1, char); strncpy(unitName, str.c_str(), str_length); unitName[str_length] = '\0'; if (i_verboseFlag >= R_AFFX_VERBOSE) { @@ -979,12 +979,12 @@ extern "C" { /** Put the block into the r_blocks_list and unprotect it **/ str = block.GetName(); str_length = str.size(); - cstr = Calloc(str_length+1, char); + cstr = R_Calloc(str_length+1, char); strncpy(cstr, str.c_str(), str_length); cstr[str_length] = '\0'; SET_VECTOR_ELT(r_blocks_list, iblock, r_block); SET_STRING_ELT(r_blocks_list_names, iblock, mkChar(cstr)); - Free(cstr); + R_Free(cstr); UNPROTECT(1); } @@ -1001,7 +1001,7 @@ extern "C" { ** and unprotect it. **/ SET_VECTOR_ELT(r_units_list, iunit, r_unit); SET_STRING_ELT(r_units_list_names, iunit, mkChar(unitName)); - Free(unitName); + R_Free(unitName); UNPROTECT(1); } @@ -1148,12 +1148,12 @@ extern "C" { /* 'name' is a pointer to a const char: */ str = cdf.GetProbeSetName(unitIdx); str_length = str.size(); - cstr = Calloc(str_length+1, char); + cstr = R_Calloc(str_length+1, char); strncpy(cstr, str.c_str(), str_length); cstr[str_length] = '\0'; /** ...and add to list of unit names. **/ SET_STRING_ELT(unitNames, uu, mkChar(cstr)); - Free(cstr); + R_Free(cstr); PROTECT(r_probe_set = NEW_LIST(1)); @@ -1204,11 +1204,11 @@ extern "C" { SET_VECTOR_ELT(r_group_list, igroup, cell_list); str = group.GetName(); str_length = str.size(); - cstr = Calloc(str_length+1, char); + cstr = R_Calloc(str_length+1, char); strncpy(cstr, str.c_str(), str_length); cstr[str_length] = '\0'; SET_STRING_ELT(r_group_names, igroup, mkChar(cstr)); - Free(cstr); + R_Free(cstr); /* Unprotect in reverse order */ UNPROTECT(2); /* 'indices' and then 'cell_list' */ @@ -1464,12 +1464,12 @@ extern "C" { /* get the name */ str = cdf.GetProbeSetName(unitIdx); str_length = str.size(); - cstr = Calloc(str_length+1, char); + cstr = R_Calloc(str_length+1, char); strncpy(cstr, str.c_str(), str_length); cstr[str_length] = '\0'; /** ...and add to list of unit names. **/ SET_STRING_ELT(unitNames, uu, mkChar(cstr)); - Free(cstr); + R_Free(cstr); PROTECT(r_probe_set = NEW_LIST(nbrOfUnitElements)); @@ -1622,11 +1622,11 @@ extern "C" { SET_VECTOR_ELT(r_group_list, igroup, cell_list); str = group.GetName(); str_length = str.size(); - cstr = Calloc(str_length+1, char); + cstr = R_Calloc(str_length+1, char); strncpy(cstr, str.c_str(), str_length); cstr[str_length] = '\0'; SET_STRING_ELT(r_group_names, igroup, mkChar(cstr)); - Free(cstr); + R_Free(cstr); UNPROTECT(1); /* 'cell_list' */ /* @@ -1732,11 +1732,11 @@ extern "C" { for (int uu = 0; uu < nbrOfUnits; uu++) { str = cdf.GetProbeSetName(uu); str_length = str.size(); - cstr = Calloc(str_length+1, char); + cstr = R_Calloc(str_length+1, char); strncpy(cstr, str.c_str(), str_length); cstr[str_length] = '\0'; SET_STRING_ELT(names, uu, mkChar(cstr)); - Free(cstr); + R_Free(cstr); } } else { for (int uu = 0; uu < nbrOfUnits; uu++) { @@ -1744,11 +1744,11 @@ extern "C" { unitIdx = INTEGER(units)[uu] - 1; str = cdf.GetProbeSetName(unitIdx); str_length = str.size(); - cstr = Calloc(str_length+1, char); + cstr = R_Calloc(str_length+1, char); strncpy(cstr, str.c_str(), str_length); cstr[str_length] = '\0'; SET_STRING_ELT(names, uu, mkChar(cstr)); - Free(cstr); + R_Free(cstr); } } --- r-bioc-affxparser-1.78.0.orig/src/R_affx_cel_parser.cpp +++ r-bioc-affxparser-1.78.0/src/R_affx_cel_parser.cpp @@ -34,11 +34,11 @@ extern "C" { SET_STRING_ELT(names, kk, mkChar("filename")); str = cel.GetFileName(); str_length = str.size(); - cstr = Calloc(str_length+1, char); + cstr = R_Calloc(str_length+1, char); strncpy(cstr, str.c_str(), str_length); cstr[str_length] = '\0'; SET_VECTOR_ELT(vals, kk++, mkString(cstr)); - Free(cstr); + R_Free(cstr); SET_STRING_ELT(names, kk, mkChar("version")); PROTECT(tmp = allocVector(INTSXP, 1)); @@ -67,52 +67,52 @@ extern "C" { #ifdef SUPPORT_MBCS str_length = cel.GetAlg().size(); - cstr = Calloc(str_length+1, char); + cstr = R_Calloc(str_length+1, char); wcstombs(cstr, cel.GetAlg().c_str(), str_length); cstr[str_length] = '\0'; SET_STRING_ELT(names, kk, mkChar("algorithm")); SET_VECTOR_ELT(vals, kk++, mkString(cstr)); - Free(cstr); + R_Free(cstr); str_length = cel.GetParams().size(); - cstr = Calloc(str_length+1, char); + cstr = R_Calloc(str_length+1, char); wcstombs(cstr, cel.GetParams().c_str(), str_length); cstr[str_length] = '\0'; SET_STRING_ELT(names, kk, mkChar("parameters")); SET_VECTOR_ELT(vals, kk++, mkString(cstr)); - Free(cstr); + R_Free(cstr); str_length = cel.GetChipType().size(); - cstr = Calloc(str_length+1, char); + cstr = R_Calloc(str_length+1, char); wcstombs(cstr, cel.GetChipType().c_str(), str_length); cstr[str_length] = '\0'; SET_STRING_ELT(names, kk, mkChar("chiptype")); SET_VECTOR_ELT(vals, kk++, mkString(cstr)); - Free(cstr); + R_Free(cstr); str_length = cel.GetHeader().size(); - cstr = Calloc(str_length+1, char); + cstr = R_Calloc(str_length+1, char); wcstombs(cstr, cel.GetHeader().c_str(), str_length); cstr[str_length] = '\0'; SET_STRING_ELT(names, kk, mkChar("header")); SET_VECTOR_ELT(vals, kk++, mkString(cstr)); - Free(cstr); + R_Free(cstr); str_length = cel.GetDatHeader().size(); - cstr = Calloc(str_length+1, char); + cstr = R_Calloc(str_length+1, char); wcstombs(cstr, cel.GetDatHeader().c_str(), str_length); cstr[str_length] = '\0'; SET_STRING_ELT(names, kk, mkChar("datheader")); SET_VECTOR_ELT(vals, kk++, mkString(cstr)); - Free(cstr); + R_Free(cstr); str_length = cel.GetLibraryPackageName().size(); - cstr = Calloc(str_length+1, char); + cstr = R_Calloc(str_length+1, char); wcstombs(cstr, cel.GetLibraryPackageName().c_str(), str_length); cstr[str_length] = '\0'; SET_STRING_ELT(names, kk, mkChar("librarypackage")); SET_VECTOR_ELT(vals, kk++, mkString(cstr)); - Free(cstr); + R_Free(cstr); #else --- r-bioc-affxparser-1.78.0.orig/src/R_affx_chp_parser.cpp +++ r-bioc-affxparser-1.78.0/src/R_affx_chp_parser.cpp @@ -42,7 +42,7 @@ wcs_to_cstr(std::wstring wstr) int str_length; char* cstr; str_length = wstr.size(); - cstr = Calloc(str_length+1, char); + cstr = R_Calloc(str_length+1, char); wcstombs(cstr, wstr.c_str(), str_length); cstr[str_length] = '\0'; return cstr; @@ -62,13 +62,13 @@ R_affx_AddCHPMeta(AffymetrixGuidType fil SET_NAMED_ELT(lst, lstIdx, mkString(fileId.c_str()), nms, "FileId"); SET_NAMED_ELT(lst, lstIdx+1, mkString(cstr = wcs_to_cstr(algName)), nms, "AlgorithmName"); - Free(cstr); + R_Free(cstr); SET_NAMED_ELT(lst, lstIdx+2, mkString(cstr = wcs_to_cstr(algVersion)), nms, "AlgorithmVersion"); - Free(cstr); + R_Free(cstr); SET_NAMED_ELT(lst, lstIdx+3, mkString(cstr = wcs_to_cstr(arrayType)), nms, "ArrayType"); - Free(cstr); + R_Free(cstr); return lstIdx+4; } @@ -81,10 +81,10 @@ R_affx_AddCHPTileMeta(AffymetrixGuidType SET_NAMED_ELT(lst, lstIdx, mkString(fileId.c_str()), nms, "FileId"); SET_NAMED_ELT(lst, lstIdx+1, mkString(cstr = wcs_to_cstr(algName)), nms, "AlgorithmName"); - Free(cstr); + R_Free(cstr); SET_NAMED_ELT(lst, lstIdx+2, mkString(cstr = wcs_to_cstr(algVersion)), nms, "AlgorithmVersion"); - Free(cstr); + R_Free(cstr); return lstIdx+3; } @@ -100,10 +100,10 @@ R_affx_GetList(FusionTagValuePairTypeLis for(FusionTagValuePairTypeList::iterator param=params.begin(); param != params.end(); ++pIdx, ++param) { PROTECT(pVal = mkString(cstr = wcs_to_cstr(param->Value))); - Free(cstr); + R_Free(cstr); SET_NAMED_ELT(pLst, pIdx, pVal, pNms, cstr = wcs_to_cstr(param->Tag)); - Free(cstr); + R_Free(cstr); UNPROTECT(1); } SET_NAMES(pLst, pNms); @@ -126,7 +126,7 @@ R_affx_GetList(ParameterNameValueTypeLis for(ParameterNameValueTypeList::iterator param=params.begin(); param != params.end(); ++pIdx, ++param) { PROTECT(pName = mkString(cstr = wcs_to_cstr(param->GetName()))); - Free(cstr); + R_Free(cstr); switch(param->GetParameterType()) { case ParameterNameValueType::Int8Type: @@ -150,7 +150,7 @@ R_affx_GetList(ParameterNameValueTypeLis break; case ParameterNameValueType::TextType: PROTECT(pVal = mkString(cstr = wcs_to_cstr(param->GetValueText()))); - Free(cstr); + R_Free(cstr); break; case ParameterNameValueType::AsciiType: PROTECT(pVal = mkString(param->GetValueAscii().c_str())); @@ -328,7 +328,7 @@ R_affx_GetCHPGenotypingResults(FusionCHP //FIXME: I did not think AlgName could be "", it is, so we are stuck //with that PROTECT(alg = mkString(cstr = wcs_to_cstr(chp->GetHeader().GetAlgName()))); - Free(cstr); + R_Free(cstr); nprotect++; if(chp->GetHeader().GetAlgName() == L"WholeGenome") { @@ -650,13 +650,13 @@ SEXP R_affx_ReadTilingDataSeqHeader(Tili PROTECT(header = NEW_LIST(4)); PROTECT(hnames = NEW_CHARACTER(4)); SET_NAMED_ELT(header, 0, mkString(cstr = wcs_to_cstr(seq.name)), hnames, "name"); - Free(cstr); + R_Free(cstr); SET_NAMED_ELT(header, 1, mkString(cstr = wcs_to_cstr(seq.groupName)), hnames, "groupName"); - Free(cstr); + R_Free(cstr); SET_NAMED_ELT(header, 2, mkString(cstr = wcs_to_cstr(seq.version)), hnames, "version"); - Free(cstr); + R_Free(cstr); SET_NAMED_ELT(header, 3, R_affx_GetList(seq.parameters), hnames, "parameters");