home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / sun / misc / 5984 < prev    next >
Encoding:
Text File  |  1992-12-23  |  2.7 KB  |  73 lines

  1. Newsgroups: comp.sys.sun.misc
  2. Path: sparky!uunet!convex!darwin.sura.net!uvaarpa!cv3.cv.nrao.edu!cv3.cv.nrao.edu!pmurphy
  3. From: pmurphy@nrao.edu (Pat Murphy)
  4. Subject: Weirdness with acc and stdio.h
  5. Message-ID: <PMURPHY.92Dec23110321@orangutan.cv.nrao.edu>
  6. Sender: news@nrao.edu
  7. Organization: National Radio Astronomy Observatory
  8. Distribution: comp
  9. Date: Wed, 23 Dec 1992 16:03:21 GMT
  10. Lines: 61
  11.  
  12. We are attempting to convert from SunOS 4.1.2 to Solaris 2.x via the
  13. migration kit.  In doing this, a bizarre aspect of using the "acc"
  14. "value-added" C compiler has manifested itself.  Here is the test
  15. program: 
  16.  
  17.     #include <stdio.h>
  18.     main()
  19.     {
  20.         printf ("hello, world\n");
  21.     }   
  22.  
  23. Then when the command:
  24.  
  25.     acc -c -I/usr/5include/ foo.c
  26.  
  27. is given, the result is:
  28.  
  29.     "/usr/5include//stdio.h", line 12: warning: tokens ignored at end
  30.                                                 of directive line 
  31.  
  32. Furthermore, if the -Xc option is added for strict ANSI compliance,
  33. one also gets:
  34.  
  35.      "/usr/5include//stdio.h", line 12: warning: tokens ignored at end
  36.                          of directive line 
  37.      "/usr/5include//stdio.h", line 33: warning: tokens ignored at end
  38.                          of directive line 
  39.  
  40. Line 12 of the stdio.h file has no tokens at the end of the directive
  41. (33 does, it's an #endif and that is an ANSI violation).  Before
  42. someone goes off the deep end saying I shouldn't be including this
  43. file and should be looking at /usr/lang/SC1.0/ansi_include instead,
  44. note the following comment at the beginning of the
  45. /usr/5include/stdio.h: 
  46.  
  47.    #ifdef    comment    /* ======================================================= */
  48.    
  49.    "Standard" header file definition.  See the C style paper for
  50.    full explanations.  Note that this reorganization has been
  51.    forced upon us by ANSI C; please abide by it.  This file, aside
  52.    from this comment, is supposed to be a good example.
  53.  
  54. But line 33 which closes another #ifdef says:
  55.  
  56.     #endif    __[dir_]_filename_h
  57.  
  58. which is NOT a good example.  
  59.  
  60. We are thoroughly confused.  Should we NOT be specifying the
  61. /usr/5include area at all?  This is on SunOS 4.1.2, acc version SC1.0
  62. (1Mar1991).  Any (constructive) advice/comments welcomed.
  63.  
  64.                 - Pat Murphy and Eric Greisen
  65. --
  66. ==========================================================================
  67. | Patrick P. Murphy, Ph.D.                Scientific Programming Analyst |
  68. | National Radio Astronomy Observatory    Net:       pmurphy@nrao.edu    |
  69. | 520 Edgemont Road                       Phone:     (804) 296-0372      |
  70. | Charlottesville, VA 22903-2475          VoiceMail: (804) 980-5889      |
  71. |      "I don't believe in the no-win scenario"  --- James T. Kirk       |
  72. ==========================================================================
  73.