Skip to main content

Writing Bug Free C Code

https://www.duckware.com/bugfreec/index.html


Writing Bug-Free C Code
A Programming Style That Automatically Detects Bugs in C Code
by Jerry Jongerius / January 1995


Note to this online book: On April 29, 2002, I reacquired the publishing
rights to my book (from Prentice Hall), and have decided to publish it
online, where it is now freely available for anyone to read (and print -
provided that the printed copy is only for your personal use). I have
personally moved on to the Java programming language, and now to HTML5.
This book is showing its age, but for anyone who still programs in C,
the techniques described in this book -- especially the class
methodology in Chapter 4 -- are still a 'little gem' worth knowing
about. Enjoy! jerryj@duckware.com

0. Preface
1. Understand Why Bugs Exist
2. Know Your Environment
3. Rock-Solid Base
4. The Class Methodology
5. A New Heap Manager
6. Designing Modules
7. General Tips
8. Style Guide
9. Conclusion
A. Appendix: Code Listings
References
C Programming with:

Class Methodology §4
Data hiding §4.2
Runtime type checking §4.4
Compile time type checking §4.3
Fault tolerant asserts §3.3
Fault tolerant functions §4.6
Compile-time asserts §2.1.4
Symbolic heap walking §5.2.9
Heap leak detection §5.5


Book C Source Code (9k): source.zip (for DOS, Windows, UNIX, etc)

Sections of this book that talk about Microsoft or Windows are
generally marked with the 'Windows' graphic. You can safely skip those
sections of this book if you want to.

Copyright © 1993-1995, 2002-2015 Jerry Jongerius, jerryj@duckware.com
This book was previously published by Person Education, Inc.,
formerly known as Prentice Hall. ISBN: 0-13-183898-9
Check Amazon for used paperback availability

Comments

Popular posts from this blog

Logic Analyzer with STM32 Boards

https://sysprogs.com/w/how-we-turned-8-popular-stm32-boards-into-powerful-logic-analyzers/ How We Turned 8 Popular STM32 Boards into Powerful Logic Analyzers March 23, 2017 Ivan Shcherbakov The idea of making a “soft logic analyzer” that will run on top of popular prototyping boards has been crossing my mind since we first got acquainted with the STM32 Discovery and Nucleo boards. The STM32 GPIO is blazingly fast and the built-in DMA controller looks powerful enough to handle high bandwidths. So having that in mind, we spent several months perfecting both software and firmware side and here is what we got in the end. Capturing the signals The main challenge when using a microcontroller like STM32 as a core of a logic analyzer is dealing with sampling irregularities. Unlike FPGA-based analyzers, the microcontroller has to share the same resources to load instructions from memory, read/write th...

Why Those Who Overcame Poverty Have Less Sympathy for the Poor

https://www.psychologytoday.com/us/blog/psychology-money-and-happiness/202207/why-those-who-overcame-poverty-have-less-sympathy-the/amp The surprising science behind our attitudes toward those in poverty. Posted July 19, 2022 Reviewed by Ekua Hagan Key points People often use shortcuts, such as vivid stories of someone they personally know, to decide how to judge others living in scarcity. One study found that those who "became rich" had less sympathy for those currently experiencing poverty than those who were "born rich." Steve Jobs is an example of a wealthy public figure who came from humble beginnings and was notoriously un-philanthropic. We all love an inspiring success story where the protagonist overcomes adversity, defeats any and all obstacles that stand in the...