Barr Group TwitterBarr Group Vimeo

Rules:

1.1.a. All programs shall be written to comply with the C99 version of the ISO C Programming Language Standard.3

1.1.b. Whenever a C++ compiler is used, appropriate compiler options shall be set to restrict the language to the selected version of ISO C.

1.1.c. The use of proprietary compiler language keyword extensions, #pragma, and inline assembly shall be kept to the minimum necessary to get the job done and be localized to a small number of device driver modules that interface directly to hardware.

1.1.d. Preprocessor directive #define shall not be used to alter or rename any keyword or other aspect of the programming language.

Example:

#define begin	{	// Don’t do something like this...
#define end	}	// ... nor this.
...
    for (int row = 0; row < MAX_ROWS; row++) 
    begin
        ...
    end	                // Let C be C, not some language you once loved.

Reasoning: To clearly define the rules in the rest of this standard, it is important that we first agree on the baseline programming language specification.

Enforcement: These rules shall be enforced via compiler setup and code reviews.


Footnotes

[3] C99-compatible compilers offer many valuable improvements over older compilers, such as C++-style comments, Boolean and fixed-width integer types, inline functions, and local variable declarations anywhere within a function body.

What’s happening and how it’s done. Get in the know.

Sign Up for Our Newsletter

Receive free how-to articles, industry news, and the latest info on Barr Group webinars and training courses via email. 

To prevent automated spam submissions leave this field empty.