From 5eb33a68ed481cce7aab1f1b20fe3fbd96b1b0eb Mon Sep 17 00:00:00 2001 From: Xiuwen Zheng Date: Fri, 19 Jan 2024 02:19:18 -0600 Subject: [PATCH] fix compiler warnings --- DESCRIPTION | 4 ++-- NEWS | 6 ++++++ src/HIBAG.cpp | 4 ++-- src/LibHLA.cpp | 4 ++-- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 055ccfe..4f0b3bf 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: HIBAG Type: Package Title: HLA Genotype Imputation with Attribute Bagging -Version: 1.38.1 -Date: 2023-12-12 +Version: 1.38.2 +Date: 2024-01-19 Depends: R (>= 3.2.0) Imports: methods, RcppParallel Suggests: parallel, ggplot2, reshape2, gdsfmt, SNPRelate, SeqArray, knitr, diff --git a/NEWS b/NEWS index 1e22a4b..41cdd62 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,9 @@ +CHANGES IN VERSION 1.38.2 +------------------------- + + o fix compiler warnings: -Wformat & -Wformat-security + + CHANGES IN VERSION 1.38.1 ------------------------- diff --git a/src/HIBAG.cpp b/src/HIBAG.cpp index 57dfcfb..4d0f409 100755 --- a/src/HIBAG.cpp +++ b/src/HIBAG.cpp @@ -56,7 +56,7 @@ extern "C" catch (...) { \ _LastError = "unknown error!"; has_error = true; \ } \ - if (has_error) error(_LastError.c_str()); \ + if (has_error) Rf_error("%s", _LastError.c_str()); \ return rv_ans; @@ -459,7 +459,7 @@ static void model_free(SEXP ptr_obj) } catch (...) { _LastError = "unknown error!"; has_error = true; } - if (has_error) error(_LastError.c_str()); + if (has_error) Rf_error("%s", _LastError.c_str()); } } } diff --git a/src/LibHLA.cpp b/src/LibHLA.cpp index 06227ce..e5ca5b2 100755 --- a/src/LibHLA.cpp +++ b/src/LibHLA.cpp @@ -2074,10 +2074,10 @@ void CVariableSelection::Search(CBaseSampling &VarSampling, if (verbose_detail) { Rprintf(" %2d, SNP: %d, loss: %g, oob acc: %0.2f%%, # of haplo: %d\n", - OutSNPIndex.size(), OutSNPIndex.back()+1, + (int)OutSNPIndex.size(), OutSNPIndex.back()+1, Global_Min_Loss, double(Global_Max_OutOfBagAcc) / NumOOB * 50, - OutHaplo.Num_Haplo); + (int)OutHaplo.Num_Haplo); } CheckInterrupt(); } else {