Comment 6 for bug 1306426

Revision history for this message
Uqbar (uqbar) wrote :

NDEBUG has also the interesting side effect to disable the code that's in the assert() macros.

[uqbar@Feynman ~/Files/000_Software/pngquant-2.1.0/lib] grep assert *.[hc]
blur.c: assert(size > 0);
libimagequant.c: assert(0 == (((uintptr_t)ptr) & 15));
libimagequant.c: assert(offset > 0 && offset <= 16);
libimagequant.c: assert(callback);
libimagequant.c: assert(temp_row);
libimagequant.c: assert(img->temp_row);
libimagequant.c: assert(row_f_pixels);
libimagequant.c: assert(!USE_SSE || 0 == ((uintptr_t)row_f_pixels & 15));
libimagequant.c: assert(omp_get_thread_num() == 0);
mediancut.c: assert(!isnan(r) && !isnan(g) && !isnan(b) && !isnan(a));
mempool.c:#include <assert.h>
mempool.c: assert(!(((uintptr_t)(*mptr) + (*mptr)->used) & ALIGN_MASK));
nearest.c: assert(colorsused < 2 || colors[0].radius <= colors[1].radius); // closest first
nearest.c: assert(map->colors > 0);
nearest.c: assert(likely_colormap_index < centroids->map->colors);
nearest.c: assert(heads[i].num_candidates);
pam.h:#include <assert.h>
pam.h: assert(fabs(res - colordifference_stdc(px,py)) < 0.001);

All that code get disabled by defining NDEBUG.
I suspect the impact can be relevant, especially from mr. Kornel Lesiński feedbacks...