🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.misc.discuss
Article #1295

#import

#1295
From: Linus Upson
Date: Mon, 21 Dec 1992 21:12
31 lines
1627 bytes
I just finished installing gcc 2.3.2 on the Irises here (Objective-C  
works!), and on my first compile was greeted with the following message:

% gcc ttt.m -lobjc
ttt.m:1: warning: using `#import' is not recommended
The fact that a certain header file need not be processed more than once
should be indicated in the header file, not where it is used.
The best way to do this is with a conditional of this form:

  #ifndef _FOO_H_INCLUDED
  #define _FOO_H_INCLUDED
  ... <real contents of file> ...
  #endif /* Not _FOO_H_INCLUDED */

Then users can use `#include' any number of times.
GNU C automatically avoids processing the file more than once
when it is equipped with such a conditional.

A person here pointed me to -Wno-import, but I was wondering if someone  
could answer a couple of questions for me:
1. Why is this warning on by default?  It seems that import allows greater  
flexibility on the part of the programmer using the header.
2. How can I turn it off permanently?  The only way I came up with was to  
modify the source.

I realize that this topic is probably extremely flammable, so please reply  
to me via email.

Linus Upson
The Geometry Center
lupson@geom.umn.edu
Technical Details
Message-ID: <1992Dec21.211226.24498@news2.cis.umn.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!think.com!ames!agate!spool.mu.edu!umn.edu!news

Show Full Headers
Complete Article Headers
Newsgroups: gnu.misc.discuss
Path: arc1-ca.pugleaf.net!sparky!uunet!think.com!ames!agate!spool.mu.edu!umn.edu!news
From: lupson@geom.umn.edu (Linus Upson)
Subject: #import
Message-ID: <1992Dec21.211226.24498@news2.cis.umn.edu>
Sender: news@news2.cis.umn.edu (Usenet News Administration)
Nntp-Posting-Host: descartes.geom.umn.edu
Organization: University of Minnesota
Date: Mon, 21 Dec 1992 21:12:26 GMT
Lines: 31