This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [v3] libstdc++/20534, debug mode vs. includes
Paolo Carlini wrote:
>#define _MY_ASSERT(_TEST) \
>if (!(_TEST)) \
> { \
> printf("%s:", __FILE__); \
> printf("%d: ", __LINE__); \
> printf("%s: ", __FUNCTION__); \
> printf("Assertion '%s' failed.\n", #_TEST); \
> abort(); \
> } \
>
>
I can see two problems with this approach:
1- Code bloat: trivially fixed moving out the actual printing to a function.
2- *More serious*: at the moment I don't know how to print the
instantiation types, for templates (that the real assert prints)
Paolo.