- The goal of this project is to develop an option warning of any implicit conversion that may change a value. Examples of such conversions are passing a double value to a function declared to receive a float argument and setting a signed constant to an unsigned variable. The option should not warn of explicit conversions or of cases where the value cannot in fact change despite the implicit conversion. Our proposal is two warning options. One of them would encapsulate the behaviour required by protoize to detect where the addition of prototypes may led to new bugs. The other warning option will identify coercions that may change a value. Tentatively, we will call the former Wtraditional-conversion and the latter Wcoercion just for the sake of clarity and to distinguish both of them from the original Wconversion. In the final implementation the name Wconversion will be used instead of Wcoercion.
- Manuel López-Ibáñez
- Ian Lance Taylor (mentor)
- Most of the work is done. Patches are in the queue pending review.
- Current Wconversion is confusing: it encapsulates two different behaviours. As a result, Wconversion is used for the wrong purpose.
- Wcoercion implements a frequently requested feature.
- The behaviours of C and C++ front ends would be more consistent.
Better fix for bug 13932.
- C and C++ front-ends.
- Joseph Myers :
- gcc/builtins.c gcc/c.opt gcc/c-typeck.c gcc/c-common.* gcc/doc/invoke.texi gcc/doc/invoke.texi
- Jason Merrill :
- Ben Elliston :
- Ian Lance Taylor :