segfault when functions are defined in headers or inlined

Jonathan Wakely jwakely.gcc@gmail.com
Fri Jul 10 10:33:00 GMT 2015


On 10 July 2015 at 10:50, achkan wrote:
> The library that I'm trying to compile segfaults whenever an inlined member
> function returns. Inspecting the code with gdb shows that the following
> happens for all inline member functions (I'm really sorry, the code is
> proprietary but I will post code as close as possible to the original one) :

The code you've shown is useless, we don't know how ret or some_class
is defined, or how you've declared the instance of some_class.

If your problem happens with *all* inline functions then you should be
able to write a simple, self-contained, *complete* program that shows
the problem. Without working code that demonstrates the problem my
best guess is you're writing buggy code, because noone else sees the
behaviour you are describing (and thousands and thousands of people
use G++ on Ubuntu without this problem).



More information about the Gcc-help mailing list