[PATCH INSTALLED]: Fix -Wc++-compat warnings in toplevel [t-z]*.c files
Richard Guenther
richard.guenther@gmail.com
Sat Jun 21 23:10:00 GMT 2008
On Sat, Jun 21, 2008 at 11:11 PM, Ian Lance Taylor <iant@google.com> wrote:
> "Richard Guenther" <richard.guenther@gmail.com> writes:
>
>> On Fri, Jun 20, 2008 at 8:42 PM, Kaveh R. GHAZI <ghazi@caip.rutgers.edu> wrote:
>>> This patch fixes the -Wc++-compat warnings in the toplevel [t-z]*.c files.
>>> All obvious stuff, i.e. casts etc. We're down to about 520 warnings or
>>> 1/2 way through these. (Not including Ada or other targets yet.)
>>>
>>> Bootstrapped on x86_64-unknown-linux-gnu, no regressions.
>>
>> I don't like this sprinkling casts all over the place. Since we
>> didn't agree to that being the
>> right or wrong way to go I alos think these patches are not obvious.
>
> Most of them are casts away from void*. We did agree a while back
> that gcc would be coded in the C/C++ subset. That means that you
> can't assign from a void* pointer to a pointer of a different type
> without a cast. So either we add casts or we do something else. But
> what?
For allocators we have macros in libiberty. If we end up using C++ I guess
we can templatize our datastructures properly. But as it is not at all clear
we will be able to use C++ prematurely adding the casts on the trunk in
this "non-nice" way is ... not nice ;)
Anyway, I just wanted to raise this issue.
Richard.
More information about the Gcc-patches
mailing list