Re: Question on GCC 4.6 and -fpermissive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Aug 10, 2011 at 7:19 AM, Jonathan Wakely <jwakely.gcc@xxxxxxxxx> wrote:
> On 10 August 2011 12:02, Jeffrey Walton wrote:
>> On Wed, Aug 10, 2011 at 5:32 AM, Jonathan Wakely <jwakely.gcc@xxxxxxxxx> wrote:
>>> On 10 August 2011 09:22, Jeffrey Walton wrote:
>>>> 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'):
>>>> [SNIP]
>>
>> [jeffrey@fedora15 ~]$ gcc --version
>> gcc (GCC) 4.6.0 20110603 (Red Hat 4.6.0-10)
>> Copyright (C) 2011 Free Software Foundation, Inc.
>> This is free software; see the source for copying conditions.  There is NO
>> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>>
>> [jeffrey@fedora15 tests]$ make 2> make.txt
>> g++ -DNDEBUG=1 -g -O2 -DSAFEINT_DISALLOW_UNSIGNED_NEGATION=1 -pipe
>> -Wall -Wextra -Wno-type-limits -Wno-unused -std=c++0x -fpermissive
>> -Wno-narrow -I../. TestMain.cpp IncDecVerify.cpp AddVerify.cpp
>> SubVerify.cpp MultVerify.cpp DivVerify.cpp ModVerify.cpp
>> UnaryVerify.cpp PtrVerify.cpp -o TestMain.exe
>> ./TestMain.exe
>> ...
>> [jeffrey@fedora15 tests]$ cat make.txt | head -1
>> IncDecVerify.cpp:427:1: warning: narrowing conversion of ‘128’ from
>> ‘int’ to ‘char’ inside { } [-fpermissive]
>> [jeffrey@fedora15 tests]$ cat make.txt | wc -l
>> 1734
>
> The combination of -std=c++0x and -fpermissive is an odd one.  "I want
> to use C++0x features, but I want to accept crufty old pre-C++98 code".
>  That's probably always going to cause some issues, and it isn't
> likely to be a priority for anyone to do anything about that.
Ideally, the code would compile cleanly under -std=c++0x. The need for
-fpermissive caught me off guard, but I don't have your knowledge of
C++. For now, I can live without a cast in the tables. I'm still
interested in seeing the non-narrowing warnings in case there's
something else that can be fixed.

For what its worth, if I had your understanding of GCC and the C++
language, I probably would not need -Wall, -Wextra, and the handful of
other warnings.

Jeff



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux