obvious are conditional preprocessor directives, and macros.
why ?
- interfaces dependencies do not require the preprocessor
- typedef dependencies might require the preprocessor, but we (in the team) are not allowed by the boss to use any #define with typedef, and it makes him pissed off if he sees a an abuse of #define, and our code must also pass a lot of "code-validators" in order to make the commit accepted in the repository (our final customers want that way)
but in case of need, I have no trouble to "add" a "preprocessor" that expands macros and #defines, I have already coded a working one and I can integrate into my tools.
to tell you the truth, we have a special include file in our projects, it's called "types.h", it's located at the top of our libraries path and it's a mixture of #define and typedef, but mainly typedef is used to (re)define things like uint32_t, fp_IEEE_754 _t , fxp32_t (fixed point, used by our soft core, VHDL), etc, while #define is used to (re)define the language, e.g. we are NOT allowed to use "==" in the if-then-else statement, so we have to use "isEqualTo", and we can't use "&" to get the address of an entity, we must use "get_address()", which are both #defines
- "
it's boring and pedantic, but it makes sense" - I was told by my boss, even if I am still too young to understand
why? What I Know is that our sources need to pass a super-set of MISRA checks, I mean our customers give us their "code validators" and we have to apply them to our sources. These "code validators" are extremely pedantic and also apply special rules from
DO178/A-B, plus other constraints, e.g. for each module the maximal
McCabe Cyclomatic Complexity must be < 7, which is not "C", and it's not MISRA, it's an additional rule imposed by our customers.
I am not in the development squad, I am the testing-boy, unfortunately, because of my
junior-profile, against their
senior-profile, so often I am asked to care about the full documentation, which I have to provide written in
Microsoft Word (puuaahhh, I hate it, but I MUST use), plus an other document produced by
Stood. A part of this documentation is related to the dependencies, so I have to fill a big matrix {1..n,1..n} in where I have to enumerate all the modules from 1---to--n and then, for each 1={1..n} I have to indicate which module is in dependency by which module, with both direct and inverse matrix.
Stood should be able to provide all of these informations, but ... it's an other story, like having the full version released only for SunOS, with the licence expired since a while, problems to get a new license (never understood the Why-on-the-Why(1)?), and a demo version for Windows installed on our desks, which is cool and free but with a lot of features disabled (including the dependency matrix
) ....
(1) about the Why-on-the-Why
I guess, because a job in avionics must not be fun