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