This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: cpplib: Start moving switch handling to front ends
- From: Stan Shebs <shebs at apple dot com>
- To: Zack Weinberg <zack at codesourcery dot com>
- Cc: Devang Patel <dpatel at apple dot com>, Neil Booth <neil at daikokuya dot co dot uk>, gcc-patches at gcc dot gnu dot org
- Date: Thu, 08 Aug 2002 10:34:11 -0700
- Subject: Re: cpplib: Start moving switch handling to front ends
- References: <20020807211416.GA27032@daikokuya.co.uk> <20020808003634.GM26853@codesourcery.com>
Zack Weinberg wrote:
"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.
Heh, we tried that argument with our users, but with literally thousands
of headers assuming #import or #pragma once, both internal and external
to Apple, plus an Objective-C book or two recommending the practice,
the response was, shall we say, "negative". It was pretty clear they
were going to keep firing compiler folks until they found one who was
willing to un-deprecate #import. 1/2 :-)
In the users' defense, it must be said that #import has been working
well on a huge amount of code - in the 2 1/2 years that I've been at
Apple, we've seen dozens of ICEs for instance, but no failures of
#import to find the right file. So it's not surprising that users
wonder why we're trying to fix something that doesn't seem broken.
Stan