Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!rice!uw-beaver!Teknowledge.COM!unix!hplabs!hp-pcd!hp-sdd!ncr-sd!sagpd1!jharkins From: jharkins@sagpd1.UUCP (Jim Harkins) Newsgroups: comp.lang.c Subject: Re: Nested Comments in C -- A recent experience Message-ID: <662@sagpd1.UUCP> Date: 12 Mar 90 21:09:32 GMT References: <236100027@prism> <1414@amethyst.math.arizona.edu> <1523@wacsvax.OZ> <4320@daffy.cs.wisc.edu> <1990Mar11.065712.9798@usenet.ins.cwru.edu> Reply-To: jharkins@sagpd1.UUCP (Jim Harkins) Organization: Scientific Atlanta, Government Products Div, San Diego, CA Lines: 28 In article <1990Mar11.065712.9798@usenet.ins.cwru.edu> crds@pyrite.som.cwru.edu (Glenn A. Emelko) writes: #Well, for once in a long while I've got a few cents to throw in. Just got done #spending 3 hours looking for a "bug" which turned out not to be a "bug" at all; #rather it went undetected as a programming error BECAUSE our C compiler doesn't #handle nested comments (like most C compilers don't). The code looked like the #example below (not the actual code, but similar): # # function(arg1,arg2) { # int a,b,c; # a=arg1*arg2+3; /* Oops, we're going to forget to close this comment # b=arg1+2*arg2; /* Guess what, this line never gets executed */ # c=a+b; # return(c); /* Here's the bogus results, Mr. caller */ # } # #Unfortunately, we spent very little time suspecting that "function" didn't work #properly, because it was so simple! Sorry Charlie, but if part of your testing doesn't involve testing each low- level function individually, especially the "simple" ones, you have much more serious problems to worry about than nested comments. -- jim jharkins@sagpd1 "My hope is that we can use tariffs to force Japan to open their markets to imported goods. My fear is I'll be forced to buy lousy American made stuff."