By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,227 Members | 1,373 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,227 IT Pros & Developers. It's quick & easy.

Writing safer C programs

P: n/a
Can some one please point me to a comprehensive resource for writing C
programs?I checked out Steve Summit's FAQ.
Thanks,
Pradyot
Nov 13 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
On 3 Dec 2003 17:35:43 -0800, pr*******@yahoo.com (Pradyot Dhulipala)
wrote in comp.lang.c:
Can some one please point me to a comprehensive resource for writing C
programs?I checked out Steve Summit's FAQ.
Thanks,
Pradyot


Somehow the adjective "safer" did not make it from your subject line
into the body of the message. But assuming you still meant "safer":

Safer C: Developing Software for High-integrity and Safety-critical
Systems Engineering)
Les Hatton
Paperback 229 pages (1 December, 1994)
Publisher: McGraw-Hill Education - Europe; ISBN: 0077076400

C Traps and Pitfalls
Andrew Koenig
Paperback 160 pages (January 1989)
Publisher: Addison Wesley; ISBN: 0201179288

Expert C Programming: Deep C Secrets
Peter Van Der Linden
Paperback 350 pages (30 April, 1994)
Publisher: Prentice Hall; ISBN: 0131774298

Also:

Guidelines for the Use of the C Language in Vehicle Based Software
The Motor Industry Software Reliability Association (MISRA)
Available only directly from http://www.misra.co.uk.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++ ftp://snurse-l.org/pub/acllc-c++/faq
Nov 13 '05 #2

P: n/a
Pradyot Dhulipala <pr*******@yahoo.com> wrote:
Can some one please point me to a comprehensive resource for writing C
programs?I checked out Steve Summit's FAQ.
Thanks,
Pradyot


something else to try is linking a garbage collector into your program.
Do some googling, i'm not sure what it's called, but someone wrote a good
reliable, gc. that entirely eliminates core dumps caused by frees and also
eliminates some memory leaks.

--
Harrison Caudill | .^ www.hypersphere.org
Computer Science & Physics Double Major | | Me*Me=1
Georgia Institute of Technology | v' I'm just a normal guy
Nov 13 '05 #3

P: n/a
> Can some one please point me to a comprehensive resource for writing C
programs?I checked out Steve Summit's FAQ.


http://www.oreilly.com/catalog/secureprgckbk/index.html

http://secureprogramming.com/

WBR SK

Nov 13 '05 #4

P: n/a

"Jack Klein" <ja*******@spamcop.net> wrote in message
news:49********************************@4ax.com...
On 3 Dec 2003 17:35:43 -0800, pr*******@yahoo.com (Pradyot Dhulipala)
wrote in comp.lang.c:
Can some one please point me to a comprehensive resource for writing C
programs?I checked out Steve Summit's FAQ.
Thanks,
Pradyot


Somehow the adjective "safer" did not make it from your subject line
into the body of the message. But assuming you still meant "safer":

Safer C: Developing Software for High-integrity and Safety-critical
Systems Engineering)
Les Hatton
Paperback 229 pages (1 December, 1994)
Publisher: McGraw-Hill Education - Europe; ISBN: 0077076400

C Traps and Pitfalls
Andrew Koenig
Paperback 160 pages (January 1989)
Publisher: Addison Wesley; ISBN: 0201179288

Expert C Programming: Deep C Secrets
Peter Van Der Linden
Paperback 350 pages (30 April, 1994)
Publisher: Prentice Hall; ISBN: 0131774298

Also:

Guidelines for the Use of the C Language in Vehicle Based Software
The Motor Industry Software Reliability Association (MISRA)
Available only directly from http://www.misra.co.uk.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++ ftp://snurse-l.org/pub/acllc-c++/faq


I've seen Cyclone mentioned in various places. "Cyclone is a programming
language based on C that is *safe*...", says the website. Although it is
designed to be compatible with C, it isn't exactly the same. Might not be
totally relevant, but could otherwise be of some interest.

http://www.research.att.com/projects/cyclone/

Paul.
Nov 13 '05 #5

P: n/a
On Thu, 4 Dec 2003, Jack Klein wrote:
On 3 Dec 2003 17:35:43 -0800, pr*******@yahoo.com (Pradyot Dhulipala)
wrote in comp.lang.c:
Can some one please point me to a comprehensive resource for writing C
programs?I checked out Steve Summit's FAQ.
Thanks,
Pradyot
Somehow the adjective "safer" did not make it from your subject line
into the body of the message. But assuming you still meant "safer":

