This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Why does -Wabi-tag complain when -std=c++03?
- From: Jeffrey Walton <noloader at gmail dot com>
- To: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- Cc: "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Thu, 24 Mar 2016 11:24:31 -0400
- Subject: Re: Why does -Wabi-tag complain when -std=c++03?
- Authentication-results: sourceware.org; auth=none
- References: <CAH8yC8kYCmJqN4E5s9KQP1sH+PdV0axg9GuEf8MPeMQs0ede_w at mail dot gmail dot com> <CAH6eHdQYuMxhEJFD_P7GD1UgTy+oL4d_To9zwY8SJ1VRAD7J=w at mail dot gmail dot com> <CAH8yC8=SPMAapcOLo1=z5VpBnF3icoSzOjYZvNqZvkzuJeYYUA at mail dot gmail dot com> <CAH6eHdSSFOqHkpYBDn-GCE_U=hyZjJ0_-aXxENeRwQ=EHm6S0g at mail dot gmail dot com> <CAH8yC8k0m7c8deWa9GomCrCkLdAocwtqWJy7hvWJtgriKVsm7w at mail dot gmail dot com> <CAH6eHdQmQM_vw70aVgo_qdsXsahNWtGwEne=TxtAK4K1bHX9+w at mail dot gmail dot com> <CAH8yC8=TB=BSxKA1rPSU5xbOyoRGdhtZH60uwss23dXtqPHiZA at mail dot gmail dot com> <CAH6eHdRwhF__1uiL00RXqa8obhRaPN0=OFtW82hTT9O2sc2C_w at mail dot gmail dot com> <CAH8yC8=D2G_k2ByDi=M1g899i9wk=aayfrQA8B_pke8BR3MaEQ at mail dot gmail dot com> <CAH6eHdReZhZ8z8Snw_GgZ2w4PZa3_tmaRYCHS8q7oR8Z9uhhKQ at mail dot gmail dot com> <CAH8yC8mfVBJvVUPJwAt-Foo9w1e+Jz6GU_E5qYUZ3yF07nyJQQ at mail dot gmail dot com>
- Reply-to: noloader at gmail dot com
>>>> The ABI_CHANGE macro in the blog post is just an example of a macro
>>>> that might appear in a third-party library, it's not defined by GCC. I
>>>> thought the fact the example defines abi2::MyType made that fairly
>>>> obvious. That isn't defined by GCC either.
>>>
>>> Actually, no, its not fairly obvious. If that was the intention, then
>>> they only needed to state it.
>>
>> An example showing "abi2::MyType" is obviously not real code with real
>> names. That's just common sense.
>
> No, its not. I'm telling you this from first hand experience from reading it.
>
> My library does not have a problem; the issue is with with std::string
> and std::list. So I'm trying to figure out how to do the things needed
> to work with the updated std::string and std::list.
>
> I perform literal reads, and I don't like to make leaps. As soon as I
> leap, I'll be asked, "why the hell did you do that?".
Here's the actionable item to remove the ambiguity from ABI_CHANGE:
#ifdef MYLIB_ABI_CHANGE
inline namespace abi2 __attribute ((abi_tag)) {
class MyType { ... };
MyType fn();
}
#endif
That way, its clear the define is local to the library, and its not
coming from GCC or the runtime.
(Sorry to beleaguer the point).
Jeff