Interesting test case. It looks like #ifdef NDEBUG #define assert(x) (void)0 #else #define assert(x) ((void)((x) || (__assert_fail(#x, __FILE__, __LINE__, __func__),0))) #endif
is to blame here. If I change that to: #ifdef NDEBUG #define assert(x) (__builtin_assume((x))) #else #define assert(x) ((void)((x) || (__assert_fail(#x, __FILE__, __LINE__, __func__),0))) #endif then I get small output also with NDEBUG defined. Can you verify the same? 2017-07-18 14:51 GMT+03:00 Gaurav Dewan <[email protected]>: > Testcase here(all bcs, js makefile and gcc/clang generated exes): > https://github.com/gauravdewan007/ndebug > > using -DNDEBUG helps to get rid of the assert (and save size and prevent > strings from getting into the code). > Both clang and gcc generate smaller binary if -DNEDBUG option is used. > > But using -DNDEBUG with emscripten build system causes a huge bloat in size > (irrespective of optimization level) and lot of new code is getting added > > -- > You received this message because you are subscribed to the Google Groups > "emscripten-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
