home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / os / vms / 22085 < prev    next >
Encoding:
Internet Message Format  |  1993-01-28  |  2.3 KB

  1. Path: sparky!uunet!ogicse!news.u.washington.edu!news.uoregon.edu!cs.uoregon.edu!sgiblab!troi!steve
  2. From: steve@dbaccess.com (Steve Suttles)
  3. Newsgroups: comp.os.vms
  4. Subject: Re: VAXC problems (V3.2)
  5. Message-ID: <156@mccoy.dbaccess.com>
  6. Date: 26 Jan 93 20:29:07 GMT
  7. Article-I.D.: mccoy.156
  8. References: <1993Jan20.021126.8583@cs.rit.edu>
  9. Organization: Cross Access Corp., Santa Clara, CA
  10. Lines: 42
  11. X-Newsreader: Tin 1.1 PL4
  12.  
  13. whd0675@cs.rit.edu (Walter H Dick) writes:
  14. : I have noticed that there are some differences between ANSI 'c' and VAXC.
  15. : I would like to know if these are known differences...  The following types
  16. : of syntax do not work:
  17. : #define paste(front, back) front ## back
  18. : #define dprint(expr) printf(#expr " = %g\n", expr)
  19. : printf("Hello, " "World\n");
  20. : void f()
  21. : {
  22. :    int i[5] = {1, 2};
  23. :    int n;
  24. :    for (n = 0; n < 5; printf("%d\n", i[n]), n++);
  25. :    /* the last 3 values should be set to zero regardless of the fact that
  26. :       the array is automatic */
  27. : }
  28. : Walter H. Dick, III
  29. : whd0675@cs.rit.edu
  30.  
  31. Absolutely right.  VAX C is not ANSI C.  It says so in the documentation.
  32. There is no mention whatsoever of the '#' tokenizing operator, since it wasn't
  33. even an inspiration at the time VAX C was written.  String concatenation was a
  34. peculiar feature at that time, which has since gained in popularity.  The
  35. preceding solution was to end a line with a backslash and keep typing on the
  36. next line.  Also in the doc you will find that automatics must be fully fleshed
  37. out to be fully initialized.  The /standard=portable option will warn you about
  38. automatics and initialization, since at that time not everybody would let you
  39. initialize an automatic, array or otherwise.  There is also no lint.  There is
  40. no way to get complaints about functions without prototypes.  You can't
  41. suppress messages independently, like the automatic initializes.  And so on.
  42.  
  43. Actually, the compiler's pretty good; it's just not what you expected.  But
  44. wait til you try the runtime library...
  45.  
  46. sas
  47. -- 
  48. Steve Suttles                Internet:  steve@dbaccess.com      Dr. DCL is IN!
  49. CROSS ACCESS Corporation     UUCP: {uunet,sgiblab}!troi!steve  Yo speako TECO!
  50. 2900 Gordon Ave, Suite 100   fax: (408) 735-0328              Talk data to me!
  51. Santa Clara, CA 95051-0718   vox: (408) 735-7545   HA! It's under 4 lines NOW!
  52.