Search code examples
autosar

Is the Rte_IRead API always implemented as a macro?


The AUTOSAR_SWS_RTE (R22-11) document gives several examples of Rte_IRead and Rte_IWrite implementation as macros (see "Example 5.23"). Also, SWS_Rte_03730 reads:

Pure API macros, like Rte_IRead and other implicit API functions, do not have a function table entry.

Suggesting that the Rte_IRead commands are always implemented as macros.

However, I have an AUTOSAR Authoring tool which declares Rte_IRead both as C functions and as macros. In practice, the macro is always selected since the preprocessor comes before the name resolution in C.

Is there an AUTOSAR Authoring tool where the Rte_IRead commands are implemented only as functions and not as macros?


Solution

  • Macros often lead to more efficient code. However, e.g. when you create a SWC standalone and deliver an object file or library for integration, this would not work any more. Latest for this, you would need to be able to call a function.

    I would expect that all (major) tools support both.