Consider -Wconversion warnings
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 35/100
- Type d'issue
- Refactorisation
- Clarté
- À clarifier
- Activité
- Active
- Stack technique
- cpp
- Domaine
- build-system
Piste de recherche
Start by reproducing the reported build with clang++ and the -Wconversion flags from the M1mac README. Inspect the warnings, including the example in Rcpp/sugar/functions/mean.h, and determine the agreed scope; done means the project has a documented decision and the selected warnings are resolved or intentionally excluded.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Enabling -Wconversion (particularly with clang++ as on the M1mac machine at CRAN, see its README) exposes a number of warnings. The Oxford machine uses clang++-21, on Ubuntu 26.04 we also have clang++-22 which Vienna uses (without the same options). Per the README this uses
CFLAGS="-falign-functions=8 -g -O2 -Wall -pedantic -Wconversion -Wno-sign-conversion -Wstrict-prototypes"
C17FLAGS="-falign-functions=8 -g -O2 -Wall -pedantic -Wconversion -Wno-sign-conversion -Wno-strict-prototypes"
# ...
CXXFLAGS="-g -O2 -Wall -pedantic -Wconversion -Wno-sign-conversion"
Note that this turns 'sign-conversion' warnings off. Those account for a ton. I found first set of changes we could make by not doing this i.e. by running with only -Wconversion. That may be too radical, but it could still hide some overflows.
Also, our own compilation is 'clean' under -Wconversion -Wno-sign-conversion however other package may see
In file included from /Users/ripley/R/Library/Rcpp/include/Rcpp/sugar/functions/functions.h:63:
/Users/ripley/R/Library/Rcpp/include/Rcpp/sugar/functions/mean.h:38:14: warning: implicit conversion from 'R_xlen_t' (aka 'long') to 'long double' may lose precision [-Wimplicit-int-float-conversion]
38 | s /= n;
| ~~ ^
/Users/ripley/R/Library/Rcpp/include/Rcpp/sugar/functions/mean.h:44:20: warning: implicit conversion from 'R_xlen_t' (aka 'long') to 'long double' may lose precision [-Wimplicit-int-float-conversion]
44 | s += t/n;
| ~^
- Langage dominant
- C++
- Étoiles
- 799
- Forks
- 219
- Merge moyen
- 5 h 13 min
- PR mergées (30 j)
- 6
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de RcppCore/Rcpp
-
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 30/100
Toutes les issues de RcppCore/Rcpp
Issues similaires
-
[BUG] Ouvertebug
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
eunomia-bpf/llvmbpf#51 · 1 commentaire ·
-
status:needs-triage
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
PX4/PX4-Autopilot#28776 ·
-
Website Doc Typo Ouverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 92/100
-
Difficulté 1/5 1-3 heures Accessibilité débutants 92/100
autowarefoundation/autoware_universe#13413 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100