This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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 14/01/07, Paolo Carlini <pcarlini@suse.de> wrote:
Hi Gerald,

>I noticed that -Wconversion now issues warnings in libstdc++.
>
>
in a nutshell, what is happening is that a difference of two pointers is
assigned to an unsigned variable. First blush, the warning seems to me a
bit overzealous, but if we concur that this is what we *really* want for
4.3, we can change the affected (very old, indeed) lines of code, no
problem at all.

Hi Paolo,


Wconversion is supposed to warn for conversions that may change a
value. Can the resulting value change when converted to unsigned? If
so, the warning is warranted (I think).

Anyhow, Wconversion needs fine-tuning and I prefer for it to be useful
rather than to literally follow its definition, so if this operation
is quite frequent and safe, I could detect it and avoid the warning.

I am no GCC or C++ expert, so please give me more information on the
issue and feedback from others would be appreciated.

Cheers,

Manuel.


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