Safer C: Developing Software for High-integrity and Safety-critical
Systems Engineering)
Les Hatton
Paperback 229 pages (1 December, 1994)
Publisher: McGraw-Hill Education - Europe; ISBN: 0077076400

C Traps and Pitfalls
Andrew Koenig
Paperback 160 pages (January 1989)
Publisher: Addison Wesley; ISBN: 0201179288

Expert C Programming: Deep C Secrets
Peter Van Der Linden
Paperback 350 pages (30 April, 1994)
Publisher: Prentice Hall; ISBN: 0131774298

Also:

Guidelines for the Use of the C Language in Vehicle Based Software
The Motor Industry Software Reliability Association (MISRA)
Available only directly from http://www.misra.co.uk.


One small correction: http://www.misra.org.uk
--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++ ftp://snurse-l.org/pub/acllc-c++/faq


--
Send e-mail to: darrell at cs dot toronto dot edu
Don't send e-mail to vi************@whitehouse.gov
Nov 13 '05 #6

P: n/a
On 4 Dec 2003 16:38:07 GMT, da*****@NOMORESPAMcs.utoronto.ca.com
(Darrell Grainger) wrote in comp.lang.c:
On Thu, 4 Dec 2003, Jack Klein wrote:
On 3 Dec 2003 17:35:43 -0800, pr*******@yahoo.com (Pradyot Dhulipala)
wrote in comp.lang.c:
Can some one please point me to a comprehensive resource for writing C
programs?I checked out Steve Summit's FAQ.
Thanks,
Pradyot


Somehow the adjective "safer" did not make it from your subject line
into the body of the message. But assuming you still meant "safer":

Safer C: Developing Software for High-integrity and Safety-critical
Systems Engineering)
Les Hatton
Paperback 229 pages (1 December, 1994)
Publisher: McGraw-Hill Education - Europe; ISBN: 0077076400

C Traps and Pitfalls
Andrew Koenig
Paperback 160 pages (January 1989)
Publisher: Addison Wesley; ISBN: 0201179288

Expert C Programming: Deep C Secrets
Peter Van Der Linden
Paperback 350 pages (30 April, 1994)
Publisher: Prentice Hall; ISBN: 0131774298

Also:

Guidelines for the Use of the C Language in Vehicle Based Software
The Motor Industry Software Reliability Association (MISRA)
Available only directly from http://www.misra.co.uk.


One small correction: http://www.misra.org.uk


Thanks!

Nov 13 '05 #7

P: n/a
Thanks a lot.I was hoping for online resources.I am not able to get
the books by the time I need them.
Safer C programing tips along the lines of don't use gets, strcpy etc.

Thanks,
Pradyot
Jack Klein <ja*******@spamcimop.net> wrote in message news:<49********************************@4ax.com>. ..
On 3 Dec 2003 17:35:43 -0h800, pr*******@yahoo.com (Pradyot Dhulipala)
wrote in comp.lang.c:
Can some one please point me to a comprehensive resource for writing C
programs?I checked out Steve Summit's FAQ.
Thanks,
Pradyot


Somehow the adjective "safer" did not make it from your subject line
into the body of the message. But assuming you still meant "safer":

Safer C: Developing Software for High-integrity and Safety-critical
Systems Engineering)
Les Hatton
Paperback 229 pages (1 December, 1994)
Publisher: McGraw-Hill Education - Europe; ISBN: 0077076400

C Traps and Pitfalls
Andrew Koenig
Paperback 160 pages (January 1989)
Publisher: Addison Wesley; ISBN: 0201179288

Expert C Programming: Deep C Secrets
Peter Van Der Linden
Paperback 350 pages (30 April, 1994)
Publisher: Prentice Hall; ISBN: 0131774298

Also:

Guidelines for the Use of the C Language in Vehicle Based Software
The Motor Industry Software Reliability Association (MISRA)
Available only directly from http://www.misra.co.uk.

Nov 13 '05 #8

P: n/a
In <2d*************************@posting.google.com> pr*******@yahoo.com (Pradyot Dhulipala) writes:
Safer C programing tips along the lines of don't use gets, strcpy etc.


Whoever told you to avoid strcpy is a patent idiot. Unlike gets, it is
perfectly possible to use strcpy in a fully portable and safe manner.

If you don't know what you're doing, you can't use pointers, arrays,
signed arithmetic and floating point arithmetic. Try writing some
useful real world applications with what's left.

If you know what you're doing, you don't need any safer C programming
tips, so my advice is to simply learn C (up to the point where K&R2 and
its exercises have no more secrets for you).

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Nov 13 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.