I upgraded today from Ubuntu 12.04 which I think had g++-4.6 to Ubuntu 12.10 with g++-4.7.2. In my code I had a few functions marked as __attribute__((always_inline))
. The reason for this was simply that profiling showed me that it increased the performance of the code significantly. It worked fine with g++ 4.6 but now with g++ 4.7 I get the error message:
error: inlining failed in call to always_inline 'void func_name(args)': function body can be overwritten at link time
I can't share my actual code, I've tried to narrow it down but when I change too much the error goes away, so that's not helpful. I'm interested in the root cause of this error message.
It wasn't my intention to answer this myself, but I accidentally found the answer a few minutes after I had posted.
The reason for this (cryptic) error message was that the function was not marked as inline
, only __attribute((always_inline))
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With