On 8 May 2018 at 12:01, Xi Ruoyao wrote: > On 2018-05-08 11:40 +0100, Jonathan Wakely wrote: >> On 8 May 2018 at 06:32, Sebastian Huber wrote: >> > Hello, >> > >> > do the C dialect options -std=* affect the ABI? >> > >> > https://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html >> > >> > For example can I safely link objects produced with different C++ standard >> > versions to produce an executable? >> >> You started out asking about C but then finish asking about C++, which >> are you asking about? >> >> For C++ see https://stackoverflow.com/questions/46746878/is-it-safe-to-link-c17-c14-and-c11-objects/49119902#49119902 >> >> To the best of my knowledge the -std options for C do not affect ABI >> either, but I'm less certain than I am for C++. > > But I've seen some "mangled name will change in C++17" warnings > [-Wnoexcept-type]. Would this cause problem? It depends. If you use a function type (or pointer to function type) as a template argument then the template specialization can depend on the type of the function. In C++17 the type of the function is affected by the presence of a non-throwing exception-specification. Does that affect ABI? It depends whether your template instantiations are part of your code's ABI. You can often use a conversion to a non-noexcept function type to instantiate the same specialization of the template as would be used in C++14.