This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: Wno-warning-directives [WasRe: cpplib: Start moving ...]
- From: Devang Patel <dpatel at apple dot com>
- To: "Mark D. Baushke" <mdb at gnu dot org>
- Cc: Geoff Keating <geoffk at geoffk dot org>, gcc-patches at gcc dot gnu dot org
- Date: Tue, 13 Aug 2002 10:45:33 -0700
- Subject: Re: PATCH: Wno-warning-directives [WasRe: cpplib: Start moving ...]
On Tuesday, August 13, 2002, at 10:09 AM, Mark D. Baushke wrote:
Geoff Keating <geoffk@geoffk.org> writes:
Typically a #warning from a system header does indicate an error in
the use of that header.
No, a #warning from a system header indicates a warning. A #error
indicates an error.
On my FreeBSD desktop system at work I see warnings like this:
#warning "this file includes <malloc.h> which is deprecated, use
<stdlib.h> instead"
#warning "this file includes <struct.h> which is deprecated, use
<stddef.h> instead"
#warning "this file includes <values.h> which is obsoleted, use
<limits.h> or <float.h> instead"
#warning "The information in this file should be obtained from
<dirent.h>"
#warning "and is provided solely (and temporarily) for backward
compatibility."
Just because the application writer wants to find stop 'real' warnings
specificied on the command line via -W<flagname> switches as errors,
does NOT mean that the #warning provided in a system header file should
be treated as an error without some way to turn it off.
I agree.
I proposed more general solution to this sort of problem in
<http://gcc.gnu.org/ml/gcc/2000-06/msg00639.html>. An extension to
this would allow the user to say "if any warning comes from this file,
it's an error", something like
Hmmm... I have not been overly fond of #pragma directives in the past,
but I would like to see some way to modify how the warnings being
treated as errors mapping is being made. I do not know if this proposal
is the most general as it does require modifying sources which is not
always possible in some environments.
I agree on this one also.
-Devang