Explore chapters and articles related to this topic
Variability-intensive Software Systems
Published in Ivan Mistrik, Matthias Galster, Bruce R. Maxim, Software Engineering for Variability Intensive Systems, 2019
Matthias Galster, Ivan Mistrik, Bruce Maxim
Conditional compilation is supported by preprocessors in languages like C. Preprocessor directives (e.g., #ifdef in C) enable programmers to include or exclude parts of the code by providing a corresponding configuration [70]. As argued by Hunsen and colleagues, preprocessors in C are widely used to implement highly configurable systems in industrial and open-source software systems [70]. For example, the Linux kernel uses the preprocessor to allow developers to choose among 12,000 distinct options at build time. Approaches have been proposed to check for bugs in preprocessor directives. For example, the TypeChef infrastructure [71] supports parsing and type-checking C code with #ifdef variability, targeted at finding bugs in highly configurable systems such as the Linux kernel.
C Programming
Published in Paul W. Ross, The Handbook of Software for Engineers and Scientists, 2018
The two most common such commands will be discussed here: #include and #de-fine. We have already seen a use of the #include in previous sections. This command is followed by the name of a file. The preprocessor inserts the contents of this file into the program’s file at the point of the #include command. This is frequently used to include files that contain function prototypes or definition of constants or types when these definitions or prototypes are needed in several files. If the file name is surrounded by quotes, the system looks for the file in the user’s default directory. If the name is surrounded by < and >, then the preprocessor looks for this file in special library directories. Thus, in the previous section the preprocessor command “#include <stdio.h>” searches for this header file in the standard library. The command “#include “list.h” causes the preprocessor to look for this file in the user’s default directory.
Cross-Compilation Toolchain
Published in Gedare Bloom, Joel Sherrill, Tingting Hu, Ivan Cibrario Bertolotti, Real-Time Systems Development with RTEMS and Multicore Processors, 2020
Gedare Bloom, Joel Sherrill, Tingting Hu, Ivan Cibrario Bertolotti
When a macro is invoked, the preprocessor performs macro expansion. In the simplest case—that is, for object-like macros—macro expansion is triggered by encountering a macro name in the source code.
Review of CAD-model capabilities and restrictions for multidisciplinary use
Published in Computer-Aided Design and Applications, 2018
Tim Heikkinen, Joel Johansson, Fredrik Elgh
As a starting point for this study an existing method utilizing the CAD-model as a carrier of multidisciplinary information was explored. This method is an updated version of the work presented in [10]. The method enables formalisation of Finite Element Analysis (FEA) from within CAD software and had been realized in a feature-based CAD modeller (Solidworks). ANSA was used as a pre-processor and LS-dyna as a post-processor. The approach was to enable the formalisation and execution of pre-processor operations from within the CAD environment, providing a link between geometry and FEA features. Examples of FEA features are mesh geometry such as beam, tetrahedron, pyramid, and triangle elements as well as FEA properties such as material, constraints, and boundary conditions. To do this the traditional CAD-model geometry was not always enough and was therefore extended with additional geometric entities, created only for FEA. As an example, see surface within bolt in Fig. 3 which is used to create a structured triangular mesh utilising the rotation operation. Programmed features (known as macro-features in Solidworks) had been made which when instantiated provided an easy to use user-interface with the necessary inputs, such as geometry, strings, and numerals, illustrated on left-hand side in Fig. 3. Just as any other CAD-feature it was placed in the feature-tree which can be seen in the centre of Fig. 3 called MeshPart1. In this way, it was a part of the CAD-rebuild process and updated according to any related changes made. The execution of the programmed-features was separated to run all in one go in contrast to the other functional features. To automate pre-processor operations within ANSA a template macro-script had been made where each FEA operation had a specified code-section with the inputs required noted with special characters (@ signs), see Fig. 5. In this way, each programmed-feature could copy the necessary code-sections and replace the needed inputs at the given position. Geometric inputs were exported in a neutral CAD-file format (Parasolid) and the components names were used as identifiers.