home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!usc!sdd.hp.com!hplabs!ucbvax!anon.penet.FI!an6034
- From: an6034@anon.penet.FI
- Newsgroups: comp.os.vms
- Subject: C problem
- Message-ID: <9301201500.AA20662@anon.penet.fi>
- Date: 20 Jan 93 14:51:44 GMT
- Sender: usenet@ucbvax.BERKELEY.EDU
- Organization: Anonymous contact service
- Lines: 68
-
- X-Anon-To: INFO-VAX@SRI.COM
-
- Hi VAX/VMS experts.
-
- I have a very simple C question. I have a sample C program that compiles and
- runs fine in a Borland C++ environment.
-
- When I try to compile this program in a VAX/VMS (5.4-2) environment I get a
- warning message. I have looked up the error message but it doesn't mean a
- thing to me.
-
- Attached is the source and a sethost log of my compile.
-
- Please help a student with out a clue?
-
- ********************************************************************************
- cc example_1.c
- void main(void){ /* begin main */
- %CC-W-INVMAINRETVAL, Return value of main function is not an integer type.
- At line number 8 in $DISK:EXAMPLE_1.C;24.
-
- %CC-I-SUMMARY, Completed with 0 error(s), 1 warning(s), and
- 0 informational messages.
- At line number 29 in $DISK:EXAMPLE_1.C;24.
- ********************************************************************************
-
- /*
- Example from the first day of class. Will use for/next loop and
- while loop to illistait 'weak' data typing in 'C'.
- */
-
- #include <stdio.h>
-
- void main(void){ /* begin main */
-
- char k; /* character looping variable */
- int m; /* integer looping variable */
-
- puts("Characters have number codes - using Character Variable");
-
- for ( k=' '; k <= '~'; k++){ /* begin for loop */
- if ((k-' ')%12==0) putchar('\n'); /* line feed every 12th iteration */
- printf("%2c%4d",k,k); /* print the character variable */
- } /* end for loop */
- putchar('\n'); putchar('\n');
-
- puts("Characters have number codes - using Integer Variable");
-
- m=32; /* initial value for intege */
- while (m < 127) { /* begin while loop */
- if ((m-32)%12==0) putchar('\n'); /* line feed every 12th iteration */
- printf("%2c%4d",m,m); /* print the integer varaible */
- m++;
- } /* end while loop */
- } /* end main */
-
- ********************************************************************************
-
- So am I missing a compiler switch that will make it all ok??
-
- TIA
-
-
- -------------------------------------------------------------------------
- To find out more about the anon service, send mail to help@anon.penet.fi.
- Due to the double-blind system, any replies to this message will be anonymized,
- and an anonymous id will be allocated automatically. You have been warned.
-
-