home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / gnu / misc / discuss / 4080 < prev    next >
Encoding:
Text File  |  1992-12-22  |  1.5 KB  |  43 lines

  1. Newsgroups: gnu.misc.discuss
  2. Path: sparky!uunet!think.com!ames!agate!spool.mu.edu!umn.edu!news
  3. From: lupson@geom.umn.edu (Linus Upson)
  4. Subject: #import
  5. Message-ID: <1992Dec21.211226.24498@news2.cis.umn.edu>
  6. Sender: news@news2.cis.umn.edu (Usenet News Administration)
  7. Nntp-Posting-Host: descartes.geom.umn.edu
  8. Organization: University of Minnesota
  9. Date: Mon, 21 Dec 1992 21:12:26 GMT
  10. Lines: 31
  11.  
  12. I just finished installing gcc 2.3.2 on the Irises here (Objective-C  
  13. works!), and on my first compile was greeted with the following message:
  14.  
  15. % gcc ttt.m -lobjc
  16. ttt.m:1: warning: using `#import' is not recommended
  17. The fact that a certain header file need not be processed more than once
  18. should be indicated in the header file, not where it is used.
  19. The best way to do this is with a conditional of this form:
  20.  
  21.   #ifndef _FOO_H_INCLUDED
  22.   #define _FOO_H_INCLUDED
  23.   ... <real contents of file> ...
  24.   #endif /* Not _FOO_H_INCLUDED */
  25.  
  26. Then users can use `#include' any number of times.
  27. GNU C automatically avoids processing the file more than once
  28. when it is equipped with such a conditional.
  29.  
  30. A person here pointed me to -Wno-import, but I was wondering if someone  
  31. could answer a couple of questions for me:
  32. 1. Why is this warning on by default?  It seems that import allows greater  
  33. flexibility on the part of the programmer using the header.
  34. 2. How can I turn it off permanently?  The only way I came up with was to  
  35. modify the source.
  36.  
  37. I realize that this topic is probably extremely flammable, so please reply  
  38. to me via email.
  39.  
  40. Linus Upson
  41. The Geometry Center
  42. lupson@geom.umn.edu
  43.