From b8fd58cbc81ce8605025a8e6ad45843fc5099a41 Mon Sep 17 00:00:00 2001 From: Simon Garnier Date: Thu, 30 Nov 2023 10:44:38 -0500 Subject: [PATCH] Fix new CRAN check errors. --- DESCRIPTION | 5 +-- NEWS.md | 12 ++++++ R/cec.R | 2 +- cran-comments.md | 99 +++++++++++++++++++++++++----------------------- src/cec_r.cpp | 12 +++--- 5 files changed, 73 insertions(+), 57 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 461d3e2..f7ac5d5 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: CEC Type: Package Title: Cross-Entropy Clustering -Version: 0.11.0 -Date: 2022-12-12 +Version: 0.11.1 +Date: 2023-11-30 Authors@R: c( person("Kamieniecki", "Konrad", email = "konrad.kamieniecki@alumni.uj.edu.pl", role = c("aut")), @@ -29,7 +29,6 @@ Imports: stats, utils NeedsCompilation: yes -SystemRequirements: C++11 License: GPL-3 RoxygenNote: 7.2.3 Suggests: diff --git a/NEWS.md b/NEWS.md index f6378d7..4a7dde8 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,15 @@ +# CEC v0.11.1 + +## New features + +* N/A. + +## Minor improvements and fixes + +* Fixing new CRAN check errors. + +--- + # CEC v0.11.0 ## New features diff --git a/R/cec.R b/R/cec.R index 443a567..f1ad3ff 100644 --- a/R/cec.R +++ b/R/cec.R @@ -7,7 +7,7 @@ #' #' @param x A numeric matrix of data. Each row corresponds to a distinct #' observation; each column corresponds to a distinct variable/dimension. It -#' must not contain \code{NA} values. +#' must not contain \code{NA} values. #' #' @param centers Either a matrix of initial centers or the number of initial #' centers (\code{k}, single number \code{cec(data, 4, ...)}) or a vector for diff --git a/cran-comments.md b/cran-comments.md index 5e2e9f8..6d2fb22 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,7 +1,7 @@ ## Test environments -* local M1 OS X 13.0.1, R 4.2.2 -* local M1 OS X 13.0.1, R-devel +* local M1 OS X 14.1.1, R 4.3.2 +* local M1 OS X 14.1.1, R-devel * Github Actions "windows-latest (release)" * Github Actions "macOS-latest (release)" * Github Actions "ubuntu-latest (release)" @@ -10,62 +10,67 @@ * r-hub Windows Server 2022, R-devel, 64 bit * r-hub Ubuntu Linux 20.04.1 LTS, R-release, GCC * r-hub Fedora Linux, R-devel, clang, gfortran +* r-hub Debian Linux, R-devel, GCC ASAN/UBSAN * win-builder.r-project.org ## R CMD check results There were no ERRORs or WARNINGs. -"Possibly misspelled words in DESCRIPTION: - CEC (16:17, 19:5) - Spurek (19:33)" - -These are the correct spellings. - -"Found the following (possibly) invalid URLs: - URL: - From: README.md - Message: Empty URL" - -Fixed. - ## Downstream dependencies There are currently no downstream dependencies for this package. ## CRAN team comments -"Please always write package names, software names and API (application -programming interface) names in single quotes in title and description. -e.g: --> 'CEC' -Please note that package names are case sensitive." - -Fixed. - -"Please do not use on.exit() to reset user's options(), working directory -or par() after you changed it in examples and vignettes and demos. e.g.: -man/cec.Rd -Please reset in the following way -e.g.: -oldpar <- par(mfrow = c(1,2)) -... -par(oldpar)" - -Fixed. +This submission fixes the following CRAN check issues: + +Version: 0.11.0 +Check: whether package can be installed +Result: WARN + Found the following significant warnings: + cec_r.cpp:65:15: warning: format string is not a string literal (potentially insecure) [-Wformat-security] + cec_r.cpp:75:11: warning: format string is not a string literal (potentially insecure) [-Wformat-security] + cec_r.cpp:123:15: warning: format string is not a string literal (potentially insecure) [-Wformat-security] + cec_r.cpp:133:11: warning: format string is not a string literal (potentially insecure) [-Wformat-security] + cec_r.cpp:160:15: warning: format string is not a string literal (potentially insecure) [-Wformat-security] + cec_r.cpp:167:15: warning: format string is not a string literal (potentially insecure) [-Wformat-security] + See ‘/home/hornik/tmp/R.check/r-devel-clang/Work/PKGS/CEC.Rcheck/00install.out’ for details. + * used C++ compiler: ‘Debian clang version 17.0.5 (1)’ +Flavor: r-devel-linux-x86_64-debian-clang + +Version: 0.11.0 +Check: C++ specification +Result: NOTE + Specified C++11: please drop specification unless essential +Flavors: r-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc, r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-devel-windows-x86_64, r-patched-linux-x86_64, r-release-linux-x86_64, r-release-macos-arm64, r-release-macos-x86_64, r-release-windows-x86_64 + +Version: 0.11.0 +Check: Rd files +Result: NOTE + checkRd: (-1) cec.Rd:164-165: Lost braces in \itemize; meant \describe ? + checkRd: (-1) cec.Rd:166-168: Lost braces in \itemize; meant \describe ? + checkRd: (-1) cec.Rd:169-172: Lost braces in \itemize; meant \describe ? + checkRd: (-1) cec.Rd:173-175: Lost braces in \itemize; meant \describe ? + checkRd: (-1) cec.Rd:176-177: Lost braces in \itemize; meant \describe ? + checkRd: (-1) cec.Rd:178-180: Lost braces in \itemize; meant \describe ? + checkRd: (-1) cec.Rd:181-182: Lost braces in \itemize; meant \describe ? + checkRd: (-1) init.centers.Rd:19-20: Lost braces in \itemize; meant \describe ? + checkRd: (-1) init.centers.Rd:21-22: Lost braces in \itemize; meant \describe ? +Flavors: r-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc + +Version: 0.11.0 +Check: whether package can be installed +Result: WARN + Found the following significant warnings: + cec_r.cpp:65:15: warning: format string is not a string literal (potentially insecure) [-Wformat-security] + cec_r.cpp:75:11: warning: format string is not a string literal (potentially insecure) [-Wformat-security] + cec_r.cpp:123:15: warning: format string is not a string literal (potentially insecure) [-Wformat-security] + cec_r.cpp:133:11: warning: format string is not a string literal (potentially insecure) [-Wformat-security] + cec_r.cpp:160:15: warning: format string is not a string literal (potentially insecure) [-Wformat-security] + cec_r.cpp:167:15: warning: format string is not a string literal (potentially insecure) [-Wformat-security] + See ‘/data/gannet/ripley/R/packages/tests-clang/CEC.Rcheck/00install.out’ for details. + * used C++ compiler: ‘clang version 17.0.5’ +Flavor: r-devel-linux-x86_64-fedora-clang --- - -The package appeared to have been "orphaned" and I am "adopting" it as new -maintainer. CRAN check errors were not corrected for months, there has not been -any activity on the package's GitHub repository in more than a year, and the -previous maintainer have not replied to my or others' messages to fix the check -errors. - -I have conserved the attribution structure of the package and just added myself -as the new maintainer. I have also fixed the check errors, updated the -documentation, and made code modifications that do not alter the usage of -user-facing functions or modify their output for maintaining continuity with the -previous versions of the package on CRAN. - -If this "adoption" is not acceptable for CRAN policies, please disregard this -submission. diff --git a/src/cec_r.cpp b/src/cec_r.cpp index 1ca0af6..9fb8e1f 100644 --- a/src/cec_r.cpp +++ b/src/cec_r.cpp @@ -62,7 +62,7 @@ SEXP cec_r(SEXP x_r, SEXP centers_param_r, SEXP control_param_r, SEXP models_par } if (ex_what) - error(ex_what); + error("%s", ex_what); try { SEXP r_res; @@ -72,7 +72,7 @@ SEXP cec_r(SEXP x_r, SEXP centers_param_r, SEXP control_param_r, SEXP models_par } catch (std::exception &ex) { ex_what = ex.what(); } - error(ex_what); + error("%s", ex_what); } extern "C" @@ -120,7 +120,7 @@ SEXP cec_split_r(SEXP x_r, SEXP centers_param_r, SEXP control_param_r, SEXP mode } if (ex_what) - error(ex_what); + error("%s", ex_what); try { SEXP r_res; @@ -130,7 +130,7 @@ SEXP cec_split_r(SEXP x_r, SEXP centers_param_r, SEXP control_param_r, SEXP mode } catch (std::exception &ex) { ex_what = ex.what(); } - error(ex_what); + error("%s", ex_what); } extern "C" @@ -157,14 +157,14 @@ SEXP cec_init_centers_r(SEXP x_r, SEXP k_r, SEXP method_r) { } if (ex_what) - error(ex_what); + error("%s", ex_what); try { SEXP r_res = put(*res); return r_res; } catch (exception &ex) { ex_what = ex.what(); - error(ex_what); + error("%s", ex_what); } }