Explore chapters and articles related to this topic
Software
Published in Dobrivoje Popovic, Vijay P. Bhatkar, Distributed Computer Control for Industrial Automation, 2017
Dobrivoje Popovic, Vijay P. Bhatkar
C-language is a general purpose programming language, mainly developed by D.M. Ritchie and B.W. Kernighan. The development of the language was closely related to the development of UNIX operating system, which itself was developed in C programming language. This characterizes the language as a systems programming language, i.e., a language in which system software (operating systems, interpreters, compilers, assemblers, editors, etc.) can be developed. However, in the same language also application programs can be easily developed.
A GCC-based checker for compliance with MISRA-C's single-translation-unit rules
Published in Connection Science, 2023
Chih-Yuan Chen, Yung-An Fang, Guan-Ren Wang, Peng-Sheng Chen
Reliability and safety are significant issues during software development. As the developing code becomes larger and more complex, these issues become increasingly important. For example, the software in a modern car may have up to 100 million lines of code (Mihailovici, 2021). As vehicles gain increasingly complex functions, the required code will continue to grow. In the next decade, a car could run an average of about 300 million lines of code (Synopsys, n.d.b). Ensuring that such massive amounts of code meet the developers' expectations for their execution and future maintenance will be a significant task (Bagnara et al., 2018, 2019). The C programming language (ISO, 1999; SC22/WG14, 1990) is a general-purpose language that is widely used across various applications. It is also a systems programming language designed to meet the requirements of system programs, including the UNIX operating system and a series of system utilities. A weakness of its type system is that even a program with typographical errors may still be valid code. Figure 1 shows an example C program. In Line 8, == is mistyped as =. The intention was for *ptr to be compared with 0, but instead 0 is stored in *ptr. The statement at Line 9 will not be executed owing to the value of *ptr. In Line 12, the pointer arithmetic goes beyond the bounds of array A, so the de-reference of the pointer has undefined behavior. The C language assumes that programmers know what they are doing: any error in the code may be passed without being noticed by the language. It is also possible that the behavior of a C program cannot be predicted. Therefore, using the C language in safety-related systems requires considerable care.