Excellent docs on numeric casting in C++
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Sin datos de lenguaje
- Estrellas
- 110
- Forks
- 17
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
Without strict compiler warnings, it is possible to write quite a bit of C++ without it be obvious once needs to study the details of numeric casting. Implicit conversion will convert various integer types to other integer types and to floating point types, quietly and hopefully correctly.
Because we can't have correct code based on hope, we should instead enable warnings from the get go that warn about implicit conversion and specifically truncating or narrowing conversion and convertions that might overflow.
So, we want to enable warnings like -Wconversion per #37.
What this means is that you'll get loud warnings right away about converting types and will need to figure out how to avoid or suppress them correctly, to fix the potential existing bugs they hint at and avoid creating new bugs in the process.
Refs https://github.com/mapbox/node-cpp-skel/pull/78#discussion_r144410926 https://github.com/mapbox/carmen-cache/issues/94
refs https://github.com/mapbox/gzip-hpp/pull/19#issuecomment-336537155
/cc @mapsam @GretaCB @flippmoke
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza revisando el issue #37 y las discusiones y pull requests referenciados para comprender la configuración prevista de las advertencias. Después, inspecciona la configuración de compilación del repositorio y compila con las advertencias de conversión propuestas. Se considera terminado cuando las advertencias están habilitadas y las advertencias existentes resultantes sobre truncamiento, narrowing, desbordamiento o conversión implícita se han corregido o suprimido explícitamente.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- cpp
- Área
- build-system, tooling
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100