On Sat, Mar 21, 2020 at 5:15 AM John Rippetoe <jrippe...@roboticresearch.com> wrote: > > > > > > You can try removing the static from the inline function definitions > > in the header file. The code should then compile, however, you could > > also get multiply defined functions at link time... Or maybe the > > linker is smart enough to allow multiples??? > > > > Putting inline functions in header files introduces lots of problem > > (especially if you are using C89). If they are to be used in header > > files, at least they should not be declared static. > > > Removing static didn't change anything, which makes sense given that no > optimization is happening and the inline keyword is being removed by the > mechanism in compiler.h > > Adding the always_inline attribute worked, but only when static was > still attached. >
always_inline is still a hint to compiler, no 100% guarantee here. For example, it's very hard to inline the recursive function. > All of these issues go away when the standard is set as C99, so the > compiler must be trimming the functions out in this scenario. > > > > CONFIDENTIALITY NOTICE: This communication may contain private, confidential > and privileged material for the sole use of the intended recipient. If you > are not the intended recipient, please delete this e-mail and any attachments > permanently. >