do your search here :) :-

Google
 

Thursday, January 24, 2008

Tools for mitigating issues with C

Tools have been created to help C programmers avoid some of the problems inherent in the language.
Automated source code checking and auditing are beneficial in any language, and for C many such tools exist, such as
Lint. A common practice is to use Lint to detect questionable code when a program is first written. Once a program passes Lint, it is then compiled using the C compiler.
There are also compilers, libraries and operating system level mechanisms for performing array bounds checking,
buffer overflow detection, serialization and automatic garbage collection, that are not a standard part of C.
Cproto is a program that will read a C source file and output prototypes of all the functions within the source file. This program can be used in conjunction with the make command to create new files containing prototypes each time the source file has been changed. These prototype files can be included by the original source file (e.g., as "filename.p"), which reduces the problems of keeping function definitions and source files in agreement.
It should be recognized that these tools are not a panacea. Because of C's flexibility, some types of errors involving misuse of variadic functions, out-of-bounds array indexing, and incorrect memory management cannot be detected on some architectures without incurring a significant performance penalty. However, some common cases can be recognized and accounted for.

[edit] Related languages
When object-oriented languages became popular,
C++ and Objective-C were two different extensions of C that provided object-oriented capabilities. Both languages were originally implemented as preprocessors -- source code was translated into C, and then compiled with a C compiler.

[edit] C++
Main article:
C++
Bjarne Stroustrup devised the C++ programming language as one approach to providing object-oriented functionality with C-like syntax. C++ adds greater typing strength, scoping and other tools useful in object-oriented programming and permits generic programming via templates. Nearly a superset of C, C++ now supports most of C, with a few exceptions (see Compatibility of C and C++ for an exhaustive list of differences).

[edit] D
Main article:
D (programming language)
Unlike C++, which maintains nearly complete backwards compatibility with C, D makes a clean break with C while maintaining the same general syntax. It abandons a number of features of C which the designer of D considered undesirable, including the C preprocessor and trigraphs, and adds some, but not all, of the extensions of C++.

[edit] Objective-C
Main article:
Objective-C
Objective-C is a very "thin" layer on top of, and is a strict superset of, C that permits object-oriented programming using a hybrid dynamic/static typing paradigm. Objective-C derives its syntax from both C and Smalltalk: syntax that involves preprocessing, expressions, function declarations and function calls is inherited from C, while the syntax for object-oriented features is taken from Smalltalk.

[edit] Other influences
C has directly or indirectly influenced many later languages such as
Java, C#, Perl, PHP, JavaScript, and Unix's C Shell. The most pervasive influence has been syntactical: all of the languages mentioned combine the statement and (more or less recognizably) expression syntax of C with type systems, data models and/or large-scale program structures that differ from those of C, sometimes radically

No comments:

TAKE A TOUR HERE ::-