[PRL] safe c project for beginners?

Joe Marshall jmarshall at alum.mit.edu
Fri Nov 19 14:47:56 EST 2010


I had to laugh when I saw `C' juxtaposed with the word `safe'
in the subject line.

I don't know of any hand-holding C compilers, but I have *some* suggestions.

First, always turn on every single compiler warning you possibly can.  (BUT
don't turn on warnings that trigger on the standard include files.)  Then always
make sure that your code compiles with *exactly* zero warnings.  This will
save you a whole bunch of grief. (And annoy you to no end.  But I guarantee
the number of mysterious crashes will decrease dramatically.)

Use a debugging harness like valgrind or Purify.

You might want to look at `clang'.

On Fri, Nov 19, 2010 at 10:37 AM, John Clements
<clements at brinckerhoff.org> wrote:
> I'm teaching first-quarter students in Racket, and they're about to plunge off a cliff and start writing code in C (with a variety of different instructors) in their second quarter.  Can anyone recommend either a static checker or an honest-to-goodness language subset (with compiler) that I could use to make their lives simpler?
>
> Sorry for the semi-OT post; thanks in advance for any suggestions.
>
> John Clements
>
>
> _______________________________________________
> PRL mailing list
> PRL at lists.ccs.neu.edu
> https://lists.ccs.neu.edu/bin/listinfo/prl
>
>



-- 
~jrm



More information about the PRL mailing list