Skip to content

Commit

Permalink
Fix new CRAN check errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
sjmgarnier committed Nov 30, 2023
1 parent 42aa234 commit b8fd58c
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 57 deletions.
5 changes: 2 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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 = "[email protected]",
role = c("aut")),
Expand All @@ -29,7 +29,6 @@ Imports:
stats,
utils
NeedsCompilation: yes
SystemRequirements: C++11
License: GPL-3
RoxygenNote: 7.2.3
Suggests:
Expand Down
12 changes: 12 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion R/cec.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
99 changes: 52 additions & 47 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -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)"
Expand All @@ -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.
12 changes: 6 additions & 6 deletions src/cec_r.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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"
Expand Down Expand Up @@ -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;
Expand All @@ -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"
Expand All @@ -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);
}
}

Expand Down

0 comments on commit b8fd58c

Please sign in to comment.