This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: result type of an operation betweem signed and unsigned, c++
On 4/24/07, Andrew Haley wrote:
Dima Sorkin writes:
> The following surprised me a lot: I thought that a subtraction of
> a 'signed' and 'unsigned' integers has the type "signed",
> but it seems the opposite:
No, it's not. See ISO/IEC 14882:1998(E) Section 5, Expressions,
Para. 9.
Hi.
I took a look there, now it is ok with me.
But suppose I want to review all places in my code where
1) There is an addition or a substraction between signed and unsigned int.
2) Assignment from one to other.
I know that GCC can warn me of 'signed' vs. 'unsigned'
comparison. Is there any simple way to find the others ?
Thanks, regards,
Dima.