This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: cpplib: Start moving switch handling to front ends


On Wed, Aug 07, 2002 at 04:58:11PM -0700, Devang Patel wrote:
> 
> On Wednesday, August 7, 2002, at 02:14  PM, Neil Booth wrote:
> 
> >
> >+    case OPT_Wimport:
> >+      cpp_opts->warn_import = on;
> >+      break;
> 
> I was thinking about proposing a trivial patch to disable this
> warning by default. Because #import is not deprecated and
> widely used in darwin land. What is your opinion about this?

"Darwin land" needs to stop using #import.

No, really.  The semantics of #import (and #pragma once) require that
the compiler be able to determine whether two include requests refer
to the same file, with 100% accuracy, for _correctness_.  This is
impossible without making unportable assumptions about file system
semantics, which cpplib does not do.

With #ifndef wrappers, the compiler can assume that two headers are
distinct if it can't prove that they are identical; if it is wrong, no
harm is done, because the #ifndef will prevent the code from being
re-processed anyway.

> I am also preparing a patch to introduce one new warning flag,
> -Wno-#warnings, to disable #warning messages. Is it a good idea?

I would prefer that effort go into a proper scheme to allow control
over _all_ warnings individually.  See, e.g.
http://gcc.gnu.org/ml/gcc/2000-06/msg00639.html for a possible
implementation.

zw


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