This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Generic questions on inline functions and linking
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: Tim Shen <timshen at google dot com>
- Cc: libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Thu, 23 Jul 2015 10:18:47 +0100
- Subject: Re: Generic questions on inline functions and linking
- Authentication-results: sourceware.org; auth=none
- References: <CAG4ZjNmGfTcZcuZoo=Z8mV7J+RHW1ZN0NbDrrMSPR_6+mi9zQQ at mail dot gmail dot com> <20150722094510 dot GW21787 at redhat dot com> <CAG4ZjN=_3PstvbFTPLQHtu74KGTZhMX4zQZWiWT4aATCSf=g5Q at mail dot gmail dot com>
On 22/07/15 21:36 -0700, Tim Shen wrote:
Thanks for the detailed explanation of ODR. :)
Remember that what I described as a harmless ODR violation *is still
an ODR violation* and so undefined behaviour, but as soon as someone
uses -fno-exceptions or -fno-rtti they are using a non-standard
dialect of C++ which is not defined by the standard anyway.
So some variance from what the standard allows is to be expected when
using those options, especially when mixing objects with and without
those options. In practice it works OK as long as the library is
written with a little care.