This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to migrate codebase to C++11


2016-08-22 18:25 GMT+02:00 Jonathan Wakely <jwakely.gcc@gmail.com>:
> On 22 August 2016 at 17:16, Tamás Kiss wrote:
>> Hi Jonathan,
>>
>> Thanks for the answer! I also found the GCC ABI compatibility wiki
>> page you mentioned, that's why I had concerns. At least these seem to
>> be real issues for us:
>
> Based on what, just the GCC versions?

Yes, as the others are not present in 4.8.3. By "real issues" I only
meant "real issues to check", not that they are in fact present in the
code.

>> * `vector::data()`'s return type changes from `pointer` to `_Tp*`
>> [gcc-4.6 - ...]
>
> For this to be an issue you need to be using the non-standard
> vector::data() member (which is not part of C++03) with custom
> allocators that use custom pointers. If you're not doing hat it's not
> an issue.

You're right, I was thinking about string::data(), I did not realize
it is actually vector::data().

>> * `std::operator-(reverse_iterator)` and
>> `std::operator-(__normal_iterator)` [gcc-4.4 - ...]
>> * `istreambuf_iterator::reference` changes from `_CharT&` to `_CharT`
>> [gcc-4.7 - ...]
>
> These are even more unlikely to be real issues in practice.

Right again: I was thinking that we use the Boost 3PP with streams
extensively, but of course we'll recompile Boost to C++11 anyway, so
it's also not an issue. Boost is one of the libraries that I expect to
work in C++11 without issues.

>> This also, but at least it would cause compilation error:
>> * Types with node allocators, like `deque` and lists, maps and sets
>> [... - gcc-5]
>>
>> Based on the wiki page, I'm not sure how we could pinpoint the root
>> cause if any of the above issues would be triggered in our program,
>> especially if they would manifest in some runtime fault.
>
> As the top of the page says, you can check the symbols in your objects
> and libraries to see if any problematic ones are present.

We'll definitely do that. It's just that I still have the feeling that
we're doing some black magic with all these compatibility checks.
Anyway: if it's stupid but it works, it ain't stupid. :)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]