comment style

Joe Huffman joe at proto.COM
Sun Jan 6 10:29:50 AEST 1991


In article <1991Jan04.164355.15674 at sco.COM>, ron at scocan.sco.COM (Ron Irvine) writes:
> A need for // (real) comments:
> 
> 
> #include <stdio.h>
> void main() {
> 	int *p;
> 	int a;
> 	int f = 10;
> 	int n = 5;
> 
> 	p = &f;
> 
> 	a = 100/*p	/* calculate first factor */
> 	    + 25/n;	/* and second factor */
> 
> 	printf("The answer is %d, %s\n", a, (a==15)?"OK":"BAD");
> }
> 
> I have run this program on 4 different C compilers and none of them
> even warned of a potential problem (nested comments).

This is the response the Zortech compiler for SCO UNIX gave for the sample 
code:

ztc1 -DM_UNIX -DM_XOUT -f -3 -o/tmp/ztc_3HL.tmp ron
	a = 100/*p	/* calculate first factor */
	          	^
ron.c(27) : Warning: can't nest comments

Time to switch compilers?

:-)

---
Zortech mailing list: send email to 'ztc-list-request at uunet.uu.net' with:
Add: your-user-name at your-machine-name
In the body of the message.
---
Send Zortech bug reports to 'zortech-bugs at proto.com'
Send requests for educational discounts to 'zortech-ed at proto.com'
---
Zortech is my major source of income.  Statements about them or their 
competitors cannot be totally without bias.  
-- 
joe at proto.com



More information about the Comp.std.c mailing list