Question on GCC 4.6 and -fpermissive

Jeffrey Walton noloader@gmail.com
Wed Aug 10 08:23:00 GMT 2011


Hi Guys,

I'm running a table drive test suite. The tables are about 250K each,
and there are 7 of them. Each row in the table looks similar to the
following (this particular row is consumed by a 'short'):

    { 0x0001, 0x0001, <some bool> };

Without '-fpermissive' the code would not compile'. With
'-fpermissive', the code compiles but produces a warning for each line
encountered:

    AdditionVerify.cpp:68:1: warning: narrowing conversion of ‘65535’
        from ‘int’ to ‘short int’ inside { } [-fpermissive]

GCC's 4.6 docs do not appear to have a [no]warning switch for
permissive [1] (the docs for the switches don't even mention the word
'permissive'). Taking a stab in the dark, my current CXXFLAGS looks is
below, which has not helped.

    CXXFLAGS += -std=c++0x -fpermissive -Wno-permissive \
        -Wno-narrow -Wno-narrowing -Wno-narrow-conversion
        -Wno-narrowing-conversion -Wno-coversion

Any ideas on how to hush the compiler for for this warning. I'm
concerned it the volume of output might be masking more relevant
warnings.

Jeff

[1] http://gcc.gnu.org/onlinedocs/gcc-4.6.1/gcc/Warning-Options.html#Warning-Options



More information about the Gcc-help mailing list