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