This one bit me today

Scott Amspoker scott at bbxsda.UUCP
Fri Oct 13 00:56:17 AEST 1989


In article <267 at wsl.UUCP> john at wsl.UUCP (John Allen on wsl) writes:
>We all know 'C' is not perfect, what language is, and if there is a perfect
>language then use it and stop complaining about thing in the 'C' language
>that a little bit of white space gets rid off.

Another easy pitfall in C is forgetting to close a comment.  On compilers
that don't nest comments this will cause some code to be swallowed up
until the next comment.  You can stare at it for the longest time and
not see the problem.  I wrote a quick and dirty program one day to
scan C programs looking for "nested" comments and reporting on them.
It take but a few seconds to scan a whole directory of C source files.
I highly recommend keeping such a program handy.

-- 
Scott Amspoker
Basis International, Albuquerque, NM
(505) 345-5232
unmvax.cs.unm.edu!bbx!bbxsda!scott



More information about the Comp.lang.c mailing list