Safer C / Coding Pitfalls

Abstract:

Goal of the tutorial is that participants know how frequently occuring faults in software for embedded systems can be avoided. A particular focus are the errors induced by the peculiarities of the C language. The tutorial consists of two parts. The first part is a general introduction to the natures of faults and errors including a definition of the terms. It also focusses on the development of the C language standard and some of its curiosities. The second part treats C language traps and best practices and beyond that touches also issues occuring in particular in embedded systems. Many examples are presented, which have been extracted in most cases from errors that occured in real practise. Code snippets are displayed and the participants are asked to find possible errors before the solution is presented and discussed.

It is explained in detail how a standard conform compiler behaves at error prone constructs. One effect of the course is thus a deep understanding of static code analysis. Issues of C expression evaluation as e.g. balancing, integer promotion are handled, as well as the related MISRA construct of underlying type. Suggestions are presented how to deal with the numerous generic C matters as e.g. macros. The course emphasizes on topics related in particular to embedded systems as concurrency, unions, alignment, and endianess.

Speaker Presentation:

Jost Brachert Robert Bosch GmbH Cross Divisional Group - Software, Methods and Tools CDG-SMT/ESB1 Group Manager

Frank Böhland Robert Bosch GmbH Cross Divisional Group - Software, Methods and Tools CDG-SMT/ESB1 SW Architect

CDG-SMT is a Cross Divisional Group in the Robert Bosch Company UBK (Unternehmensbereich Kraftfahrzeuge). CDG-SMT develops Base Software (CUBAS) that can be used in all UBK projects in order to increase reuse. It develops methods and tools for UBK wide cooperation mainly based on AUTOSAR. CDG-SMT/ESB1 ist the group responsible for the software architecture of CUBAS and for software integration, integration test and delivery to the different UBK product lines as ABS and ESP systems, engine management, transmission control, driver assistant systems as radar, video and park pilot systems, as well as airbag systems, body controllers, etc..