Hi all,

Short version:

I have to choose between:

(a) keep Wconversion only for warnings about prototypes causing a type
conversion different from what would happen to the same argument in
the absence of a prototype, which was its original purpose, and move
everything else to a new option (Wcoercion).

(b)  keep the warnings of conversions that may change a value in
Wconversion and move its original purpose (the warnings about
prototypes causing ... in the absence of a prototype) to a new option
(suggestions are welcome).

Long version:

As my SoC project, I am developing a new warning Wcoercion [1] that
should warn about risky type conversions, that is, conversions that
may change a value. One of the goals is to cleanup Wconversion[2].

The original purpose of Wconversion was to warn if a prototype causes
a type conversion that is different from what would happen to the same
argument in the absence of a prototype [3]. In addition, currently it
has a second feature: "warn if a negative integer constant expression
is implicitly converted to an unsigned type". Just for this latter
feature, many developers use Wconversion getting annoyed with the
results [4]. Thus, Wcoercion will takeover the second feature of
Wconversion, and leave Wconversion for its original purpose (or for a
future change of name, incorporation into another warning or simply
removal from gcc).

Nonetheless, Wconversion actually warns about many more situations
than those described in the manual page [5]. Therefore, it may be too
disruptive to take this functionality away from Wconversion since I
guess that nowadays most of the programs use Wconversion to warn for
"risky conversions" rather than for its original purpose (the
prototype thing). On the other hand, this is undocumented behaviour
and the typical answer to people using Wconversion to warn for "risky
conversions" is that this is not its intended use [3][4] (you can find
more examples in my project proposal [6]).

Conclusion:

Then, which functionality do you want to keep in Wconversion? option
(a) or option (b) ?

I personally don't have a strong opinion on the matter. Although
option (b) will force me to rename my project [1], which is sad since
I think the name was cool. But, hey! don't take that into account! I
will show some adaptability!

Regards,

Manuel.

[1] http://gcc.gnu.org/wiki/Wcoercion

[2] http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9072

[3] http://gcc.gnu.org/bugzilla/show_bug.cgi?id=6614#c5

[4] http://www.gnu.org/software/libc/FAQ.html#s-3.17

[5] Just a few:
trunk/gcc/cp/decl.c:9153:  warning (OPT_Wconversion, "conversion to
%s%s will never use a type "
trunk/gcc/cp/call.c:4230:  warning (OPT_Wconversion, "converting to
non-pointer type %qT from NULL", t);
trunk/gcc/cp/call.c:6129:  warning (OPT_Wconversion, "choosing %qD
over %qD", w->fn, l->fn);
trunk/gcc/cp/cvt.c:1063:  warning (OPT_Wconversion, "converting NULL
to non-pointer type");

[6] http://code.google.com/soc/gcc/appinfo.html?csaid=AE474DACA8C07440

Reply via email to