home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / next / programm / 5956 < prev    next >
Encoding:
Text File  |  1992-09-03  |  2.1 KB  |  73 lines

  1. Newsgroups: comp.sys.next.programmer
  2. Path: sparky!uunet!haven.umd.edu!darwin.sura.net!uvaarpa!murdoch!cds001!quarrie
  3. From: quarrie@cds001.cebaf.gov (David Quarrie)
  4. Subject: has anyone tried the -traditional switch under NeXTSTEP 3.0 ?
  5. Message-ID: <1992Sep3.133809.8477@murdoch.acc.Virginia.EDU>
  6. Sender: usenet@murdoch.acc.Virginia.EDU
  7. Reply-To: quarrie@cds001.cebaf.gov (David Quarrie)
  8. Organization: CEBAF (Continuous Electron Beam Accelerator Facility)
  9. Date: Thu, 3 Sep 1992 13:38:09 GMT
  10. Lines: 61
  11.  
  12. --
  13.  
  14. Has anyone tried using the -traditional switch to the Ccompiler under NS 3.0?
  15.  
  16. I have the following little test program:
  17.  
  18.     david> cat problem.c
  19.  
  20.     #define CALL(a,b,c) ((a=b),c)
  21.     #define CALL_R CALL
  22.     void problem (bc)
  23.     int *bc;
  24.     {
  25.                int *t1, *t2;
  26.             CALL_R(t1, (int *)(CALL_R(t2, bc, t2)), t1);
  27.     }
  28.  
  29.     david> cc problem.c             
  30.     /bin/ld: Undefined symbols:
  31.     _main
  32.     _CALL
  33.  
  34. The program doesn't make any sense, it is a heavily abstracted snippet of code
  35. generated automatically by a language compiler. However, I used it to
  36. illustrate
  37. a problem under NS3 PR 2 that cpp didn't fully resolve the macros (which
  38. it used
  39. to do under NS 2.1).
  40.  
  41. I've since heard that the solution is to use the -traditional switch to the
  42. compiler:
  43.  
  44.     david> cc -traditional problem.c
  45.     /bin/ld: Undefined symbols:
  46.     _main
  47.  
  48. All well and good, until I add an #include statement:
  49.  
  50.     #include <stdio.h>
  51.     #define CALL(a,b,c) ((a=b),c)
  52.     [...]
  53.  
  54.     david> cc -traditional problem.c
  55.     /NextDeveloper/Headers/ansi/machine/stddef.h:11: #include expects
  56. "fname" or <fname>
  57.     /NextDeveloper/Headers/ansi/machine/stdarg.h:11: #include expects
  58. "fname" or <fname>
  59.  
  60. I've tried this in combination with other switches (e.g. -gnu-cpp) to no avail.
  61.  
  62. Other relevant information is that I still have NS3 PR2 but I've heard that
  63. the problem persists under NS3.0. 
  64.  
  65. Aynone have any suggestions? (or even better, a solution!).
  66.  
  67. -------------------------------------------------------------------------------
  68.     David Quarrie                    CEBAF MS 12H
  69.                             12000 Jefferson Ave
  70. Internet: quarrie@cebaf.gov                Newport News VA 23606
  71. DECnet  : cebaf::quarrie                Tel: (804) 249-7562
  72. BITNET  : quarrie@cebaf                    Fax: (804) 249-7363
  73.