[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: #import is obsolete

From: Richard Frith-Macdonald
Subject: Re: #import is obsolete
Date: Sat, 5 Jul 2003 07:35:37 +0100

On Friday, July 4, 2003, at 08:25 PM, Andreas Hoeschler wrote:


while building my MacOSX code on GNUstep (latest release) I get stuff like

Controller.m:2:2: warning: #import is obsolete, use an #ifndef wrapper in the header file

What is this about? Why is usage of #import discouraged?

The gist of the argument seems to be that it doesn't work reliably and can't be made to
work reliably (I don't know the technicalities).
In practice, the last I heard was that the maintainers of gcc intend to remove it, from
the compiler, and that various people at apple agreed with them.

I would like to use the same source tree for MacOSX and GNUstep. Is this a critical message or can it savely be ignored?

I don't think it's immediately critical (and as long as all your source resides on the same filesystem I don't think import will actually go wrong), but it seems likely to be critical in the long term ... the warning is intended to start you converting your code now rather than having it all break in a year or so, so you have to convert it all at once.

What you need to do is put code like this in all you headers ...

// rest of header content

reply via email to

[Prev in Thread] Current Thread [Next in Thread]