Article View: comp.std.c
Article #2235Re: comment style
From: Joe Huffman
Date: Sat, 05 Jan 1991 23:29
Date: Sat, 05 Jan 1991 23:29
46 lines
1688 bytes
1688 bytes
In article <1991Jan04.164355.15674@sco.COM>, ron@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@uunet.uu.net' with:
Add: your-user-name@your-machine-name
In the body of the message.
---
Send Zortech bug reports to 'zortech-bugs@proto.com'
Send requests for educational discounts to 'zortech-ed@proto.com'
---
Zortech is my major source of income. Statements about them or their
competitors cannot be totally without bias.
--
joe@proto.com
Technical Details
Message-ID:
<1492@proto.COM>Path:
arc1-ca.pugleaf.net!utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!clyde.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!apple!usc!wuarchive!uunet!proto!joeReferences:
<1991Jan04.164355.15674@sco.COM>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!clyde.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!apple!usc!wuarchive!uunet!proto!joe From: joe@proto.COM (Joe Huffman) Newsgroups: comp.std.c Subject: Re: comment style Summary: You are using the wrong compiler. :-) Message-ID: <1492@proto.COM> Date: 5 Jan 91 23:29:50 GMT References: <1991Jan04.164355.15674@sco.COM> Organization: Prototronics; Sandpoint, Idaho Lines: 46