Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error: narrowing conversion of ‘194’ from ‘int’ to ‘char’ inside { } [duplicate]

I use -Wall and updating to new gcc I have got a lot of warning: narrowing conversion. I want to disable them, but leave all other warnings untouched (ideally).

I can find nothing about narrowing in http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html

How to disable narrowing conversion warnings? Is it possible at all?

P.S.

  1. I need to Disable warnings, not fix them in the source code.

  2. Blind -Wno-conversion doesn't help.

like image 529
klm123 Avatar asked Nov 19 '22 14:11

klm123


1 Answers

As gx_ said, adding -Wno-narrowing to your command line should ignore those errors. Encountered this myself when upgrading to C++0x.

like image 130
Stryck Avatar answered Dec 09 '22 12:12

Stryck