This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: segfault when functions are defined in headers or inlined
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: achkan <ashsalehi4133 at gmail dot com>
- Cc: gcc-help <gcc-help at gcc dot gnu dot org>
- Date: Fri, 10 Jul 2015 11:33:23 +0100
- Subject: Re: segfault when functions are defined in headers or inlined
- Authentication-results: sourceware.org; auth=none
- References: <1436521831306-1167297 dot post at n5 dot nabble dot com>
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).