Navigation
Learn About
Developing With
Ingres Talk
Information
Toolbox
Views
Ingres C Coding Standard
From Ingres Community Wiki
Contents |
The C Coding Standard for Ingres
We welcome your contributions to the Ingres Open Source Project!
Like you, we want your contributions to be accepted into the Ingres code as rapidly as possible. To help the process along we have published the Ingres C Coding Standard. This Standard is designed to help make the code safe, portable, easy to read and understand.
We are very interested in feedback on the accuracy and clarity of the contents of the Ingres Coding Standard document. Important sections, some of which have been identified and intentionally left blank, are missing. We encourage the motivated in the Ingres Community to submit proposals that address these issues.
Submissions, corrections, requests for clarification, etc. should be sent to emma@ingres.com
Chapter 1 - Welcome
Welcome to the Ingres Project! We are passionate about the Ingres technology and are very excited to be sharing the source with a larger community.
We welcome your contributions to the Ingres Open Source Project! Like you, we want your contributions to be accepted into the Ingres code as rapidly as possible. To help the process along we have published the Ingres Coding Standard. This Standard is designed to help make the code safe, portable, easy to read and understand.
Abstract
This document describes the C Coding Standard for Ingres. All C source code written for the Ingres Open Source Project must comply with this Standard.
We are most interested in feedback on the accuracy and clarity of the contents of this document. Important sections, some of which have been identified and intentionally left blank, are missing. We encourage the motivated in the Ingres Community to submit proposals that address these issues.
Submissions, corrections, requests for clarification, etc. should be sent to emma@ingres.com
Overview
This document outlines the C Coding Standard, “The Standard” to which all C source code written for the Ingres Project must comply.
Rationale
The Standard is designed to provide these software engineering benefits:
Correctness The Standard strictly enforces the C typing rules where some compilers may not.
Reliability The Standard promotes the construction of reliable software by describing techniques for modular program construction, information hiding, and safe data structure access.
Portability The Standard prescribes coding practices required for the proper operation of products across all operating environments including a wide array of operating systems and supported language versions. The Standard considers restrictions imposed by the machine architecture and the software tools available (compiler, linker, editor) in each environment and allows only those coding practices that are portable.
Readability The Standard describes the use of C language constructs, spacing, indentation, and delimiters to provide a uniform appearance for all source code produced for the Ingres Project. Obscure or “tricky” constructs are discouraged. The use of program commentary is explained.
Maintainability The Standard describes coding practices to make the detection and diagnosis of errors and bugs easier. Methods for embedding debugging support are given.
Performance The Standard recommends methods to maximize efficiency on the widest possible class of machines. Specialized constructs designed to take advantage of optimizations in a particular architecture or compiler may have exactly the opposite effect on other machines, so should be used with care.
How to use this document
This document is organized into three chapters.
- Chapter 1 contains a rationale and explains the usage of the document.
- Chapter 2 is the C Coding Standard; it describes the correct use of the C programming
language in the Ingres Open Source Project.
- Chapter 3 contains Standards on style, program design and construction, correctness and
performance.
Chapter 2 is a reference; use it whenever you have a question about the usage of a particular datatype, construct, or coding practice.
How to submit changes or updates to this document
Changes to the Standard may be proposed by sending an email to emma@ingres.com
Compliance with the Standard
General
All software developed in C for the Ingres Project must comply with this Standard, subject to the conditions outlined in the following sections. It is the responsibility of each contributor to adhere to this Standard.
Prospective
All new software developed in C must comply with all sections of the Standard.
Existing Code
All changes made to existing code must comply with these standards.
Chapter 2 - C Coding Standards
Chapter 3 - Software Engineering Standards

