home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / std / c / 2382 < prev    next >
Encoding:
Text File  |  1992-07-29  |  743 b   |  33 lines

  1. Path: sparky!uunet!dtix!darwin.sura.net!mips!odin!fido!shankar
  2. From: shankar@sgi.com (Shankar Unni)
  3. Newsgroups: comp.std.c
  4. Subject: #if and #endif in different files: legal?
  5. Keywords: preprocessing
  6. Message-ID: <ntvfii4@fido.asd.sgi.com>
  7. Date: 30 Jul 92 00:18:45 GMT
  8. Sender: news@fido.asd.sgi.com (Usenet News Admin)
  9. Organization: Silicon Graphics, Inc.
  10. Lines: 21
  11.  
  12.  
  13. What is the accepted opinion as to the legality of a "#if" and a
  14. "#else" or "#endif" being in different files, as in:
  15.  
  16.  a.c:
  17.  
  18.     #ifdef __STDC__
  19.     #include "a.h"
  20.  
  21.  a.h:
  22.  
  23.     main() { }
  24.     #endif /* __STDC__ */
  25.  
  26.  
  27. Should the above compile? Not compile? Implementation-defined?
  28.  
  29. Thanks,
  30. --
  31. Shankar Unni                E-Mail:    shankar@sgi.com
  32. Silicon Graphics Inc.            Phone:    +1-415-390-2072
  33.