This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: -Wconversion versus libstdc++


On 18/01/07, Gabriel Dos Reis <gdr@cs.tamu.edu> wrote:
On Thu, 18 Jan 2007, Manuel López-Ibáñez wrote:

| Does that apply also to:
|
| unsigned int y = -10;

Yes.


Then, why Wconversion has warned about it at least since http://gcc.gnu.org/onlinedocs/gcc-3.0.4/gcc_3.html#SEC11 ?

Moreover, most people that use Wconversion nowadays, use it just for
that warning despite all the noise produced by the prototype warnings,
that they continually claim to hate. For example:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9072
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13945

And my favourite, Gabriel dos Reis willing to implement a warning for
int->unsigned int for g++:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26167#c3

:-) I hope you understand why I think the issue is not as clear to me
as it seems to be for you.

Finally, why libstdc++ is using Wconversion at all? I don't think it
is to get warnings about adding prototypes to code, because those
don't appear in C++, so it can only be to get a warning about unsigned
int y = -10, since that is the only other documented thing that
Wconversion did up to GCC 4.3 (which is not even in stage2).

I am still confused, sorry.

Manuel.

PS: I have included Joseph Myers in the CC list, since he has been
thinking about this for some time and listening to the repeated
complains from security people about the useless old Wconversion and
how badly a new one was needed, mentioning as an example
signed->unsigned conversion:

http://gcc.gnu.org/ml/gcc-bugs/2000-11/msg00140.html
http://archives.neohapsis.com/archives/linux/lsap/2000-q4/0152.html

I wish we could consult with those people when and when not such
conversions could produce a security risk, so we can fine-tune the
warning.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]