views:

294

answers:

4

The compiler complains about this, after I activated all kind of warnings:

I create an NSNumber like this:

NSNumber *num = [NSNumber numberWithBool:YES];

warning: passing argument 1 of 'numberWithBool:' with different width due to prototype

it complains about the value I provided. What's wrong with "YES"? What does that mean?

+1  A: 

It means that you have turned on one of the über-anal warnings about type coercion related to size changes. The compiler is complaining -- likely erroneously, from what I can tell -- that YES is being converted from one width to another -- from 8 bits to 32, most likely.

Turn off that particular warning. There are a number of compiler warnings that have grown to be effectively useless over the years.

bbum
A: 

how i can turn off this warning in gcc/g++?

yus
+1  A: 

Try removing -Wconversion, or if that's not there, adding -Wno-conversion

jdelStrother
A: 

Remove -Wconversion

See man (1) gcc

quatrox