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 Wednesday, August 7, 2002, at 05:36  PM, Zack Weinberg wrote:

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.
OK, OK. Personally, I have no opinion.
Once I said "Do not use #import, it is deprecated by GCC" in darwin land
and it spawned into huge thread. I do want to start it again here :-)

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.
It looks different than what I want.

[dpatel: gcc]$ cat foo.c

#warning Do not use this API after 4/1/2003
[dpatel: gcc]$ cc -c foo.c
foo.c:2:2: warning: #warning Do not use this API after 4/1/2003
[dpatel: gcc]$ cc -c foo.c -Wno-#warnings
[dpatel: gcc]$

This is useful in same way as -Wno-system-headers
Is it still a good idea?

Thank you,
-Devang


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