This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Expected Behavior in Mixing -std=c++0x and default std?
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Hei Chan <structurechart at yahoo dot com>
- Cc: "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Tue, 8 Apr 2014 15:31:18 +0100
- Subject: Re: Expected Behavior in Mixing -std=c++0x and default std?
- Authentication-results: sourceware.org; auth=none
- References: <1396944400 dot 37620 dot YahooMailNeo at web165001 dot mail dot bf1 dot yahoo dot com>
On 8 April 2014 09:06, Hei Chan wrote:
> Hi,
>
> If I have a static library A that builds with default std with another header only library B, and then my program links library A and uses some classes in library B with -std=c++0x. Will this usage create any issue?
>
> I am running into an issue that one of the member variables in library B (boost ASIO to be precise) has a different memory address (only off by 4 bytes) over time.
>
> Any input is welcome.
>
> Thanks in advance.
>
>
> Cheers,
> Hei
> P.S. I am using GCC 4.6.x on CentOS 6.5.
With GCC 4.6.x, 4.7.2 or 4.8.x that should work OK. With GCC 4.7.0 or
4.7.1 there would be a problem if B uses std::list.
You should be able to find why the offset of the ASIO type changed, it
might not be due to a std::lib type.