This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: -Wold-style-cast
- From: kaih at khms dot westfalen dot de (Kai Henningsen)
- To: stl at caltech dot edu
- Cc: gcc at gcc dot gnu dot org
- Date: 07 Sep 2003 11:02:00 +0200
- Subject: Re: -Wold-style-cast
- Comment: Unsolicited commercial mail will incur an US$100 handling fee per received mail.
- Organization: Organisation? Me?! Are you kidding?
- References: <87smnco4jl.fsf@egil.codesourcery.com>
zack@codesourcery.com (Zack Weinberg) wrote on 04.09.03 in <87smnco4jl.fsf@egil.codesourcery.com>:
> "Stephan T. Lavavej" <stl@caltech.edu> writes:
>
> ...
> > I don't know if gcc can be made to not warn about C casts in macros which
> > are defined in a gcc system header, but it sure would be nice. Of course,
> > C casts which don't appear in a macro but do appear at the point of use
> > should probably be warned about. For example:
>
> The only reason this hasn't been done is, no one has had the time to
> do it yet. If you'd like to send in a patch, we will probably use it.
In the meantime, a not quite so fragile semi-solution would be to have
something like
const SOCKET MEOW_INVALID_SOCKET = INVALID_SOCKET;
- at least that cuts it down to a single warning. Furthermore, you could
put that in a header file specifically for such stuff so you'd easily
recognize which warnings to ignore.
MfG Kai