Request for warnings on implicit bool to int conversions

Gabriel Dos Reis gdr@integrable-solutions.net
Wed Mar 28 02:30:00 GMT 2012


On Tue, Mar 27, 2012 at 9:20 PM, Russ Allbery <rra@stanford.edu> wrote:
> Gabriel Dos Reis <gdr@integrable-solutions.net> writes:
>
>> I am trying to understand what the real issue is here.  Do you want
>> -Wimplicit-char-to-int to?  -Wimplicit-short-to-int?  If not, why?
>> where to stop?
>
> I think it's more about conversion *to* bool than from bool,

I can easily see why an implicit conversion from int to bool might cause
a problem, even if that is what the language standard mandates -- just
look at the most common misuses of strcmp.  But, that is not what the proposer
requested, which got me scratching my head.

-- Gaby



More information about the Gcc mailing list