- Consider a C++ header file compiled both in
my_lib.a
and inmy_prog
that links withmy_lib.a
. The library was compiled withoutNDEBUG
, whilemy_prog
- withNDEBUG
. Would it result in ODR violation? - What if
my_lib.so
is a shared library? Of course, ODR is irrelevant here, because there are 2 separate executables, but couldNDEBUG
affectstd
(or other) classes in a way that would prevent passing their instances correctly via SO interface? E.g. if anstd::vector
instance was created inmy_prog
, can it be passed as an argument to the SO? MayNDEBUG
affect memory allocation etc?
Does the Standard specify this?