First, many thanks to Ian for stepping forward to make this happen.

On Thu, Jun 19, 2008 at 1:55 AM, Kaveh R. GHAZI <[EMAIL PROTECTED]> wrote:
> On Thu, 19 Jun 2008, Kaveh R. GHAZI wrote:
>
>> [...] I believe some work could be done (maybe even on mainline) to
>> activate -Wc++-compat during bootstrap as a warning only, (not an
>> error).  E.g.:
>>
>>       #pragma GCC diagnostic warning "-Wc++-compat"
>>
>> This would help clean up some of the easy stuff and make the branch diffs
>> much smaller.
>
> Some stats, I ran a quick make including the above #pragma in system.h, I
> get 1089 new warnings.  Running this grep pipe on the output file:
>
>        grep 'request for implicit conversion' output|sed 
> 's%[^/]*\.[chl]:.*%%'|sort |uniq -c
>
> yields:
>
>      6
>    754 ../../egcc-SVN20080619/gcc/
>    231 ../../egcc-SVN20080619/gcc/fortran/
>     72 ../../egcc-SVN20080619/gcc/java/
>     26 ../../egcc-SVN20080619/gcc/objc/
>
> The blank 6 are from insn-automata.c, which has no path prefix and gets
> nulled out by my shellism.  There are no warnings from the C++ dir because
> someone already cleaned it up and added -Wc++-compat, likewise for
> libiberty.  (Who did that, Gaby?)

Yes, I already did the work for cp/.
I also got help from a GCC contributor (whose name I temporariy
forgot) and Thomas
on some C files.

Main offenders (last time I checked) seem be to
  (1) middle end and back end files who play `enum inheritance' tricks.
  (2) use of C++ keywords as variable names.
  (3) implicit conversion from void* to T* -- but we should have ver
few of those
      now, because I did eliminate those I was aware of
  (4) minor: some differences in `const' semantics.

-Wc++-compat needs to be augmented to check for C++ keywords
(a deficiency in current implementation).

I'm `on the road' and my laptop is a `windows only' box.

>
> These are mechanical and can be fixed with simple casts.  Again, IMHO
> these non-controversial patches should go straight into mainline.
> Once done we can -Werror this warning and avoid regressions.

Strongly agree.  Would you mind submitting the patch for activation of
-Wc++-compat?

There was also a suggestion to specificy a version for C++.  I believe
C++98 should
be enough for our purposes -- GCC-3.4.x should be good enough.

-- Gaby

Reply via email to