This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: -Wold-style-cast and system headers


Marc Espie writes:

>   In message <19990706181151.A26225@quatramaran.ens.fr>you write:
>   > The other trouble is how to add such patterns to fixincludes ? 

Jeff Law replies:
> We will not add this stuff to fixincludes.

> fixincludes is meant to deal with bugs in the system header files that
> prevent gcc from properly compiling code.  fixincludes is not meant to 
> fix bugs which cause warnings.

It's appropriate to attempt to fix warnings that everyone will get
(warnings enabled by default) and possibly -Wall warnings.  But
I think it's too big a job to handle all of the additional, optional
warnings.  The risk of tampering with a system include file starts to
exceed the benefit.

> Fix your include files, that is my recommendation.

It does seem that, on the free systems, it would be best to get the
maintainers to fix the headers rather than to rely on fixincludes
to rewrite them.  Commercial vendors might not be responsive enough,
though.

In this case, however, maybe it's the concept of -Wold-style-casts that
isn't really quite what is desired.  The person specifying this flag
is most likely concerned with casts dealing with pointers and references,
and is unlikely to want warnings for casts of one non-pointer native
type to another that never lose information.





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]