-Wconversion versus libstdc++

Manuel López-Ibáñez lopezibanez@gmail.com
Sun Jan 14 22:49:00 GMT 2007


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.



More information about the Libstdc++ mailing list