Skip to contentSkip to conversation

docs/misra: add always_inline to C-language-toolchain

PATCH In review Stefano Stabellini 2 participants 3 messages Aug 4, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 docs/misra: add always_inline to C-language-toolchain

From: Stefano Stabellini <[email protected]>

---
 docs/misra/C-language-toolchain.rst | 2 ++
 1 file changed, 2 insertions(+)
docs/misra/C-language-toolchain.rst +2 -0
index 785aed1eaf..21b292898c 100644
@@ -84,6 +84,8 @@ The table columns are as follows:
           see Sections "6.48 Alternate Keywords" and "6.47.2.1 Volatile" of GCC_MANUAL.
        __const__, __inline__, __inline:
           see Section "6.48 Alternate Keywords" of GCC_MANUAL.
+       always_inline:
+          see Section "6.45 An Inline Function is As Fast As a Macro" of GCC_MANUAL.
        typeof, __typeof__:
           see Section "6.7 Referring to a Type with typeof" of GCC_MANUAL.
        __alignof__, __alignof:
Signature · 1 line
2.25.1
#1 lore raw

docs/misra/C-language-toolchain.rst The table columns are as follows: · line 91

Quoted 11 lines · Stefano Stabellini
docs/misra/C-language-toolchain.rst +2 -0
@@ -84,6 +84,8 @@ The table columns are as follows:
           see Sections "6.48 Alternate Keywords" and "6.47.2.1 Volatile" of GCC_MANUAL.
        __const__, __inline__, __inline:
           see Section "6.48 Alternate Keywords" of GCC_MANUAL.
+       always_inline:
+          see Section "6.45 An Inline Function is As Fast As a Macro" of GCC_MANUAL.
        typeof, __typeof__:
           see Section "6.7 Referring to a Type with typeof" of GCC_MANUAL.
        __alignof__, __alignof:

This is the "Non-standard tokens" section. What you add is a macro of our own. In its expansion we don't use the similarly named attribute in this very spelling, but with underscores prefixed and suffixed to it.

If we mean to enumerate __attribute__(()) identifier tokens here as well, then I think we should add all of them that we use. But that's going to be an ever expanding list.

In any event I don't think such an addition can come with an empty description.

Jan

#2 lore raw
Quoted 17 lines · Jan Beulich

docs/misra/C-language-toolchain.rst The table columns are as follows: · line 91

Quoted 11 lines · Stefano Stabellini
docs/misra/C-language-toolchain.rst +2 -0
@@ -84,6 +84,8 @@ The table columns are as follows:
           see Sections "6.48 Alternate Keywords" and "6.47.2.1 Volatile" of GCC_MANUAL.
        __const__, __inline__, __inline:
           see Section "6.48 Alternate Keywords" of GCC_MANUAL.
+       always_inline:
+          see Section "6.45 An Inline Function is As Fast As a Macro" of GCC_MANUAL.
        typeof, __typeof__:
           see Section "6.7 Referring to a Type with typeof" of GCC_MANUAL.
        __alignof__, __alignof:

This is the "Non-standard tokens" section. What you add is a macro of our own. In its expansion we don't use the similarly named attribute in this very spelling, but with underscores prefixed and suffixed to it.

Quoted 3 lines

If we mean to enumerate __attribute__(()) identifier tokens here as well, then I think we should add all of them that we use. But that's going to be an ever expanding list.

Ah! Now it makes sense. I missed this:

#define always_inline __inline__ __attribute__ ((__always_inline__))

That is why it wasn't already listed in the document: we didn't list all the __attribute__(()) and this is just one of them. They are clearly marked extensions so there is no strict need to list them also here.

I'll drop the patch.