Will send a v2 if needed.Hi Yash,
First, if we're going to take this approach, you should revert my work-around as part of this commit:
commit ca10312c4c7e88d67f4b487ae9afcbfdf92898d6
Author: Randy MacLeod <Randy.MacLeod@...>
Date: Wed Mar 1 19:24:27 2023
librelp: make inline errors be warnings in debug build
...
I tested the changes in LINCD sources which have GCC 12.2. I didn’t check the above mentioned version.BUT...
The problem isn't so much that the code doesn't get in-lined when doing a debug build but
that it fails to compile. I think this is a compiler regressions since
I was not able to reproduce the error when compiling natively using Ubuntu-22.04 (gcc-11.3) but
was able to reproduce it using Fedora-37, gcc --version : gcc (GCC) 12.2.1 20221121 (Red Hat 12.2.1-4)
Does the change you made actually build with the two compiler versions above?
Is there documentation that states thatstatic inline void is not as portable as: __attribute__((always_inline)) static inline void
I suspect there is not but I'm not a compiler geek!
GCC does not inline any functions when not optimizing unless you specify the ‘always_inline’ attribute for the function, like this:/* Prototype. */ inline void foo (const char) __attribute__((always_inline));
../Randy
Regards,
Yash