From 47c77e8836d3e5774935e755df804c219f345d51 Mon Sep 17 00:00:00 2001 From: brodieG Date: Tue, 5 Dec 2023 19:51:44 -0500 Subject: [PATCH 1/2] fix -Wformat warnings --- CRAN.md | 24 +++++++++++------------- DESCRIPTION | 2 +- src/alike.c | 2 +- src/cstringr.c | 6 +++--- src/envtrack.c | 5 +++-- src/eval.c | 8 ++++---- src/misc.c | 4 ++-- src/trackinghash.c | 2 +- 8 files changed, 26 insertions(+), 27 deletions(-) diff --git a/CRAN.md b/CRAN.md index 03bd2ce..3f2a6b8 100644 --- a/CRAN.md +++ b/CRAN.md @@ -1,22 +1,20 @@ ## Submission Checklist -* Review CRAN policy -* Check version -* Run tests with - * winbuilder - * valgrind - * rchk -* Check coverage +[x] Revdeps +[x] Review CRAN policy +[x] Check version +[x] Run tests with + [x] winbuilder + [x] valgrind + [ ] rchk +[x] Check coverage +[ ] Check build user ## Submission Notes: This is a minor release primarily intended -to address the undeclared dependencies in -tests raised by Professor Hornik. - -I have removed the tests in question completely -from the built package. Previously, these tests -were run conditionally. +to address the outstanding CRAN check warnings, +and fix a minor bug. ## R CMD check --as-cran diff --git a/DESCRIPTION b/DESCRIPTION index a07510e..3848f2a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -3,7 +3,7 @@ Title: Trust, but Verify Description: Declarative template-based framework for verifying that objects meet structural requirements, and auto-composing error messages when they do not. -Version: 0.2.15 +Version: 0.2.15.9000 Authors@R: c( person("Brodie", "Gaslam", email="brodie.gaslam@yahoo.com", role=c("aut", "cre")), diff --git a/src/alike.c b/src/alike.c index 7e399e5..e6cec06 100644 --- a/src/alike.c +++ b/src/alike.c @@ -463,7 +463,7 @@ struct ALIKEC_res ALIKEC_alike_rec( res.dat.rec.envs->no_rec = !env_stack_status; if(env_stack_status < 0 && !set.suppress_warnings) { warning( - "`alike` environment stack exhausted at recursion depth %d; %s%s", + "`alike` environment stack exhausted at recursion depth %zu; %s%s", set.env_depth_max, "unable to recurse any further into environments; see ", "`env.depth.max` parameter for `vetr_settings`." diff --git a/src/cstringr.c b/src/cstringr.c index 9fa263d..bab73f9 100644 --- a/src/cstringr.c +++ b/src/cstringr.c @@ -161,7 +161,7 @@ size_t CSR_strmlen(const char * str, size_t maxlen) { size_t res = CSR_strmlen_x(str, maxlen); if(res == maxlen && *(str + res)) { // reached max len and next charcter is not NULL terminator - error("%s %s %d %s", + error("%s %s %zu %s", "Internal Error (CSR_strmlen): failed to find string terminator prior", "to maxlen", maxlen, "characters" ); @@ -217,7 +217,7 @@ char * CSR_strmcpy_int(const char * str, size_t maxlen, int warn) { size_t len = CSR_strmlen_x(str, maxlen); if(warn && len == maxlen && str[len]) - warning("CSR_strmcpy: truncated string longer than %d", maxlen); + warning("CSR_strmcpy: truncated string longer than %zu", maxlen); char * str_new = R_alloc(len + 1, sizeof(char)); @@ -262,7 +262,7 @@ void CSR_strappend(char * target, const char * str, size_t maxlen) { size_t len = CSR_strmlen_x(str, maxlen); if(len == maxlen && str[len]) - warning("CSR_strmcopy: truncated string longer than %d", maxlen); + warning("CSR_strmcopy: truncated string longer than %zu", maxlen); if(len) { if(!strncpy(target, str, len)) { diff --git a/src/envtrack.c b/src/envtrack.c index 01493c9..3e15c10 100644 --- a/src/envtrack.c +++ b/src/envtrack.c @@ -173,8 +173,9 @@ SEXP ALIKEC_env_track_test(SEXP env_list, SEXP stack_size_init, SEXP env_limit) SEXP env = VECTOR_ELT(env_list, i); if(TYPEOF(env) != ENVSXP) error( - "All contents of `env` %s at item %d\n", - "should be environments; error ", i + 1 + "All contents of `env` %s at item %jd\n", + "should be environments; error ", + i == INTMAX_MAX ? - 1 : (intmax_t) i + 1 ); res_int[i] = ALIKEC_env_track(env, envs, env_limit_int); } diff --git a/src/eval.c b/src/eval.c index f0bffc3..49f0468 100644 --- a/src/eval.c +++ b/src/eval.c @@ -67,16 +67,16 @@ struct VALC_res_list VALC_evaluate_recurse( (TYPEOF(lang2) != LANGSXP && TYPEOF(lang2) != LISTSXP) ) { // nocov start - error("%s%s" - "Internal Error: mismatched language and eval type tracking 1; contact ", + error( + "Internal Error: mismatched language and eval type tracking 1; contact " "maintainer." ); // nocov end } if(TYPEOF(CAR(act_codes)) != INTSXP) { // nocov start - error("%s%s", - "Internal error: no integer codes produced by parsing process, which ", + error( + "Internal error: no integer codes produced by parsing process, which " "should not happen; contact maintainer." ); // nocov end diff --git a/src/misc.c b/src/misc.c index 6f034a9..b7f8038 100644 --- a/src/misc.c +++ b/src/misc.c @@ -60,8 +60,8 @@ void VALC_arg_error(SEXP tag, SEXP fun_call, const char * err_base) { if(TYPEOF(tag) != SYMSXP) { // nocov start error( - "Internal Error: %s%s" - "non symbol arg names are not currently supported; ", + "Internal Error:" + "non symbol arg names are not currently supported; " "contact maintainer." ); // nocov end diff --git a/src/trackinghash.c b/src/trackinghash.c index b4d91f0..73278f6 100644 --- a/src/trackinghash.c +++ b/src/trackinghash.c @@ -107,7 +107,7 @@ int VALC_add_to_track_hash( if(new_size > max_long) { // nocov start error( - "Internal Error: attempted to allocate hash content vector bigger ", + "Internal Error: attempted to allocate hash content vector bigger " "than int size." ); // nocov end From 713a906a0bbec78810c8431a59ed54e4cc363abb Mon Sep 17 00:00:00 2001 From: brodieG Date: Tue, 5 Dec 2023 20:03:34 -0500 Subject: [PATCH 2/2] version bump --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 3848f2a..651d594 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -3,7 +3,7 @@ Title: Trust, but Verify Description: Declarative template-based framework for verifying that objects meet structural requirements, and auto-composing error messages when they do not. -Version: 0.2.15.9000 +Version: 0.2.16 Authors@R: c( person("Brodie", "Gaslam", email="brodie.gaslam@yahoo.com", role=c("aut", "cre")),